MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.14.132.178
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/fastelevator.in/../bittootour.in/../gujarataxi.com/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/fastelevator.in/../bittootour.in/../gujarataxi.com/book-ride.php
<?php
ob_start();
require_once("includes/dbsmain.inc.php");
$page_name=basename($_SERVER['PHP_SELF'],'.php');
include("site-main-query.php");
$sess_id=session_id();

if ($_SERVER["REQUEST_METHOD"] === "POST") {
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $phone = $_POST['phone'];
        $email = $_POST['email'];
        $pickup=$_POST['pickup'];
        $drop=$_POST['drop'];
        $passenger=$_POST['passenger'];
        $taxi=$_POST['taxi'];
        $pickdate=$_POST['pickdate'];
        $picktime=$_POST['picktime'];
        $message = $_POST['message'];
        $price = $_POST['price'];
        date_default_timezone_set('Asia/Kolkata');
        $currentDate = date('Y-m-d');

        if (empty($name)) {
            $errors[] = "Name field is required.";
        }

        if (empty($email)) {
            $errors[] = "Email field is required.";
        }

        if (empty($phone)) {
            $errors[] = "Phone field is required.";
        } elseif (!preg_match('/^\d{10}$/', $phone)) {
            $errors[] = "Phone number should have exactly 10 digits.";
        }
        if (!empty($message)) {
            $message = htmlspecialchars($message);
        }

        if (empty($errors)) {
            $sql="INSERT INTO `tbl_booking`(`booking_date`, `booking_package_name`, `booking_package_price`, `booking_persons`, `booking_total_price`, `booking_drop_point_name`, `booking_pickup_point_name`, `booking_user_name`, `booking_user_mobile`, `booking_user_email`, `booking_payment_status`, `booking_add_date`, `booking_user_address`) 
                                    VALUES ('$pickdate','$taxi','$price','$passenger','$price','$drop','$pickup','$name','$phone','$email','Pending','$currentDate', '$picktime')";
            // $result = mysqli_query($db, $sql) or die("Query unsuccessful");
            $result=db_query($sql);
            // header("Location:index.php");
            // exit;
            if ($result) {
                // Sending email
                $to = "s.diwakarcab@gmail.com";
                // $to = "digitalsaleem12@gmail.com";
                $subject = "New Query Submitted For Booking";
                $emailMessage = "A new query has been submitted:\n\n";
                $emailMessage .= "Name: $name\n";
                $emailMessage .= "Phone: $phone\n";
                $emailMessage .= "Email: $email\n";
                $emailMessage .= "Package: $taxi\n";
                $emailMessage .= "Booking Date: $currentDate\n";
                $emailMessage .= "Price: $price\n";
                $emailMessage .= "Pickup Date: $pickdate\n";
                $emailMessage .= "Pickup Time: $picktime\n";
                
                
                $headers = "From: $email";
                
                if (mail($to, $subject, $emailMessage, $headers)) {
                echo "<script>
                window.location.href = 'thanks.php';
                </script>";
            } else {
               echo "Error sending email.";
                }
        }
    }
}
}
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gujarat Cabs</title>
    <meta name="description" content="">
    <?php include 'top-link.php';?>
</head>

<body>

    <?php include 'header.php';?>

    <div class="site-breadcrumb" style="background: url(assets/img/breadcrumb/01.jpg)">
        <div class="container">
            <h2 class="breadcrumb-title">Book A Ride</h2>
            <ul class="breadcrumb-menu">
                <li><a href="index.php">Home</a></li>
                <li class="active">Book A Ride</li>
            </ul>
        </div>
    </div>

    <div style="background: #ffb300;" class="book-ride py-120">
        <div class="container">
            <div class="row">
                <div class="col-md-10 mx-auto">
                    <div class="booking-form">
                        <div class="book-ride-head">
                            <h4 style="color: #ffb300;" class="booking-title">Make Your Booking Today</h4>
                            <!--<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has distribution of letters to using content here making it look like readable.</p>-->
                        </div>
                        <form action="<?php $_PHP_SELF?>" method="POST">
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label>Full Name</label>
                                        <input type="text" class="form-control" placeholder="Your Name" name="name" required>
                                        <i class="far fa-user"></i>
                                        <?php if (isset($errors) && in_array("Name field is required.", $errors)) { ?>
                                            <p class="error">Name field is required.</p>
                                        <?php } ?>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label>Phone Number</label>
                                        <input name="phone" type="text" class="form-control" placeholder="Your Phone" minlength="10" maxlength="10" onkeypress="return isNumberKey(event)" pattern=".{10,10}" onpaste="return false;" required>
                                        <i class="far fa-phone"></i>
                                        <?php if (isset($errors) && in_array("Phone field is required.", $errors)) { ?>
                                            <p class="error">Phone field is required.</p>
                                        <?php } elseif (isset($errors) && in_array("Phone number should have exactly 10 digits.", $errors)) { ?>
                                            <p class="error">Phone number should have exactly 10 digits.</p>
                                        <?php } ?>
                                        
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label>Email</label>
                                        <input type="text" class="form-control" placeholder="Your Email" name="email" required>
                                        <i class="far fa-envelope"></i>
                                        <?php if (isset($errors) && in_array("Email field is required.", $errors)) { ?>
                                            <p class="error">Email field is required.</p>
                                        <?php } ?>
                                    </div>
                                </div>
                                <!--<div class="col-lg-6">-->
                                <!--    <div class="form-group">-->
                                <!--        <label>Pick Up Location</label>-->
                                <!--        <input type="text" class="form-control" placeholder="Pickup Location" name="pickup" required>-->
                                <!--    </div>-->
                                <!--</div>-->
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Choose Tour Location</label>
                                        <select class="select" name="drop" id="drop" required onchange="updatePrice()">
                                            <option value="Choose Location">Choose Location</option>
                                            <option value="Ahmedabad to Mumbai">Ahmedabad to Mumbai</option>
                                            <option value="Ahmedabad to Surat">Ahmedabad to Surat</option>
                                            <option value="Ahmedabad to Vapi">Ahmedabad to Vapi</option>
                                            <option value="Ahmedabad to Baroda">Ahmedabad to Baroda</option>
                                            <option value="Ahmedabad to Morbi">Ahmedabad to Morbi</option>
                                            <option value="Ahmedabad to Gandhidham">Ahmedabad to Gandhidham</option>
                                            <option value="Ahmedabad to Bhuj">Ahmedabad to Bhuj</option>
                                            <option value="Ahmedabad to Udaypur">Ahmedabad to Udaypur </option>
                                            <option value="Ahmedabad to Jaipur">Ahmedabad to Jaipur</option>
                                            <option value="Ahmedabad to Bhilwara">Ahmedabad to Bhilwara </option>
                                            <option value="Ahmedabad to Mount Aabu">Ahmedabad to Mount Aabu</option>
                                            <option value="Ahmedabad to Aabu">Ahmedabad to Aabu</option>
                                            <option value="Ahmedabad to Ajmer">Ahmedabad to Ajmer </option>
                                            <option value="Ahmedabad to Delhi">Ahmedabad to Delhi</option>
                                            <option value="Ahmedabad to Rajkot">Ahmedabad to Rajkot</option>
                                            <option value="Ahmedabad to Somnath">Ahmedabad to Somnath</option>
                                            <option value="Ahmedabad to Dwarka">Ahmedabad to Dwarka</option>
                                            <option value="Ahmedabad to Jamnagar">Ahmedabad to Jamnagar</option>
                                            <option value="Ahmedabad to Statue Of Unity">Ahmedabad to Statue Of Unity</option>
                                            <option value="Ahmedabad to Saputara">Ahmedabad to Saputara</option>
                                            <option value="Ahmedabad to Pune">Ahmedabad to Pune</option>
                                            <option value="Ahmedabad to Nashik">Ahmedabad to Nashik</option>
                                            <option value="Ahmedabad to Bhavnagar">Ahmedabad to Bhavnagar</option>
                                            <option value="Ahmedabad to Palitana">Ahmedabad to Palitana</option>
                                            <option value="Ahmedabad to Jodhpur">Ahmedabad to Jodhpur</option>
                                            <option value="Ahmedabad to Kadi Kalol">Ahmedabad to Kadi Kalol</option>
                                            <option value="Ahmedabad to Halol">Ahmedabad to Halol</option>
                                            <option value="Ahmedabad to Junagadh">Ahmedabad to Junagadh</option>
                                            <option value="Ahmedabad to Chittorgarh">Ahmedabad to Chittorgarh</option>
                                            <option value="Jaipur to Udaypur">Jaipur to Udaypur</option>
                                            <!--reverse tours -->
                                            <option value="Mumbai to Ahmedabad">Mumbai to Ahmedabad</option>
                                            <option value="Surat to Ahmedabad">Surat to Ahmedabad</option>
                                            <option value="Vapi to Ahmedabad">Vapi to Ahmedabad</option>
                                            <option value="Baroda to Ahmedabad">Baroda to Ahmedabad</option>
                                            <option value="Morbi to Ahmedabad">Morbi to Ahmedabad</option>
                                            <option value="Gandhidham to Ahmedabad">Gandhidham to Ahmedabad</option>
                                            <option value="Bhuj to Ahmedabad">Bhuj to Ahmedabad</option>
                                            <option value="Udaypur to Ahmedabad">Udaypur to Ahmedabad</option>
                                            <option value="Jaipur to Ahmedabad">Jaipur to Ahmedabad</option>
                                            <option value="Bhilwara to Ahmedabad">Bhilwara to Ahmedabad</option>
                                            <option value="Mount Aabu to Ahmedabad">Mount Aabu to Ahmedabad</option>
                                            <option value="Aabu to Ahmedabad">Aabu to Ahmedabad</option>
                                            <option value="Ajmer to Ahmedabad">Ajmer to Ahmedabad</option>
                                            <option value="Delhi to Ahmedabad">Delhi to Ahmedabad</option>
                                            <option value="Rajkot to Ahmedabad">Rajkot to Ahmedabad</option>
                                            <option value="Somnath to Ahmedabad">Somnath to Ahmedabad</option>
                                            <option value="Dwarka to Ahmedabad">Dwarka to Ahmedabad</option>
                                            <option value="Jamnagar to Ahmedabad">Jamnagar to Ahmedabad</option>
                                            <option value="Statue Of Unity to Ahmedabad">Statue Of Unity to Ahmedabad</option>
                                            <option value="Saputara to Ahmedabad">Saputara to Ahmedabad</option>
                                            <option value="Pune to Ahmedabad">Pune Ahmedabad</option>
                                            <option value="Nashik to Ahmedabad">Nashik to Ahmedabad</option>
                                            <option value="Bhavnagar to Ahmedabad">Bhavnagar to Ahmedabad</option>
                                            <option value="Palitana to Ahmedabad">Palitana to Ahmedabad</option>
                                            <option value="Jodhpur to Ahmedabad">Jodhpur to Ahmedabad</option>
                                            <option value="Kadi Kalol to Ahmedabad">Kadi Kalol to Ahmedabad</option>
                                            <option value="Halol to Ahmedabad">Halol to Ahmedabad</option>
                                            <option value="Junagadh to Ahmedabad">Junagadh to Ahmedabad</option>
                                            <option value="Chittorgarh to Ahmedabad">Chittorgarh to Ahmedabad</option>
                                            <option value="Udaypur to Jaipur">Udaypur to Jaipur</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Cab Type</label>
                                        <select class="select" name="taxi" id="taxi" required onchange="updatePrice()">
                                            <option value="Choose Cab">Choose Cab</option>
                                            <option value="Sedan">Sedan</option>
                                            <option value="SUV">SUV</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Price</label>
                                        <input type="text" class="form-control" placeholder="Price" name="price" id="price" required readonly>
                                        <i class="far fa-rupee"></i>
                                    </div>
                                </div>
                            
                                <script>
                                    const priceMapping = {
                                        "Ahmedabad to Mumbai": {
                                            "Sedan": 6000,
                                            "SUV": 8000
                                        },
                                        "Ahmedabad to Surat": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ahmedabad to Vapi": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                        "Ahmedabad to Baroda": {
                                            "Sedan": 1800,
                                            "SUV": 2300
                                        },
                                        "Ahmedabad to Morbi": {
                                            "Sedan": 2500,
                                            "SUV": 3000
                                        },
                                        "Ahmedabad to Gandhidham": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Ahmedabad to Bhuj": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Ahmedabad to Udaypur": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ahmedabad to Jaipur": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ahmedabad to Bhilwara": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Ahmedabad to Mount Aabu": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Ahmedabad to Aabu": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ahmedabad to Ajmer": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Ahmedabad to Delhi": {
                                            "Sedan": 11000,
                                            "SUV": 13000
                                        },
                                        "Ahmedabad to Rajkot": {
                                            "Sedan": 2500,
                                            "SUV": 3500
                                        },
                                        "Ahmedabad to Somnath": {
                                            "Sedan": 6000,
                                            "SUV": 7500
                                        },
                                        "Ahmedabad to Dwarka": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Ahmedabad to Jamnagar": {
                                            "Sedan": 3500,
                                            "SUV": 4000
                                        },
                                        "Ahmedabad to Statue Of Unity": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Ahmedabad to Saputara": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Ahmedabad to Pune": {
                                            "Sedan": 7000,
                                            "SUV": 8500
                                        },
                                        "Ahmedabad to Nashik": {
                                            "Sedan": 7000,
                                            "SUV": 8500
                                        },
                                        "Ahmedabad to Bhavnagar": {
                                            "Sedan": 2500,
                                            "SUV": 3000
                                        },
                                        "Ahmedabad to Palitana": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ahmedabad to Jodhpur": {
                                            "Sedan": 6000,
                                            "SUV": 7500
                                        },
                                        "Ahmedabad to Kadi Kalol": {
                                            "Sedan": 2000,
                                            "SUV": 3000
                                        },
                                        "Ahmedabad to Halol": {
                                            "Sedan": 2500,
                                            "SUV": 3500
                                        },
                                        "Ahmedabad to Junagadh": {
                                            "Sedan": 5500,
                                            "SUV": 6500
                                        },
                                        "Ahmedabad to Chittorgarh": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                        "Jaipur to Udaypur": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                        
                                        // reverse tours
                                        
                                        "Mumbai to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 8000
                                        },
                                        "Surat to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Vapi to Ahmedabad": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                        "Baroda to Ahmedabad": {
                                            "Sedan": 1800,
                                            "SUV": 2300
                                        },
                                        "Morbi to Ahmedabad": {
                                            "Sedan": 2500,
                                            "SUV": 3000
                                        },
                                        "Gandhidham to Ahmedabad": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Bhuj to Ahmedabad": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Udaypur to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Jaipur to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Bhilwara to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Mount Aabu to Ahmedabad": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Aabu to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Ajmer to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Delhi to Ahmedabad": {
                                            "Sedan": 11000,
                                            "SUV": 13000
                                        },
                                        "Rajkot to Ahmedabad": {
                                            "Sedan": 2500,
                                            "SUV": 3500
                                        },
                                        "Somnath to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7500
                                        },
                                        "Dwarka to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Jamnagar to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4000
                                        },
                                        "Statue Of Unity to Ahmedabad": {
                                            "Sedan": 4000,
                                            "SUV": 5000
                                        },
                                        "Saputara to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7000
                                        },
                                        "Pune to Ahmedabad": {
                                            "Sedan": 7000,
                                            "SUV": 8500
                                        },
                                        "Nashik to Ahmedabad": {
                                            "Sedan": 7000,
                                            "SUV": 8500
                                        },
                                        "Bhavnagar to Ahmedabad": {
                                            "Sedan": 2500,
                                            "SUV": 3000
                                        },
                                        "Palitana to Ahmedabad": {
                                            "Sedan": 3500,
                                            "SUV": 4500
                                        },
                                        "Jodhpur to Ahmedabad": {
                                            "Sedan": 6000,
                                            "SUV": 7500
                                        },
                                        "Kadi Kalol to Ahmedabad": {
                                            "Sedan": 2000,
                                            "SUV": 3000
                                        },
                                        "Halol to Ahmedabad": {
                                            "Sedan": 2500,
                                            "SUV": 3500
                                        },
                                        "Junagadh to Ahmedabad": {
                                            "Sedan": 5500,
                                            "SUV": 6500
                                        },
                                        "Chittorgarh to Ahmedabad": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                        "Udaypur to Jaipur": {
                                            "Sedan": 5000,
                                            "SUV": 6000
                                        },
                                    };
                            
                                    function updatePrice() {
                                        const selectedLocation = document.getElementById("drop").value;
                                        const selectedCab = document.getElementById("taxi").value;
                                        const priceField = document.getElementById("price");
                            
                                        if (priceMapping[selectedLocation] && priceMapping[selectedLocation][selectedCab]) {
                                            priceField.value = priceMapping[selectedLocation][selectedCab];
                                        } else {
                                            priceField.value = "";
                                        }
                                    }
                                </script>
                                <!--<div class="col-lg-6">-->
                                <!--    <div class="form-group">-->
                                <!--        <label>Drop Off Location</label>-->
                                <!--        <input type="text" class="form-control" placeholder="Type Location" name="drop" required>-->
                                <!--        <i class="far fa-location-dot"></i>-->
                                <!--    </div>-->
                                <!--</div>-->
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Passengers</label>
                                        <input type="text" class="form-control" placeholder="Passengers" name="passenger" required>
                                        <i class="far fa-user-tie"></i>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Pick Up Date</label>
                                        <input type="date" class="form-control" name="pickdate" placeholder="MM/DD/YY">
                                        <i class="far fa-calendar-days"></i>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>Pick Up Time</label>
                                        <input type="text" class="form-control time-picker" name="picktime" placeholder="00:00 AM">
                                        <i class="far fa-clock"></i>
                                    </div>
                                </div>
                                <!--<div class="col-lg-6">-->
                                <!--<div class="form-group">-->
                                <!--<label>Driver Age</label>-->
                                <!--<select class="select">-->
                                <!--<option value>Choose Age</option>-->
                                <!--<option value="1">Any Age</option>-->
                                <!--<option value="2">25</option>-->
                                <!--<option value="3">30</option>-->
                                <!--<option value="4">35</option>-->
                                <!--<option value="5">40</option>-->
                                <!--</select>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--<div class="col-lg-6">-->
                                <!--<div class="form-group">-->
                                <!--<label>Cab Model</label>-->
                                <!--<select class="select">-->
                                <!--<option value>Choose Model</option>-->
                                <!--<option value="1">All Model</option>-->
                                <!--<option value="2">M5 2022</option>-->
                                <!--<option value="3">Q7 2021</option>-->
                                <!--</select>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--<div class="col-lg-12">-->
                                <!--    <div class="form-group">-->
                                <!--        <label>Your Message</label>-->
                                <!--        <textarea class="form-control" rows="5" placeholder="Write Your Message" name="message"></textarea>-->
                                <!--    </div>-->
                                <!--</div>-->
                                <div class="col-lg-12">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="condition" required>
                                        <label class="form-check-label" for="condition">By using this form you agree to our <a target="_blank" href="privacy.php">terms & conditions</a>.</label>
                                    </div>
                                </div>
                                <div class="col-lg-3 mx-auto">
                                    <button class="theme-btn" type="submit" name="submit">Book Your Taxi<i class="fas fa-arrow-right"></i></button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <?php include 'footer.php';?>

MMCT - 2023