%PDF- %PDF-
Direktori : /var/www/html/buggydubrovnik.com/premium-booking/ |
Current File : /var/www/html/buggydubrovnik.com/premium-booking/form.php |
<?php $servername = "localhost"; $username="buggydubrovnik_app_production"; $password="appr-17"; $db="buggydubrovnik_app_production"; //$username="root"; //$password=""; // Create connection $conn = mysqli_connect($servername, $username, $password, $db); mysqli_query($conn,"set names 'utf8'"); $cijena=1800; $cijenapopust= $cijena*1; function formatMoney($number, $cents = 1) { // cents: 0=never, 1=if needed, 2=always if (is_numeric($number)) { // a number if (!$number) { // zero $money = ($cents == 2 ? '0.00' : '0'); // output zero } else { // value if (floor($number) == $number) { // whole number $money = number_format($number, ($cents == 2 ? 2 : 0)); // format } else { // cents $money = number_format(round($number, 2), ($cents == 0 ? 0 : 2)); // format } // integer or decimal } // value $money = str_replace(",","[]", $money); $money = str_replace(".",",", $money); $money = str_replace("[]",".", $money); return $money; } // numeric } // formatMoney ?> <style> #seatsInfo { margin: 5px; } #datum { max-width: 250px; } .drzave{width: 400px;} iframe{border: 1px solid #d2d2d2;width:100%; height:200px; overflow:scroll;} .section.group { width: 90%; margin: 0 auto; max-width: 500px; } input, select, option, textarea { color:#747474; padding: 0.2em; } .section.group input { max-width: 400px; } textarea { width: 400px; height: 150px; } .crveno{ color:red; } p.crveno{ margin:0; } @media only screen and (max-width: 800px){ iframe{-webkit-overflow-scrolling:touch} .section.group {width: 100%} textarea {width: 100%;} .drzave{width: 100%;} } </style> <link href="/buggy-booking/pikaday.css" rel="stylesheet" type="text/css" /> <script src="/core/js/jquery-3.1.1.js"></script> <script src="/buggy-booking/gen_validatorv4.js" type="text/javascript"></script> <script src="/buggy-booking/moment.js"></script> <script src="/buggy-booking/pikaday.js"></script> <script src="/buggy-booking/pikaday.jquery.js"></script> <script type="text/javascript"> var month=<?=date("m")?>, day=<?=date("d")?>; var selectedMonth, $vrijeme, $checkmark, $promoID, $seatsInfo, $separate; Number.prototype.padLeft = function (len,chr) { var self = Math.abs(this)+''; return (this<0 && '-' || '')+ (String(Math.pow( 10, (len || 2)-self.length)) .slice(1).replace(/0/g,chr||'0') + self); } jQuery(document).ready(function ($) { $separate=$("#separate"); $vrijeme=$("#vrijeme"); console.log($vrijeme[0]); $checkmark=$("#checkmark"); $seatsInfo=$("#seatsInfo"); var max=new Date(<?=date("Y")+1?>, 9, 31); var currentPromoRequest; $("input[name=promo]").on("keyup", function () { if(currentPromoRequest!=null) currentPromoRequest.abort(); else $checkmark.fadeIn(); $checkmark.attr("src", "/buggy-booking/loading.gif"); currentPromoRequest=$.ajax("/buggy-booking/checkPromo.php?promo="+$(this).val()).done(function (data) { var json=JSON.parse(data); if(json.check) { $checkmark.attr("src", "/buggy-booking/checked.png"); alert("The code was valid. You'll be getting an additional "+json.amount+"% discount in the next step.") } else { $checkmark.attr("src", "/buggy-booking/error.png") } }) }) $('#datum').pikaday({ firstDay: 1, format:"DD.MM.YYYY", minDate: new Date(), maxDate:max, disableDayFn: function(theDate) { return true var res=(theDate>new Date(<?=date("Y")?>, 10, 17) && theDate<new Date(<?=date("Y")+1?>, 2, 1) ); console.log("res!?", res) return res; }, onSelect: function () { console.log("select?") $vrijeme.fadeOut(); var datum=$(this)[0].getDate(); var YMD=datum.getFullYear()+"-"+(datum.getMonth()+1).padLeft(2)+"-"+datum.getDate().padLeft(2); $.ajax("/premium-booking/getTimes.php?date="+YMD).done(function (data) { $vrijeme.html(data).fadeIn().trigger("change"); //alert(data); $("input[name=date]").val(YMD) }) // $(this)[0].getDate() } }); $vrijeme.on("change", function () { var vehicles=parseInt($(this).find("option:selected").attr("data-free")); if(vehicles<0) vehicles=0; $seatsInfo.html("There are a total of "+(vehicles*3)+" seats ("+vehicles+" vehicles) available for this date and time."); }) }) </script> <div class="section group"> <div id="naslov1"> <h1 style="margin-bottom:25px; text-transform:uppercase">PREMIUM TOUR BOOKING | Buggy Safari Dubrovnik</h1> </div> </div> <div class="section group" style="margin-bottom:25px; margin-top:5px; background-color:#003; height:2px;"></div> <form style="font-weight:normal; text-align:left" id="reservationForm" name="rezizlet" method="post" action="/premium-tour-booking-preview/" > <div class="section group" style="margin-bottom:25px;"> <!--<form style="font-weight:normal; text-align:left" id="reservationForm" name="rezizlet" method="post" action="/premium-booking/preview.php" > <div class="section group" style="margin-bottom:25px;">--> </div> <div class="section group" style="margin-bottom:25px;"> <div class="col span_1_of_4"> <B>PRICE PER VEHICLE:</B></div><div class="col span_3_of_4"><?php// echo formatMoney($cijena,2).' -10% = '; ?> <b style="color:#F72A5D; font-size:1.2em;"> <?php echo formatMoney($cijenapopust,2).' HRK </b>'; ?> </div> <p>*Up to three persons per vehicle.</p> <p class="crveno">*This is not a self driving tour.</p> </div> <div class="section group" style="margin-bottom:5px; margin-top:15px; background-color:#003; height:2px;"></div> <div class="section group" style="margin-bottom:0px;"> <strong>PERSONAL DATA</strong> </div> <div class="section group" style="margin-bottom:10px; margin-top:5px; background-color:#003; height:2px;"></div> <div class="section group" style="margin-bottom:5px;"> <div class="col span_1_of_4"> Title: </div> <div class="col span_3_of_4"> <select id="title" name="title"> <option value="Mr">Mr</option> <option value="Ms">Ms</option> <option value="Mrs">Mrs</option> <option value="Miss">Miss</option> </select> </div></div> <div class="section group" style="margin-bottom:5px;"> <div class="col span_1_of_4"> First name: </div> <div class="col span_3_of_4"> <input name="CustomerFirstname" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> Last name: </div><div class="col span_3_of_4"><input name="CustomerSurname" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> Address: </div><div class="col span_3_of_4"><input name="CustomerAddress" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> City: </div><div class="col span_3_of_4"> <input name="CustomerCity" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> ZIP Code:</div><div class="col span_3_of_4"> <input name="CustomerZIP" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Country: </div><div class="col span_3_of_4"><select class="drzave" name="CustomerCountry" > <option selected value="">Please choose your country</option> <?php $countries=$conn->query("SELECT * FROM drzava WHERE aktivan=1 ORDER BY naziv ASC"); while($c=$countries->fetch_assoc()) { ?> <option value="<?=$c["id_drzava"]?>"> <?=$c["naziv"]?> </option> <?php } ?> </select></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Country calling code: </div><div class="col span_3_of_4"><input name="CustomerCode" type="text" style="width:75px;" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Telephone: </div><div class="col span_3_of_4"><input name="CustomerPhone" type="text" /></div></div> <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4"> E-mail: </div><div class="col span_3_of_4"><input name="CustomerEmail" type="text" /></div></div> <div class="section group" style="margin-bottom:5px; margin-top:15px; background-color:#003; height:2px;"></div> <div class="section group" style="margin-bottom:0px;"> <strong>EXCURSION DATA</strong> </div> <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4"> Date and time: </div> <div class="col span_3_of_4"> <input class="date-input" autocomplete="off" type="text" id="datum" /> <select name="vrijeme" id="vrijeme" style="display: none"> </select></div> <p id="seatsInfo"> Please choose a date and time to see the number of available places. <br> </p> <p> For group bookings of 10 persons or more please <a style="text-decoration: underline" href="http://www.buggydubrovnik.com/contact-us/">contact us directly.</a> </p> </div> <div class="section group" style="margin-bottom:10px; margin-top:5px; background-color:#003; height:2px;"></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Persons: </div><div class="col span_3_of_4"> <input id="persons" name="odrasli" type="number" value="2" min="0" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Vehicles (filled automatically) </div><div class="col span_3_of_4"> <input id="vehicles" value="1" name="vehicles" type="number" readonly /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Pickup location (Dubrovnik area): </div><div class="col span_3_of_4"> <input id="pickup" name="mjesto_kupljenja" type="text" /></div></div> <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> Promo code (additional discount): </div><div class="col span_3_of_4"> <input name="promo" type="text" /> <img id="checkmark" src="/buggy-booking/loading.gif" style="width: 1em; vertical-align: middle; margin-left: 5px; display: none" /> </div></div> <input name="promo_id" type="hidden" value="0" /> <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4">Comment:</div><div class="col span_3_of_4"> <textarea name="komentar" ></textarea> </div></div> <input type="hidden" name="date" /> <div class="section group" style="margin-bottom:25px;" ><div class="col span_1_of_4"></div><div class="col span_3_of_4"> <br /> <iframe id="iframeterms" src="http://buggydubrovnik.com/buggy-booking/terms.html"></iframe><br /><br /><input value="1" id="checkb" type="checkbox" style="width:1.5em; height:1.5em;" name="terms" /> I agree to let Buggy d.o.o process my personal data in order to manage my personal account, in accordance with Buggy d.o.o <a style="color:black; font-size:1.1em" href="javascript:void(0);" NAME="Terms and conditions" title="Terms and conditions " onClick=window.open("http://buggydubrovnik.com/buggy-booking/terms.html","Ratting","width=550,height=500,0,status=0,scrollbars=1");><u>Privacy Notice and Terms and Conditions</u> </a><br /><br /> This is booking form only! If you want to book and pay online click NEXT.<br /> If you want to contact us please do it through our contact form - <a style="color:red; font-size:16px;" href="../contact/">HERE</a> </div> </div> <div class="section group" style="margin-bottom:25px;" ><div class="col span_1_of_4"></div><div class="col span_3_of_4"> <input style="cursor:pointer;" type="button" border="0" id="subbtn" class="fusion-button button-3d button-round button-xlarge button-orange button-1" value="NEXT " /></div> </div> </form> <script> var canSubmitNow=true; var vehicles=1; function checkSeats(){ console.log($vrijeme[0]) console.log($vrijeme.val()) if($vrijeme.val()===null) { console.log("nevalja?"); alert("Please chose a tour date and time.") return; } else console.log("nije null idem dalje?") var free=parseInt($vrijeme.find("option:selected").attr("data-free")) if(vehicles>free) { alert('The number of people you have entered exceeds the number of available seats for this tour. Please try another time or date.') } else if(canSubmitNow) { jQuery("#reservationForm").trigger("submit"); } } jQuery(document).ready(function () { jQuery("#subbtn").on("click", checkSeats) jQuery("#persons").on("change", function () { vehicles=Math.ceil(this.value/3) jQuery("#vehicles").val(vehicles) }) }) </script> <script type="text/javascript"> var frmvalidator = new Validator("rezizlet"); frmvalidator.addValidation("CustomerFirstname","req","Please enter your First Name"); frmvalidator.addValidation("mjesto_kupljenja","req","Please enter a pickup location."); frmvalidator.addValidation("CustomerSurname","req","Please enter your Surname"); frmvalidator.addValidation("CustomerAddress","req","Please enter your Address"); frmvalidator.addValidation("CustomerAddress","req","Please enter your Address"); frmvalidator.addValidation("CustomerCity","req","Please enter your City"); frmvalidator.addValidation("CustomerZIP","req","Please enter your ZIP"); frmvalidator.addValidation("CustomerCountry","req","Please enter your Country"); frmvalidator.addValidation("CustomerCode","req","Please enter your country calling code"); frmvalidator.addValidation("CustomerEmail","req","Please enter your Email"); frmvalidator.addValidation("CustomerEmail","email"); frmvalidator.addValidation("odrasli","req","Please enter number of adults"); frmvalidator.addValidation("odrasli","numeric","Adults must be numeric value"); frmvalidator.addValidation("datum", "req", "Please choose a date"); frmvalidator.addValidation("vrijeme", "req", "Please choose a time") // frmvalidator.addValidation("lokacija","dontselect=0_--Choose location--","Please select pick-up location"); frmvalidator.addValidation("terms","shouldselchk=y","Sorry: you have to agree with terms and conditions!"); </script>