JezK
Edit File: event_details.php
<?php require_once('../wp-load.php'); date_default_timezone_set('Europe/Brussels'); $current_time = new DateTime(); //$current_time->format('Y-m-d H:i:s'); define('WP_USE_THEMES', false); //require('../wp-blog-header.php'); get_header(); //Include header ?> <?php //error_reporting(0); include 'db_connection.php'; $event_id = base64_decode($_GET['event_id']); $view_details = ("SELECT * FROM `events` WHERE `id` = '$event_id'"); $result = $conn->query($view_details); $data = $result->fetch_assoc(); $fullMonth = date('F', strtotime($data['event_date'])); $end_fullMonth = date('F', strtotime($data['event_end_date'])); $fullyear = date('Y', strtotime($data['event_date'])); $end_fullyear = date('Y', strtotime($data['event_end_date'])); $start_date = date('d', strtotime($data['event_date'])); $end_date = date('d', strtotime($data['event_end_date'])); $event_date_same = strtotime($data['event_date']); $event_end_date_same = strtotime($data['event_end_date']); $partner_type = $data['partner_type']; ?> <!DOCTYPE html> <script> document.title = "Event Details"; </script> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Event Details</title> <meta property="og:title" content="Initial Title" /> <link rel="stylesheet" href="navigation.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script> <!-- jQuery --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!-- Toastr --> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script> <style> @media (min-width: 922px) { .site-content .ast-container { display: contents; } } .bread_crumbs a { color: #20bec7; } .ast-builder-html-element p{ margin: 0 !important; padding-top: 5px !important; } .ast-builder-html-element p a{ color: white; } input { background: white !important; } .btn_pay:hover { color: white; font-weight: 600; } button#pay_button { font-weight: 600; } table { border: none; } .floating-input:focus { border-style: solid !important; } .buttons:hover { color: #fff !important; } .buttons:focus { color: #fff !important; } .ast-builder-footer-grid-columns.site-below-footer-inner-wrap.ast-builder-grid-row { align-items: baseline; } a { text-decoration: none !important; } .toast-message { color: #fff !important; } .ast-page-builder-template .site-content>.ast-container { max-width: 100% !important; padding: 0 !important; } @media (max-width: 800px) { .ast-separate-container #content .ast-container { padding-left: 0em !important; padding-right: 0em !important; } } .ast-desktop .ast-primary-header-bar.main-header-bar, .ast-header-break-point #masthead .ast-primary-header-bar.main-header-bar { margin-top: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; } .loaderLottie { position: absolute; top: 35%; height: 150px; } #overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: none; z-index: 9999; } @media (max-width: 767px) { .gold_members { display: block; } } table tr td p { margin-top: 0; margin-bottom: 0px; }table tr td{ padding: 8px; border-width: 0 1px 1px 0; min-width: 120px; } table tr td p { padding-top: 0px; } .gold_img_1 { width: 223px; height: 140px; object-fit: contain; border-radius: 0.3rem; } table.table-borderless tr td { border: 1px solid; } </style> </head> <body> <div id="overlay"> <lottie-player src="data.json" background="transparent" speed="1" class="loaderLottie" loop="true" autoplay="true"></lottie-player> </div> <div> <div class="header"> <?php if($event_id == '45') { ?> <div class=" d-flex align-items-center justify-content-center"> <div> <img src="https://global-reia.org/events/REIA-logo.png" width="200px" height="auto" /> </div> <div> <h3 class="font-weight-bold"> <?php echo $data['title']; ?> </h3> <h3 class="font-weight-bold">DATE: <span> <?php $fullMonth = date('F', strtotime($data['event_date'])); $end_fullMonth = date('F', strtotime($data['event_end_date'])); $fullyear = date('Y', strtotime($data['event_date'])); $end_fullyear = date('Y', strtotime($data['event_end_date'])); $start_date = date('d', strtotime($data['event_date'])); $end_date = date('d', strtotime($data['event_end_date'])); $event_date_same = strtotime($data['event_date']); $event_end_date_same = strtotime($data['event_end_date']); $currentMonth = date("F"); ?> <?php if($data['event_end_date'] != '') { ?> <?php if ($start_date == $end_date) { echo $fullMonth . ' ' . $start_date . ', ' . $fullyear; } else if ($fullMonth != $end_fullMonth) { echo $fullMonth . ' ' . $start_date . ' - ' . $end_fullMonth . ' ' . $end_date . ', ' . $end_fullyear; } else { echo $fullMonth . ' ' . $start_date . ' - ' . $end_date . ', ' . $end_fullyear; } ?> <?php } else { ?> <?php echo $fullMonth . ' ' . $start_date . ', ' . $fullyear; ?> <?php } ?> </span></h3> <h3 class="font-weight-bold">LOCATION : <span> <?php echo $data['event_location']; ?> </span></h3> <!-- <span class="bread_crumbs"><a href="https://global-reia.org/">Home</a> / <a href="https://global-reia.org/events">Events</a> / <?php echo $data['title']; ?> </span> --!> </div> <div> <img src="https://global-reia.org/events/JOGMEC-logo.png" width="200px" height="auto" /> </div> </div> <?php } else { ?> <div> <div> <h3 class="font-weight-bold"> <?php echo $data['title']; ?> </h3> <h3 class="font-weight-bold">DATE : <span> <?php $fullMonth = date('F', strtotime($data['event_date'])); $end_fullMonth = date('F', strtotime($data['event_end_date'])); $fullyear = date('Y', strtotime($data['event_date'])); $end_fullyear = date('Y', strtotime($data['event_end_date'])); $start_date = date('d', strtotime($data['event_date'])); $end_date = date('d', strtotime($data['event_end_date'])); $event_date_same = strtotime($data['event_date']); $event_end_date_same = strtotime($data['event_end_date']); $currentMonth = date("F"); ?> <?php if($data['event_end_date'] != '') { ?> <?php if ($start_date == $end_date) { echo $fullMonth . ' ' . $start_date . ', ' . $fullyear; } else if ($fullMonth != $end_fullMonth) { echo $fullMonth . ' ' . $start_date . ' - ' . $end_fullMonth . ' ' . $end_date . ', ' . $end_fullyear; } else { echo $fullMonth . ' ' . $start_date . ' - ' . $end_date . ', ' . $end_fullyear; } ?> <?php } else { ?> <?php echo $fullMonth . ' ' . $start_date . ', ' . $fullyear; ?> <?php } ?> </span></h3> <h3 class="font-weight-bold">LOCATION : <span> <?php echo $data['event_location']; ?> </span></h3> <!-- <span class="bread_crumbs"><a href="https://global-reia.org/">Home</a> / <a href="https://global-reia.org/events">Events</a> / <?php echo $data['title']; ?> </span> --!> </div> </div> <?php } ?> </div> <div class="container mt-5"> <?php echo $data['description']; ?> <?php if($data['booking_type'] == '1') { $speakers = ("SELECT * FROM `speakers` WHERE event_id = '$event_id'"); $result = $conn->query($speakers); if ($result->num_rows > 0) { ?> <h2 class="font-weight-bold mt-0">Featured Speakers</h2> <div class="profile_card"> <?php while ($row = $result->fetch_assoc()) { ?> <div class="cards"> <div class="card-single" data-toggle="modal" data-target="#myModal<?php echo $row['id'] ?>"> <img src="../admin/assets/speakers/<?php echo $row['image']; ?>" /> <div class="card-text"> <h5> <?php echo $row['speaker_name'] ?> </h5> <p> <?php echo $row['designation'] ?> </p> </div> </div> </div> <div class="modal fade" id="myModal<?php echo $row['id'] ?>"> <div class="modal-dialog"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body text-center"> <img src="../admin/assets/speakers/<?php echo $row['image']; ?>" /> <h4> <?php echo $row['speaker_name']; ?> </h4> <h6 class="text-dark"> <?php echo $row['designation']; ?> </h6> <p> <?php echo $row['description']; ?> </p> </div> <!-- Modal footer --> </div> </div> </div> <?php } } ?> </div> </div> <!-- The Modal --> <div class="container"> <?php $agenda_query = "SELECT * FROM agenda WHERE event_id = '$event_id' order by agenda_date"; $result = $conn->query($agenda_query); if ($result->num_rows > 0) { ?> <div> <h2 class="font-weight-bold">Programme agenda</h2> <p style="color: grey; font-weight: bold">Subject to change</p> <table class="table-borderless"> <?php $last_date = null; while ($row = $result->fetch_assoc()) { $current_date = $row['agenda_date']; $formatted_date = $current_date != '0000-00-00' ? date("j F Y", strtotime($current_date)) : ''; if ($current_date !== $last_date) { if ($last_date !== null) { echo "<tr><td colspan='2'> <br></td></tr>"; } if (!empty($formatted_date)) { echo "<tr><td colspan='2'><h5>$formatted_date</h5></td></tr>"; } $last_date = $current_date; } ?> <tr> <td class="time"> <?php echo $row['agenda_time']; ?> </td> <td> <?php echo html_entity_decode($row['agenda'], ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php } ?> </table> </div> <?php } ?> </div> <div class="container"> <?php // Example: Adding a "Registration is closed" message for a specific event if ($event_id == 45) { ?> <h5 style="color: red;">Registration for this event is now closed.</h5> <?php } ?> </div> <?php $companies = "SELECT * FROM `companies` WHERE `event_id` = '$event_id' ORDER BY `order_position` ASC"; $result = $conn->query($companies); if ($result->num_rows > 0) { ?> <div class="container"> <?php // echo $event_id; if($event_id ==450) { ?> <h2 class="font-weight-bold">Participant Organisations in 2023 </h2> <?php } else if($event_id!= 30) { ?> <h2 class="font-weight-bold">Participant Organisations <?php echo $fullyear; ?> </h2> <?php } else { ?> <h2 class="font-weight-bold">Participant Organisations </h2> <?php } ?> <div> <div class="participate_companies"> <?php while ($row = $result->fetch_assoc()) { ?> <ul> <li> <?php echo $row['company_name']; ?> </li> </ul> <?php } ?> </div> </div> </div> <?php } ?> <div class="container"> <div class="event_reg"> <?php if ($data['event_date'] >= date('Y-m-d')) { ?> <?php if($data['id'] == '45' AND $data['reg_close'] >= $current_time->format('Y-m-d H:i:s') ) { ?> <div class="col-12 col-lg-6 pl-0"> <h2 class="font-weight-bold">Register</h2> <form id="payment-form" method="post"> <div class="floating-form"> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="first_name" id="first_name"> <span class="highlight"></span> <label>* First Name</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="last_name" id="last_name"> <span class="highlight"></span> <label>* Last Name</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="position" id="position"> <span class="highlight"></span> <label>Position</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="company_name" id="company_name"> <span class="highlight"></span> <label>* Company Name</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="city" id="city"> <span class="highlight"></span> <label>City</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="country" id="country"> <span class="highlight"></span> <label>* Country</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="vat_number" id="vat_number"> <span class="highlight"></span> <label> VAT Number</label> </div> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="email" id="email"> <span class="highlight"></span> <label>* Email</label> </div> <div style="display: flex;"> <select name="countryCode" class="countries" id="countryCode"> <option data-countryCode="GB" value="44" Selected>UK (+44)</option> <option data-countryCode="US" value="1">USA (+1)</option> <optgroup label="Other countries"> <option data-countryCode="DZ" value="213">Algeria (+213)</option> <option data-countryCode="AD" value="376">Andorra (+376)</option> <option data-countryCode="AO" value="244">Angola (+244)</option> <option data-countryCode="AI" value="1264">Anguilla (+1264)</option> <option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268) </option> <option data-countryCode="AR" value="54">Argentina (+54)</option> <option data-countryCode="AM" value="374">Armenia (+374)</option> <option data-countryCode="AW" value="297">Aruba (+297)</option> <option data-countryCode="AU" value="61">Australia (+61)</option> <option data-countryCode="AT" value="43">Austria (+43)</option> <option data-countryCode="AZ" value="994">Azerbaijan (+994)</option> <option data-countryCode="BS" value="1242">Bahamas (+1242)</option> <option data-countryCode="BH" value="973">Bahrain (+973)</option> <option data-countryCode="BD" value="880">Bangladesh (+880)</option> <option data-countryCode="BB" value="1246">Barbados (+1246)</option> <option data-countryCode="BY" value="375">Belarus (+375)</option> <option data-countryCode="BE" value="32">Belgium (+32)</option> <option data-countryCode="BZ" value="501">Belize (+501)</option> <option data-countryCode="BJ" value="229">Benin (+229)</option> <option data-countryCode="BM" value="1441">Bermuda (+1441)</option> <option data-countryCode="BT" value="975">Bhutan (+975)</option> <option data-countryCode="BO" value="591">Bolivia (+591)</option> <option data-countryCode="BA" value="387">Bosnia Herzegovina (+387)</option> <option data-countryCode="BW" value="267">Botswana (+267)</option> <option data-countryCode="BR" value="55">Brazil (+55)</option> <option data-countryCode="BN" value="673">Brunei (+673)</option> <option data-countryCode="BG" value="359">Bulgaria (+359)</option> <option data-countryCode="BF" value="226">Burkina Faso (+226)</option> <option data-countryCode="BI" value="257">Burundi (+257)</option> <option data-countryCode="KH" value="855">Cambodia (+855)</option> <option data-countryCode="CM" value="237">Cameroon (+237)</option> <option data-countryCode="CA" value="1">Canada (+1)</option> <option data-countryCode="CV" value="238">Cape Verde Islands (+238)</option> <option data-countryCode="KY" value="1345">Cayman Islands (+1345)</option> <option data-countryCode="CF" value="236">Central African Republic (+236) </option> <option data-countryCode="CL" value="56">Chile (+56)</option> <option data-countryCode="CN" value="86">China (+86)</option> <option data-countryCode="CO" value="57">Colombia (+57)</option> <option data-countryCode="KM" value="269">Comoros (+269)</option> <option data-countryCode="CG" value="242">Congo (+242)</option> <option data-countryCode="CK" value="682">Cook Islands (+682)</option> <option data-countryCode="CR" value="506">Costa Rica (+506)</option> <option data-countryCode="HR" value="385">Croatia (+385)</option> <option data-countryCode="CU" value="53">Cuba (+53)</option> <option data-countryCode="CY" value="90392">Cyprus North (+90392)</option> <option data-countryCode="CY" value="357">Cyprus South (+357)</option> <option data-countryCode="CZ" value="42">Czech Republic (+42)</option> <option data-countryCode="DK" value="45">Denmark (+45)</option> <option data-countryCode="DJ" value="253">Djibouti (+253)</option> <option data-countryCode="DM" value="1809">Dominica (+1809)</option> <option data-countryCode="DO" value="1809">Dominican Republic (+1809)</option> <option data-countryCode="EC" value="593">Ecuador (+593)</option> <option data-countryCode="EG" value="20">Egypt (+20)</option> <option data-countryCode="SV" value="503">El Salvador (+503)</option> <option data-countryCode="GQ" value="240">Equatorial Guinea (+240)</option> <option data-countryCode="ER" value="291">Eritrea (+291)</option> <option data-countryCode="EE" value="372">Estonia (+372)</option> <option data-countryCode="ET" value="251">Ethiopia (+251)</option> <option data-countryCode="FK" value="500">Falkland Islands (+500)</option> <option data-countryCode="FO" value="298">Faroe Islands (+298)</option> <option data-countryCode="FJ" value="679">Fiji (+679)</option> <option data-countryCode="FI" value="358">Finland (+358)</option> <option data-countryCode="FR" value="33">France (+33)</option> <option data-countryCode="GF" value="594">French Guiana (+594)</option> <option data-countryCode="PF" value="689">French Polynesia (+689)</option> <option data-countryCode="GA" value="241">Gabon (+241)</option> <option data-countryCode="GM" value="220">Gambia (+220)</option> <option data-countryCode="GE" value="7880">Georgia (+7880)</option> <option data-countryCode="DE" value="49">Germany (+49)</option> <option data-countryCode="GH" value="233">Ghana (+233)</option> <option data-countryCode="GI" value="350">Gibraltar (+350)</option> <option data-countryCode="GR" value="30">Greece (+30)</option> <option data-countryCode="GL" value="299">Greenland (+299)</option> <option data-countryCode="GD" value="1473">Grenada (+1473)</option> <option data-countryCode="GP" value="590">Guadeloupe (+590)</option> <option data-countryCode="GU" value="671">Guam (+671)</option> <option data-countryCode="GT" value="502">Guatemala (+502)</option> <option data-countryCode="GN" value="224">Guinea (+224)</option> <option data-countryCode="GW" value="245">Guinea - Bissau (+245)</option> <option data-countryCode="GY" value="592">Guyana (+592)</option> <option data-countryCode="HT" value="509">Haiti (+509)</option> <option data-countryCode="HN" value="504">Honduras (+504)</option> <option data-countryCode="HK" value="852">Hong Kong (+852)</option> <option data-countryCode="HU" value="36">Hungary (+36)</option> <option data-countryCode="IS" value="354">Iceland (+354)</option> <option data-countryCode="IN" value="91">India (+91)</option> <option data-countryCode="ID" value="62">Indonesia (+62)</option> <option data-countryCode="IR" value="98">Iran (+98)</option> <option data-countryCode="IQ" value="964">Iraq (+964)</option> <option data-countryCode="IE" value="353">Ireland (+353)</option> <option data-countryCode="IL" value="972">Israel (+972)</option> <option data-countryCode="IT" value="39">Italy (+39)</option> <option data-countryCode="JM" value="1876">Jamaica (+1876)</option> <option data-countryCode="JP" value="81">Japan (+81)</option> <option data-countryCode="JO" value="962">Jordan (+962)</option> <option data-countryCode="KZ" value="7">Kazakhstan (+7)</option> <option data-countryCode="KE" value="254">Kenya (+254)</option> <option data-countryCode="KI" value="686">Kiribati (+686)</option> <option data-countryCode="KP" value="850">Korea North (+850)</option> <option data-countryCode="KR" value="82">Korea South (+82)</option> <option data-countryCode="KW" value="965">Kuwait (+965)</option> <option data-countryCode="KG" value="996">Kyrgyzstan (+996)</option> <option data-countryCode="LA" value="856">Laos (+856)</option> <option data-countryCode="LV" value="371">Latvia (+371)</option> <option data-countryCode="LB" value="961">Lebanon (+961)</option> <option data-countryCode="LS" value="266">Lesotho (+266)</option> <option data-countryCode="LR" value="231">Liberia (+231)</option> <option data-countryCode="LY" value="218">Libya (+218)</option> <option data-countryCode="LI" value="417">Liechtenstein (+417)</option> <option data-countryCode="LT" value="370">Lithuania (+370)</option> <option data-countryCode="LU" value="352">Luxembourg (+352)</option> <option data-countryCode="MO" value="853">Macao (+853)</option> <option data-countryCode="MK" value="389">Macedonia (+389)</option> <option data-countryCode="MG" value="261">Madagascar (+261)</option> <option data-countryCode="MW" value="265">Malawi (+265)</option> <option data-countryCode="MY" value="60">Malaysia (+60)</option> <option data-countryCode="MV" value="960">Maldives (+960)</option> <option data-countryCode="ML" value="223">Mali (+223)</option> <option data-countryCode="MT" value="356">Malta (+356)</option> <option data-countryCode="MH" value="692">Marshall Islands (+692)</option> <option data-countryCode="MQ" value="596">Martinique (+596)</option> <option data-countryCode="MR" value="222">Mauritania (+222)</option> <option data-countryCode="YT" value="269">Mayotte (+269)</option> <option data-countryCode="MX" value="52">Mexico (+52)</option> <option data-countryCode="FM" value="691">Micronesia (+691)</option> <option data-countryCode="MD" value="373">Moldova (+373)</option> <option data-countryCode="MC" value="377">Monaco (+377)</option> <option data-countryCode="MN" value="976">Mongolia (+976)</option> <option data-countryCode="MS" value="1664">Montserrat (+1664)</option> <option data-countryCode="MA" value="212">Morocco (+212)</option> <option data-countryCode="MZ" value="258">Mozambique (+258)</option> <option data-countryCode="MN" value="95">Myanmar (+95)</option> <option data-countryCode="NA" value="264">Namibia (+264)</option> <option data-countryCode="NR" value="674">Nauru (+674)</option> <option data-countryCode="NP" value="977">Nepal (+977)</option> <option data-countryCode="NL" value="31">Netherlands (+31)</option> <option data-countryCode="NC" value="687">New Caledonia (+687)</option> <option data-countryCode="NZ" value="64">New Zealand (+64)</option> <option data-countryCode="NI" value="505">Nicaragua (+505)</option> <option data-countryCode="NE" value="227">Niger (+227)</option> <option data-countryCode="NG" value="234">Nigeria (+234)</option> <option data-countryCode="NU" value="683">Niue (+683)</option> <option data-countryCode="NF" value="672">Norfolk Islands (+672)</option> <option data-countryCode="NP" value="670">Northern Marianas (+670)</option> <option data-countryCode="NO" value="47">Norway (+47)</option> <option data-countryCode="OM" value="968">Oman (+968)</option> <option data-countryCode="PW" value="680">Palau (+680)</option> <option data-countryCode="PA" value="507">Panama (+507)</option> <option data-countryCode="PG" value="675">Papua New Guinea (+675)</option> <option data-countryCode="PY" value="595">Paraguay (+595)</option> <option data-countryCode="PE" value="51">Peru (+51)</option> <option data-countryCode="PH" value="63">Philippines (+63)</option> <option data-countryCode="PL" value="48">Poland (+48)</option> <option data-countryCode="PT" value="351">Portugal (+351)</option> <option data-countryCode="PR" value="1787">Puerto Rico (+1787)</option> <option data-countryCode="QA" value="974">Qatar (+974)</option> <option data-countryCode="RE" value="262">Reunion (+262)</option> <option data-countryCode="RO" value="40">Romania (+40)</option> <option data-countryCode="RU" value="7">Russia (+7)</option> <option data-countryCode="RW" value="250">Rwanda (+250)</option> <option data-countryCode="SM" value="378">San Marino (+378)</option> <option data-countryCode="ST" value="239">Sao Tome & Principe (+239) </option> <option data-countryCode="SA" value="966">Saudi Arabia (+966)</option> <option data-countryCode="SN" value="221">Senegal (+221)</option> <option data-countryCode="CS" value="381">Serbia (+381)</option> <option data-countryCode="SC" value="248">Seychelles (+248)</option> <option data-countryCode="SL" value="232">Sierra Leone (+232)</option> <option data-countryCode="SG" value="65">Singapore (+65)</option> <option data-countryCode="SK" value="421">Slovak Republic (+421)</option> <option data-countryCode="SI" value="386">Slovenia (+386)</option> <option data-countryCode="SB" value="677">Solomon Islands (+677)</option> <option data-countryCode="SO" value="252">Somalia (+252)</option> <option data-countryCode="ZA" value="27">South Africa (+27)</option> <option data-countryCode="ES" value="34">Spain (+34)</option> <option data-countryCode="LK" value="94">Sri Lanka (+94)</option> <option data-countryCode="SH" value="290">St. Helena (+290)</option> <option data-countryCode="KN" value="1869">St. Kitts (+1869)</option> <option data-countryCode="SC" value="1758">St. Lucia (+1758)</option> <option data-countryCode="SD" value="249">Sudan (+249)</option> <option data-countryCode="SR" value="597">Suriname (+597)</option> <option data-countryCode="SZ" value="268">Swaziland (+268)</option> <option data-countryCode="SE" value="46">Sweden (+46)</option> <option data-countryCode="CH" value="41">Switzerland (+41)</option> <option data-countryCode="SI" value="963">Syria (+963)</option> <option data-countryCode="TW" value="886">Taiwan (+886)</option> <option data-countryCode="TJ" value="7">Tajikstan (+7)</option> <option data-countryCode="TH" value="66">Thailand (+66)</option> <option data-countryCode="TG" value="228">Togo (+228)</option> <option data-countryCode="TO" value="676">Tonga (+676)</option> <option data-countryCode="TT" value="1868">Trinidad & Tobago (+1868) </option> <option data-countryCode="TN" value="216">Tunisia (+216)</option> <option data-countryCode="TR" value="90">Turkey (+90)</option> <option data-countryCode="TM" value="7">Turkmenistan (+7)</option> <option data-countryCode="TM" value="993">Turkmenistan (+993)</option> <option data-countryCode="TC" value="1649">Turks & Caicos Islands (+1649) </option> <option data-countryCode="TV" value="688">Tuvalu (+688)</option> <option data-countryCode="UG" value="256">Uganda (+256)</option> <!-- <option data-countryCode="GB" value="44">UK (+44)</option> --> <option data-countryCode="UA" value="380">Ukraine (+380)</option> <option data-countryCode="AE" value="971">United Arab Emirates (+971)</option> <option data-countryCode="UY" value="598">Uruguay (+598)</option> <!-- <option data-countryCode="US" value="1">USA (+1)</option> --> <option data-countryCode="UZ" value="7">Uzbekistan (+7)</option> <option data-countryCode="VU" value="678">Vanuatu (+678)</option> <option data-countryCode="VA" value="379">Vatican City (+379)</option> <option data-countryCode="VE" value="58">Venezuela (+58)</option> <option data-countryCode="VN" value="84">Vietnam (+84)</option> <option data-countryCode="VG" value="84">Virgin Islands - British (+1284) </option> <option data-countryCode="VI" value="84">Virgin Islands - US (+1340)</option> <option data-countryCode="WF" value="681">Wallis & Futuna (+681)</option> <option data-countryCode="YE" value="969">Yemen (North)(+969)</option> <option data-countryCode="YE" value="967">Yemen (South)(+967)</option> <option data-countryCode="ZM" value="260">Zambia (+260)</option> <option data-countryCode="ZW" value="263">Zimbabwe (+263)</option> </optgroup> </select> <div class="floating-label" style="width:100%;"> <input class="floating-input" type="number" placeholder="" name="mobile" id="mobile" required> <span class="highlight"></span> <label>Phone</label> </div> </div> <?php $conference_event = ("SELECT * FROM `conference_event` WHERE `event_id` = '$event_id' "); $result = $conn->query($conference_event); if ($result->num_rows > 0) { ?> <h5 class="font-weight-bold mt-4" style="color:#263238;">Conference Events</h5> <div style="margin-top: 10px; margin-bottom: 20px;"> I would like to participate in the networking dinner on <?php echo $date = date('jS F', strtotime($data['event_date'])); ?> <br> <?php while ($row = $result->fetch_assoc()) { ?> <input class="checkbox-input" type="checkbox" value="<?php echo $row['title']; ?>" name="food_items[]" id="food_items"> <?php echo $row['title']; ?><br> <?php } ?> </div> <?php } ?> <div class="floating-label"> <input class="floating-input" rows="4" cols="50" type="text" placeholder="" name="comments" id="comments" style="padding:10px;height:100px"> <span class="highlight"></span> <label> Comment or Message</label> </div> <?php if($event_id != 42){ ?> <div class="floating-label"> <input class="floating-input" type="text" placeholder="" name="coupon_code" id="couponCode"> <span class="highlight"></span> <label> Coupon Code</label> </div> <button type="button" id="applyCoupon" class="buttons btnPay"> Apply </button> <h5 class="font-weight-bold" style="color:#263238">*Single Item</h5> <p style="font-weight: bold; font-size:20px" id="paymentTotal">Price: <?php echo $data['price'] ?> € </p> <p style="padding-bottom: 10px; padding-top: 10px;"></p> <?php }else { ?> <div class="floating-label d-none"> <input class="floating-input" type="text" placeholder="" name="coupon_code" id="couponCode"> <span class="highlight"></span> <label> Coupon Code</label> </div> <button type="button" id="applyCoupon" class="buttons btnPay d-none"> Apply </button> <h5 class="font-weight-bold" style="color:#263238">*Single Item</h5> <p class="d-none" style="font-weight: bold; font-size:20px" id="paymentTotal">Price: <?php echo $data['price'] ?> € </p> <p class="d-none" style="padding-bottom: 10px; padding-top: 10px;"></p> <?php } ?> <?php if($data['price']!= 0) { ?> <div id="paymentElement"> <!-- A Stripe Element will be inserted here. --> </div> <?php } ?> <h5 class="font-weight-bold" style="color:#263238">*GDPR Agreement</h5> <input class="checkbox-input" type="checkbox" id="gdpr" name="gdpr" value="1" required> I consent to having this website store my submitted information so they can respond to my inquiry.<br> <div class="view-button mt-4 mb-4"> <input type="hidden" name="event_price_original" value="<?php echo $data['price'] ?>" id="eventPriceOriginal"> <input type="hidden" name="event_price" value="<?php echo $data['price'] ?>" id="eventPrice"> <input type="hidden" name="event_name" value="<?php echo $data['title'] ?>" id="event_title"> <input type="hidden" name="event_id" value="<?php echo $event_id; ?>"> <input type="hidden" name="stripe-token" id="stripe-token"> <input type="hidden" name="payment_intent_id" id="payment_intent_id"> <button type="submit" class="buttons btnPay px-4" id="pay_button" onclick="return validate_form();">Submit</button> </div> </div> </form> <div id="payment-error" role="alert"></div> </div> <?php } } ?> <?php $members = ("SELECT * FROM `members` WHERE `event_id` = '$event_id' "); $result = $conn->query($members); if ($result->num_rows > 0) { ?> <div class="col-12 col-lg-6 mb-5 " margin-left:20px"> <h2 class="font-weight-bold mt-0" style="display:none;"><?php echo $partner_type; ?> </h2> <?php $members_type_query = "SELECT * FROM `member_types`"; $result = $conn->query($members_type_query); if ($result->num_rows > 0) { while ($member_type = $result->fetch_assoc()) { $members_query = "SELECT * FROM `members` WHERE `event_id` = '" . $event_id . "' AND `member_type` = '" . $member_type['id'] . "'"; $members_result = $conn->query($members_query); // Check if there are any sponsors for the current member type if ($members_result->num_rows > 0) { ?> <div> <h2 class="font-weight-bold mt-0"><?php echo $member_type['member_type']; ?> </h2> <div class="gold_members"> <?php while ($members_list = $members_result->fetch_assoc()) { ?> <?php if($members_list['member_url']!='') { ?> <a href="<?php echo $members_list['member_url']; ?>" target="_blank"> <div class="images border member_margin"> <img src="../admin/assets/members/<?php echo $members_list['member_logo']; ?>" class="gold_img_1" /> </div> </a> <?php } else { ?> <a href="javascript:void(0)"> <div class="images border member_margin"> <img src="../admin/assets/members/<?php echo $members_list['member_logo']; ?>" class="gold_img_1" /> </div> </a> <?php } ?> <?php } ?> </div> </div> <?php } } } else { echo "<p>No member types found for this event.</p>"; } ?> </div> <?php } ?> </div> </div> <?php } else { ?> <!-- #region --> <p><a href="<?php echo $data['third_party_url']; ?>" target="_blank" style="color:#00bfc7; font-weight:600; font-size:24px"> Register Here </a></p> <?php } ?> <script src="https://cdn.ckeditor.com/4.15.1/full-all/ckeditor.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://js.stripe.com/v3/"></script> </body> <script> var disableValidation = true; // Set this based on your logic $(document).ready(function () { $('meta[property="og:title"]').attr('content', 'New Title'); $('#applyCoupon').click(function () { var couponCode = $('#couponCode').val(); let eventPrice = $('#eventPriceOriginal').val(); // console.log(eventPrice); if (couponCode == '') { alert('Coupon code is required'); $('#applyCoupon').text('Apply'); document.getElementById('paymentTotal').innerText = `Price: ${eventPrice} €`; document.getElementById('couponCode').focus(); return false; } applyCoupon(couponCode, eventPrice); }); }); function applyCoupon(couponCode, eventPrice) { //alert(eventPrice); $.ajax({ url: 'validate_coupon.php', method: 'POST', data: { couponCode: couponCode, eventPrice: eventPrice }, success: function (response) { // alert(response); if (response != '1') { console.log('not null response') var discount = response; updatePaymentTotal(discount, eventPrice); } else { alert('Invalid coupon code'); document.getElementById('paymentTotal').innerText = `Price: ${eventPrice} €`; $('#applyCoupon').text('Apply'); $('#couponCode').val(''); document.getElementById('couponCode').focus(); return false; } }, error: function (err) { console.log(err) //alert('Error applying coupon'); } }); } function updatePaymentTotal(discount, eventPrice) { let currentTotal = eventPrice; let newTotal = currentTotal - discount; updatePaymentIntent(newTotal); $('#eventPrice').val(newTotal); // Update the payment total on the UI let amount = `Price: ${newTotal} €`; // console.log(amount) $('#paymentTotal').text(amount); $('#applyCoupon').text('Applied'); $('#applyCoupon').attr('disabled', true); $('#applyCoupon').css('cursor', 'not-allowed'); $('#couponCode').attr('readonly', true); $('#couponCode').css('cursor', 'not-allowed'); if (newTotal <= 0) { $('#paymentElement').hide() disableValidation = false; // console.log(newTotal, 'newTotal 1') } } //$('#couponCode').on('change', function() { $('#couponCode').on('keyup', function () { // Handle text change event if ($('#couponCode').val() == '') { let eventPrice = $('#eventPriceOriginal').val(); document.getElementById('paymentTotal').innerText = `Price: ${eventPrice} €`; $('#applyCoupon').text('Apply'); $('#applyCoupon').attr('disabled', false); $('#paymentElement').show(); $('#applyCoupon').css('cursor', 'default'); } }); function validate_form() { let first_name = $("#first_name").val(); let last_name = $("#last_name").val(); let company_name = $("#company_name").val(); let city = $("#city").val(); let country = $("#country").val(); let vat_number = $("#vat_number").val(); let email = $("#email").val(); let position = $("#position").val() let comments = $('#comments').val(); let gdpr = document.getElementById('gdpr'); if (first_name == '') { toastr.error("Please Enter first name"); document.getElementById('first_name').focus(); return false; } if (last_name == '') { toastr.error('Please Enter last name'); document.getElementById('last_name').focus(); return false; } if (company_name == '') { toastr.error("Please Enter company name"); document.getElementById('company_name').focus(); return false; } if (country == '') { toastr.error("Please Enter country name"); document.getElementById('country').focus(); return false; } if (email == '') { toastr.error("Please Enter Email"); document.getElementById('email').focus(); return false; } if (!$("input[name='gdpr']").is(":checked")) { // If not checked, prevent the form submission alert("Please accept GDPR Agreement to proceed further."); // toastr.error("Please accept GDPR Agreement to proceed further."); return false; } } // const stripe = Stripe('pk_test_51MPJHjCcV0OqVylsReGPit4PuGhC96vS28lJwlWACaIXCjoJD8DI6zesfU4AD3BjvdQgv2EBWC43usIuI5oNfIPE00C52LKnOK'); const stripe = Stripe('pk_live_51HqxNhLB5kw3RTIU9z3VDeX67Umj8GiTZT36ZW7MZsxVhPDHYDCZoE59IG0RgycmIhY4VyRCYmJZMYj6Ax2aNpXf004vC00u5A'); let elements = stripe.elements(); const event_price_var = $('#eventPrice').val() const event_name = $('#event_title').val() const paymentFrm = document.querySelector("#payment-form"); // Select payment form element const clientSecretParam = new URLSearchParams(window.location.search).get( "payment_intent_client_secret" ); if (!clientSecretParam) { // Create an instance of the Elements UI library and attach the client secret initialize(); } // checkStatus(); // Attach an event handler to payment form paymentFrm.addEventListener("submit", handleSubmit); let payment_intent_id; async function initialize() { const { id, clientSecret } = await fetch("process_payment.php", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ request_type: 'create_payment_intent', event_price: event_price_var, event_name: event_name }), }).then((r) => r.json()); const appearance = { theme: 'stripe', rules: { '.Label': { fontWeight: 'bold', textTransform: 'uppercase', } } }; elements = stripe.elements({ clientSecret, appearance }); const paymentElement = elements.create("payment", { validate: disableValidation, // Dynamically set validation based on condition }); paymentElement.mount("#paymentElement"); payment_intent_id = id; } async function handleSubmit(e) { e.preventDefault(); makePageTransparent(); let first_name = document.getElementById("first_name").value; let last_name = document.getElementById("last_name").value; let company_name = document.getElementById("company_name").value; let country = document.getElementById("country").value; let vat_number = document.getElementById("vat_number").value; let customer_email = document.getElementById("email").value; let countryCode = document.getElementById("countryCode").value; let mobile = document.getElementById("mobile").value; let eventPrice = document.getElementById("eventPrice").value; let event_title = document.getElementById("event_title").value; let couponCode = document.getElementById("couponCode").value; let comments = document.getElementById("comments").value; let position = document.getElementById("position").value; let city = document.getElementById("city").value; let foodItemsArray = []; $("input[name='food_items[]']:checked").each(function() { foodItemsArray.push($(this).val()); }); let foodItemsString = JSON.stringify(foodItemsArray); console.log(eventPrice, 'eventPrice'); //return false if (eventPrice <= 0) { disableValidation = false $.ajax({ // url: 'newSubmit0.php', url: 'free_register.php', type: 'POST', data: { name: first_name, last_name: last_name, company_name: company_name, country: country, vat_number: vat_number, email: customer_email, countryCode: countryCode, mobile: mobile, eventPrice: eventPrice, event_title: event_title, couponCode: couponCode, comments: comments, position: position, city: city, foodItemsString : foodItemsString }, success: function (response) { if (response === '1') { window.location.href = "receipt.php"; } else { console.error('Invalid response:', response); } }, error: function (xhr, status, error) { // Callback function to handle errors console.error('Error:', status, error); } }); } else { const data = await fetch("process_payment.php", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ request_type: 'create_customer', payment_intent_id: payment_intent_id, name: first_name, last_name: last_name, company_name: company_name, country: country, vat_number: vat_number, email: customer_email, countryCode: countryCode, mobile: mobile, eventPrice: eventPrice, event_title: event_title, couponCode: couponCode, comments: comments, position: position, city: city, // foodItemsString : foodItemsString }), }); const responseData = await data.json(); console.log(responseData.customer_id); if (responseData.customer_id) { const { error } = await stripe.confirmPayment({ elements, confirmParams: { // Make sure to change this to your payment completion page return_url: `https://global-reia.org/events/payment_success.php?customer_id=${responseData.customer_id}`, }, }); if (error && (error.type === "card_error" || error.type === "validation_error")) { alert(error.message); makePageNotTransparent(); location.reload(); // Refresh the page } else { // Redirect to payment_success.php after successful payment window.location.href = `https://global-reia.org/events/payment_success.php?customer_id=${responseData.customer_id}`; } } else { // Handle the case where responseData.customer_id is not available // console.error("Customer ID not available in the response data."); alert(error.message); location.reload(); } } } async function updatePaymentIntent(newPrice) { const response = await fetch("process_payment.php", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ request_type: 'update_payment_intent', payment_intent_id: payment_intent_id, new_price: newPrice }), }); const result = await response.json(); if (result.success) { console.log('Payment Intent updated successfully'); } else { console.error('Failed to update Payment Intent'); } } </script> <script type="text/javascript"> // Default Configuration $(document).ready(function () { toastr.options = { 'closeButton': true, 'debug': false, 'newestOnTop': false, 'progressBar': false, 'positionClass': 'toast-top-right', 'preventDuplicates': false, 'showDuration': '1000', 'hideDuration': '1000', 'timeOut': '5000', 'extendedTimeOut': '1000', 'showEasing': 'swing', 'hideEasing': 'linear', 'showMethod': 'fadeIn', 'hideMethod': 'fadeOut', } }); // Toast Type $('#success').click(function (event) { toastr.success('You clicked Success toast'); }); $('#info').click(function (event) { toastr.info('You clicked Info toast') }); $('#error').click(function (event) { toastr.error('You clicked Error Toast') }); $('#warning').click(function (event) { toastr.warning('You clicked Warning Toast') }); // Toast Image and Progress Bar $('#image').click(function (event) { toastr.options.progressBar = true, toastr.info('<img src="https://image.flaticon.com/icons/svg/34/34579.svg" style="width:150px;">', 'Toast Image') }); // Toast Position $('#position').click(function (event) { var pos = $('input[name=position]:checked', '#positionForm').val(); toastr.options.positionClass = "toast-" + pos; toastr.options.preventDuplicates = false; //toastr.info('This sample position', 'Toast Position') }); </script> <script> function makePageTransparent() { var overlay = document.getElementById('overlay'); overlay.style.display = 'block'; // Display the overlay overlay.onclick = function () { return false; }; document.onclick = function () { return false; }; } function makePageNotTransparent() { var overlay = document.getElementById('overlay'); overlay.style.display = 'none'; // Display the overlay overlay.onclick = function () { return true; }; document.onclick = function () { return true; }; } document.addEventListener("DOMContentLoaded", function() { // Check if the current URL matches the target URL if (window.location.href === 'https://global-reia.org/events/event_details.php?name=2024_REIA_ANNUAL_CONFERENCE_AND_GENERAL_ASSEMBLY_MEETING_&event_id=NDU=') { // Find the anchor tag you want to hide var anchorTag = document.querySelector('a[href="#"][style="color:#00bfc7; font-weight:600; font-size:24px"]'); // Check if the anchor tag exists if (anchorTag) { // Hide the anchor tag by setting its display property to 'none' anchorTag.style.display = 'none'; } } }); </script> </html> <?php get_footer(); //Include header ?>