D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
travexx
/
www
/
Filename :
booking-confirm.php
back
Copy
<?php include("superadmin/cn.php"); if(isset($_POST['submit'])){ $curdate= date('d-m-Y'); $name= addslashes($_POST['name']); $email= addslashes($_POST['email']); $number= addslashes($_POST['number']); $tourtype= addslashes($_POST['tourtype']); $location= addslashes($_POST['location']); $peoples= addslashes($_POST['peoples']); $tripdate= addslashes($_POST['tripdate']); $roomsharing= addslashes($_POST['roomsharing']); $advacneamount= addslashes($_POST['advacneamount']); // File 1 (Payment Slip) $file1_name = $_FILES['file1']['name']; $file1_temp = $_FILES['file1']['tmp_name']; $file1_type = $_FILES['file1']['type']; $file1_size = $_FILES['file1']['size']; // File 2 (Adhar Card) $file2_name = $_FILES['file2']['name']; $file2_temp = $_FILES['file2']['tmp_name']; $file2_type = $_FILES['file2']['type']; $file2_size = $_FILES['file2']['size']; // Check if the files are uploaded without errors if ($file1_size > 0 && $file2_size > 0) { // Check file types $allowedImageTypes = ["image/jpeg", "image/jpg", "image/png", "image/gif","application/pdf"]; $allowedPdfTypes = ["application/pdf","image/jpeg", "image/jpg", "image/png", "image/gif"]; if (in_array($file1_type, $allowedImageTypes) && in_array($file2_type, $allowedPdfTypes)) { // Upload file 1 (Payment Slip) $file1_destination = 'paymentslip/' . $file1_name; move_uploaded_file($file1_temp, $file1_destination); // Upload file 2 (Adhar Card) $file2_destination = 'adharcard/' . $file2_name; move_uploaded_file($file2_temp, $file2_destination); // Insert file information into the database $sql = "INSERT INTO `booking`(`name`, `email`, `number`, `tourtype`, `location`, `peoples`, `tripdate`, `roomsharing`, `advacneamount`, `paymentslip`, `adharcard`, `date`) VALUES ('$name','$email','$number','$tourtype','$location','$peoples','$tripdate','$roomsharing','$advacneamount','$file1_name','$file2_name','$curdate')"; $result = mysqli_query($con, $sql); if ($result) { echo "<script type='text/javascript'> location.href='thank-you.php'; </script>"; } else { echo "Error: " . mysqli_error($con); } } else { echo '<script> document.addEventListener("DOMContentLoaded", function () { const Toast = Swal.mixin({ toast: true, position: "top-end", showConfirmButton: false, timer: 2000, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener("mouseenter", Swal.stopTimer); toast.addEventListener("mouseleave", Swal.resumeTimer); }, }); Toast.fire({ icon: "error", title: "Invalid file type. Please upload an image (JPEG, JPG, PNG, GIF) for Payment Slip and a PDF for Adhar Card.", }); }); </script>'; } } else { echo '<script> document.addEventListener("DOMContentLoaded", function () { const Toast = Swal.mixin({ toast: true, position: "top-end", showConfirmButton: false, timer: 2000, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener("mouseenter", Swal.stopTimer); toast.addEventListener("mouseleave", Swal.resumeTimer); }, }); Toast.fire({ icon: "error", title: "Error Uploading Files", }); }); </script>'; } } ?> <!DOCTYPE html> <html lang="zxx"> <head> <!--====== Required meta tags ======--> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="description" content="Adventure, Tours, Travel"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!--====== Title ======--> <title>Booking Confirmation Form</title> <!--====== Favicon Icon ======--> <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/png"> <!--====== Google Fonts ======--> <link href="../../css2?family=Prompt:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> <!--====== Flaticon css ======--> <link rel="stylesheet" href="assets/fonts/flaticon/flaticon_gowilds.css"> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <!--====== FontAwesome css ======--> <link rel="stylesheet" href="assets/fonts/fontawesome/css/all.min.css"> <!--====== Bootstrap css ======--> <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.min.css"> <!--====== magnific-popup css ======--> <link rel="stylesheet" href="assets/vendor/magnific-popup/dist/magnific-popup.css"> <!--====== Slick-popup css ======--> <link rel="stylesheet" href="assets/vendor/slick/slick.css"> <!--====== Jquery UI css ======--> <link rel="stylesheet" href="assets/vendor/jquery-ui/jquery-ui.min.css"> <!--====== Nice Select css ======--> <link rel="stylesheet" href="assets/vendor/nice-select/css/nice-select.css"> <!--====== Animate css ======--> <link rel="stylesheet" href="assets/vendor/animate.css"> <!--====== Default css ======--> <link rel="stylesheet" href="assets/css/default.css"> <!--====== Style css ======--> <link rel="stylesheet" href="assets/css/style.css"> </head> <body> <!--====== Start Preloader ======--> <div class="preloader"> <div class="loader"> <div class="pre-shadow"></div> <div class="pre-box"></div> </div> </div><!--====== End Preloader ======--> <!--====== Search From ======--> <div class="modal fade search-modal" id="search-modal"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <form > <div class="form_group"> <input type="search" class="form_control" placeholder="Search here" name="search"> <label><i class="fa fa-search"></i></label> </div> </form> </div> </div> </div><!--====== Search From ======--> <!--====== Header Area ======--> <?php include("header.php"); ?> <!--====== End Area ======--> <style> .ss { width:200px; height:55px; } @media only screen and (max-width: 600px) { .ss { width:200px; height:55px; } } </style> <!--====== Start Hero Section ======--> <section class="page-banner overlay pt-100 pb-100 bg_cover" style="background-image: url(assets/images/bg/page-bg.jpg);"> <div class="container"> <div class="row justify-content-center"> <div class="col-lg-10"> <div class="page-banner-content text-center text-white pt-30"> <h1 class="page-title">Booking Confirmation Form</h1> <ul class="breadcrumb-link text-white"> <li><a href="index.php">Home</a></li> <li class="active">Booking Confirmation Form</li> </ul> </div> </div> </div> </div> </section><!--====== End Hero Section ======--> <!--====== Start About Section ======--> <!--====== Start Booking Section ======--> <section class="booking-section pt-60 pb-50"> <div class="container"> <div class="row align-items-xl-center"> <div class="col-lg-12"> <!--=== Booking Content Box ===--> <div class="booking-content-box mb-50 wow fadeInLeft"> <div class="section-title mb-50"> <center><h3>Ready to Go on an Unforgettable Journey?</h3> <h2>Booking Confirmation with Travexx</h2></center> </div> <form class="booking-form" action="" method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-user-alt"></i></label> <input type="text" class="form_control" placeholder="Full Name" name="name" required pattern="[A-Za-z\s]+" title="Please enter only letters and spaces"> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-phone-alt"></i></label> <input type="text" class="form_control" placeholder="Phone Number" name="number" required pattern="[0-9]+" title="Please enter only numbers" maxlength="10"> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-envelope"></i></label> <input type="email" class="form_control" placeholder="Email" name="email" required> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-users-alt"></i></label> <select name="tourtype" class="form_control" required> <option>Tour Type</option> <option value="Private / Customized itinerary">Private / Customized itinerary</option> <option value="Group Trip ">Group Trip </option> </select> </div> </div> <style> .nice-select.open .list{ width:100%; } </style> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-calendar-alt"></i></label> <select name="location" class="form_control" required="" style="display: none;"> <option>Select Location</option> <option value="Manali - Kasol">Manali - Kasol</option> <option value="Triund">Triund</option> <option value="Serene Chopta">Serene Chopta</option> <option value="Jibhi - Jalori">Jibhi - Jalori</option> <option value="Kheerganga Trek">Kheerganga Trek</option> <option value="Spiti Valley">Spiti Valley</option> <option value="Manali-Jispa">Manali-Jispa</option> <option value="Bali">Bali</option> <option value="Hampta Pass">Hampta Pass</option> <option value="Valley of Flowers">Valley of Flowers</option> <option value="Pin Parvati">Pin Parvati</option> <option value="Kasol Grahan">Kasol Grahan</option> <option value="Sar Pass">Sar Pass</option> <option value="Bhrigu Lake">Bhrigu Lake</option> <option value="Ladhak">Ladhak</option> <option value="Meghalaya">Meghalaya</option> <option value="Bhutan">Bhutan</option> <option value="Vietnam">Vietnam</option> <option value="Dubai">Dubai</option> <option value="Thailand">Thailand</option> </select> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-users"></i></label> <input type="text" class="form_control" placeholder="Number of Peoples" name="peoples" required pattern="[0-9]+" title="Please enter only numbers"> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-calendar-alt"></i></label> <input type="text" class="form_control datepicker" placeholder="Trip Date" name="tripdate" required> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-calendar-alt"></i></label> <select name="roomsharing" class="form_control" required> <option>Room Sharing</option> <option value="Single Sharing">Single Sharing</option> <option value="Double Sharing">Double Sharing</option> <option value="Triple Sharing">Triple Sharing</option> <option value="Quad Sahring">Quad Sahring</option> </select> </div> </div> <div class="col-md-4"> <div class="form_group"> <label><i class="far fa-rupee"></i></label> <input type="text" class="form_control" placeholder="Advance Amount Paid" name="advacneamount" required pattern="[0-9]+" title="Please enter only numbers"> </div> </div> <div class="col-md-4"> <div class="form_group"> <label class="tt"> <!--<i class="far fa-phone-alt"></i>--> Upload payment slip</label> <input type="file" class="form_control" name="file1" id="file1" required> </div> </div> <style> .tt{ position: absolute; top: 18px; right: 23px; } @media only screen and (max-width: 600px) { .tt{ position: absolute; top: 2px !important; right: 9px !important; } } </style> <div class="col-md-4"> <div class="form_group"> <label class="tt"> <!--<i class="fa fa-id-card-o"></i> --> Upload Adhar card</label> <input type="file" class="form_control" name="file2" id="file2" required> </div> </div> <div class="col-md-12"> <div class="form_group"> <center><button class="main-btn primary-btn" type="submit" name="submit">Submit<i class="fas fa-paper-plane"></i></button></center> </div> </div> </div> </form> </div> </div> </div> </div> </section><!--====== End Hero Section ======--> <!--====== Start CTA Section ======--> <!--====== Start Testimonial Section ======--> <!--====== Start Blog Section ======--> <!--====== End Blog Section ======--> <!--====== Start Gallery Section ======--> <section class="gallery-section mbm-150"> <div class="container-fluid"> <div class="slider-active-5-item wow fadeInUp"> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/1.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/1.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/2.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/2.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/3.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/3.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/4.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/4.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/5.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/5.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> <!--=== Single Gallery Item ===--> <div class="single-gallery-item"> <div class="gallery-img"> <img src="assets/images/gallery/6.jpg" alt="Gallery Image"> <div class="hover-overlay"> <a href="assets/images/gallery/6.jpg" class="icon-btn img-popup"><i class="far fa-plus"></i></a> </div> </div> </div> </div> </div> </section><!--====== End Gallery Section ======--> <!--====== Start Footer ======--> <?php include("footer.php"); ?> <!--====== End Footer ======--> <!--====== Back To Top ======--> <a href="#" class="back-to-top"><i class="far fa-angle-up"></i></a> <!--====== Jquery js ======--> <script data-cfasync="false" src="../../cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script src="assets/vendor/jquery-3.6.0.min.js"></script> <!--====== Bootstrap js ======--> <script src="assets/vendor/popper/popper.min.js"></script> <!--====== Bootstrap js ======--> <script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!--====== Slick js ======--> <script src="assets/vendor/slick/slick.min.js"></script> <!--====== Magnific js ======--> <script src="assets/vendor/magnific-popup/dist/jquery.magnific-popup.min.js"></script> <!--====== Counterup js ======--> <script src="assets/vendor/jquery.counterup.min.js"></script> <!--====== Waypoints js ======--> <script src="assets/vendor/jquery.waypoints.js"></script> <!--====== Nice-select js ======--> <script src="assets/vendor/nice-select/js/jquery.nice-select.min.js"></script> <!--====== jquery UI js ======--> <script src="assets/vendor/jquery-ui/jquery-ui.min.js"></script> <!--====== WOW js ======--> <script src="assets/vendor/wow.min.js"></script> <!--====== Main js ======--> <script src="assets/js/theme.js"></script> </body> </html>