MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.119.122.69
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/../agarsarbharat.com/../bhatiataxiservice.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/fastelevator.in/../agarsarbharat.com/../bhatiataxiservice.in/booking.php
<?php
    include_once('admin/config.php');
    if ($_SERVER["REQUEST_METHOD"] === "POST") {
        if (isset($_POST['submit-booking'])) {
            $tour_name=$_POST['tour_name'];
            $price=$_POST['price'];
            $car_type=$_POST['car_type'];
        }
        
        if (isset($_POST['booking'])) {
            $tour_name=$_POST['tour_name'];
            $name=$_POST['name'];
            $phone=$_POST['phone'];
            $email=$_POST['email'];
            $date=$_POST['date'];
            $car_type=$_POST['car_type'];
            $price=$_POST['price'];
            $date=$_POST['date'];
            date_default_timezone_set('Asia/Kolkata');
            $currentDate = date('Y-m-d');
            $sqli="INSERT INTO `tbl_order`(
                `ord_amount`,
                `ord_ord_name`,
                `ord_pack_type`,
                `ord_person_name`,
                `ord_email`,
                `ord_mobile`,
                `ord_doj`,
                `ord_status`,
                `ord_date`) 
                VALUES (
                '$price',
                '$tour_name', 
                '$car_type', 
                '$name',
                '$email',
                '$phone',
                '$date',
                'Not Paid',
                '$currentDate')";
            $result = mysqli_query($db, $sqli) or die("Query unsuccessful");
// window.alert('Succesfully Submitted, Please Pay Now!');
	        if($result){
            $hostName = 'Bhatia Taxi Service';	  		  
$msgmail="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Bhatia Taxi Service</title>
 </head>
<body>		  
	 <table align='center' cellSpacing='0' cellPadding='0' width='87%' border='1' style='border:1px solid #e61938'>
  <tbody>
    <tr>
      <td vAlign='top' style='background-color:#e61938; padding:10px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:16px; color:#ffffff; text-align:center; font-weight:bold;' colspan='3' >Enquiry From $hostName</td>
    </tr>

     <tr>
      <td width='30%' vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Package</strong> </td>
      <td vAlign='top' width='70%' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$tour_name</td>
    </tr>


  <tr>
      <td width='30%' vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Cost</strong> </td>
      <td vAlign='top' width='70%' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$price</td>
    </tr>
	


     <tr>
      <td width='30%' vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Name</strong> </td>
      <td vAlign='top' width='70%' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$name</td>
    </tr>
   
    <tr>
      <td vAlign='top'  style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Mobile</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$phone</td>
    </tr>
	
	<tr>
      <td vAlign='top'  style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Email-Id</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$email</td>
    </tr>
	<tr>
      <td vAlign='top'  style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;' ><strong>Address</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$address</td>
    </tr>
	 <tr>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;'  ><strong>Date of journey</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>".date('d M Y',strtotime($date))."</td> 
    </tr>
	
	 <tr>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;'  ><strong>No. of Person</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$person</td> 
    </tr>
	
	 <tr>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;'  ><strong>Pickup Points</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>$pickup</td> 
    </tr>
	
 <tr>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#003366; background-color:#F9E2DD;padding:10px;'  ><strong>Current Status</strong> </td>
      <td vAlign='top' style='font-family:Verdana, Arial, Helvetica, sans-serif;padding:10px;'>In Process</td> 
    </tr>	
	
  </tbody>
</table>
</body>
</html>";

$senderName = $name;
$senderEmail = $email;

$toEmail = "shankarmoji@gmail.com";
$subject = "Booking Details From $hostName";
                $from="$senderEmail";
		        $Headers1 = "From: $senderName <$senderEmail>\r\n";
                $Headers1 .= "Reply-To: $senderEmail\r\n";
                $Headers1 .= "X-Mailer: PHP/" . phpversion() . "\r\n";
                $Headers1 .= "X-Priority: 3\r\n";
                $Headers1 .= "MIME-Version: 1.0\r\n";
                $Headers1 .= "Content-Type: text/html; charset=iso-8859-1\r\n";
				@mail("$toEmail", "$subject", "$msgmail","$Headers1","-fenquiry@tradekeyindia.com");
				 $toEmail."<br>"; 
				 
///////////////****** Mailer to client end here **********************//////////////


$toEmail =$email;
$subject = "Booking confirmation on Bhatia Taxi Service";
		        $from="shankarmoji@gmail.com";
				$Headers1 = "From: shankarmoji@gmail.com<$from>\n";
				$Headers1 .= "Reply-To: shankarmoji@gmail.com\r\n";
                $Headers1 .= "X-Mailer: PHP/" . phpversion() . "\r\n";
                $Headers1 .= "X-Priority: 3\r\n";
                $Headers1 .= "MIME-Version: 1.0\r\n";
                $Headers1 .= "Content-Type: text/html; charset=iso-8859-1\r\n";
				@mail("$toEmail", "$subject", "$msgmail","$Headers1","-fenquiry@tradekeyindia.com");
				 $toEmail."<br>";
            //   if($enquiry_email){
               @mail($mail_to_admin,$sub_admin,$mail_admin_body,$headers_admin);
               echo "<script>
                     window.alert('Successfully Sent! We will contact you soon');
                     window.location.href = 'index.html';
                     </script>";
            //   }
        }else{
                echo"Error ";
            }
        }
    }
?>
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Booking  | Bhatia Taxi Service</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <?php include "links.php";?>
    <style>
        .booking-container .container {
            max-width: 800px;
            margin: 20px auto;
            padding: 20px;
            background-color: #fff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            border-radius: 5px;
        }

        #bookingForm  h1 {
            text-align: center;
            margin-bottom: 20px;
            color: var(--primary-color);
        }

     
        #bookingForm form {
            margin: 20px;
            display:flex;
            width: 100%;
        }

        #bookingForm label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }

        input[type="text"],
        input[type="date"],
        input[type="email"],
        select {
            width: 100%;
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        #bookingForm button {
            width: 100%;
            padding: 10px;
            background-color: var(--primary-color);
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #bookingForm  button:hover {
            background-color: var(--secondary-color);
        }

        #bookingForm .ticket {
            margin-top: 20px;
            padding: 15px;
            border: 1px solid #ccc;
            background-color: #fff;
        }
     
        #bookingForm .icon {
            color: var(--accent-color);
            font-size: 24px;
            margin-right: 5px;
        }
    </style>
</head>

<body>

    <!--<div class="preloader">-->
    <!--    <div class="loader">-->
    <!--        <span></span>-->
    <!--        <span></span>-->
    <!--        <span></span>-->
    <!--        <span></span>-->
    <!--    </div>-->
    <!--</div>-->


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


    <div class="breadcrumb breadcrumb-style-one">
        <div class="container">
            <div class="col-lg-12 text-center">
                <h2 class="breadcrumb-title">Book Your Tour</h2>
                <ul class="d-flex justify-content-center breadcrumb-items">
                    <li class="breadcrumb-item"><a href="<?php echo $wspath?>">Home</a></li>
                    <li class="breadcrumb-item active">Book Now</li>
                </ul>
            </div>
        </div>
    </div>
    <section id="booking">
        <div class="container">
        <h1><i class="fa fa-car text-warning"></i> Book Now</h1>
        <form action="#" method="POST">
            <div class="row py-4 my-4" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;">
                <div class="col-md-12 pkg_nm mb-4"><?php echo $tour_name;?> - <span> Rs.<?= $price?>/-</span></div>
                <div class="col-lg-6">
                    <label for="name">NAME <span style="color:red;">*</span></label>
                    <input type="hidden" name="tour_name" value="<?php echo $tour_name;?>">
                    <input type="text" name="name" placeholder="Your Name" required>
                </div>
                <div class="col-lg-6">
                    <label for="mobile">MOBILE NO <span style="color:red;">*</span></label>
                    <input type="text" name="phone" maxlength="10" placeholder="Mobile Number" required>
                </div>
                <div class="col-lg-6">
                    <label for="email">EMAIL ID <span style="color:red;">*</span></label>
                    <input type="email" name="email" placeholder="Your Email" required>
                </div>
                <div class="col-lg-6">
                    <label for="date">Date of Travel <span style="color:red;">*</span></label>
                    <input type="date" name="date" id="date" required min="<?php echo date('Y-m-d'); ?>">
                </div>
                <div class="col-lg-6">
                    <label for="date">Your Car <span style="color:red;">*</span></label>
                    <input type="text" name="car_type" id="car_type" required readonly value="<?= $car_type?>">
                </div>
                <!--<div class="col-lg-6">-->
                <!--    <label for="destination">Select Car<span style="color:red;">*</span></label>-->
                <!--    <select id="destination" name="car_type" onchange="updateFare()" >-->
                <!--    <option value="">Choose Your Car</option>-->
                <!--    <option value="Swift Dezire">Swift Dezire</option>-->
                <!--    <option value="Innova Crysta">Innova Crysta</option>-->
                <!--    <option value="Ertiga">Ertiga</option>-->
                <!--    </select>-->
                <!--</div>-->
                <div class="col-lg-6">
                    <label for="fare">Booking Amount</label>
                    <input type="text" name="price" id="fare" readonly value="<?= $price?>">
                </div>
                <div class="col-lg-12">
                    <button class="w-100 py-2 bg-primary border-0 text-white" type="submit" name="booking"><i class="fa fa-check text-warning"></i> Pay Now</button>
                </div>
            </div>
         </form>
        </div>
    </section>

    <?php include "footer.php"?>
    <!--<script>-->
    <!--    function updateFare() {-->
    <!--        var numberOfPersons = document.getElementsByName("accomodation")[0].value;-->
    <!--        var farePerPerson = <?php echo $price;?>;-->
    <!--        var totalFare = numberOfPersons * farePerPerson;-->
    <!--        document.getElementsByName("price")[0].value = totalFare;-->
    <!--    }-->
    <!--</script>-->
    <script>
    document.addEventListener('DOMContentLoaded', function () {
        var nameInput = document.querySelector('input[name="name"]');
        
        nameInput.addEventListener('input', function () {
            nameInput.value = capitalizeFirstLetter(nameInput.value.trim());
        });

        function capitalizeFirstLetter(str) {
            return str.charAt(0).toUpperCase() + str.slice(1);
        }
    });
</script>
    <script>
    document.addEventListener('DOMContentLoaded', function () {
        document.querySelector('form').addEventListener('submit', function (e) {
            var valid = true;

            // Mobile number validation
            var phoneInput = document.querySelector('input[name="phone"]');
            if (!/^\d{10}$/.test(phoneInput.value)) {
                setError(phoneInput, 'Please enter a valid 10-digit mobile number.');
                valid = false;
            } else {
                clearError(phoneInput);
            }

            // Email validation
            var emailInput = document.querySelector('input[name="email"]');
            if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailInput.value)) {
                setError(emailInput, 'Please enter a valid email address.');
                valid = false;
            } else {
                clearError(emailInput);
            }

            // Date validation
            var dateInput = document.querySelector('input[name="date"]');
            var currentDate = new Date();
            currentDate.setHours(0, 0, 0, 0); // Set time to midnight
            var selectedDate = new Date(dateInput.value + 'T00:00:00+05:30'); // Assume Indian time zone (GMT+5:30)

            // Check if the selected date is before the current date
            if (selectedDate.getTime() < currentDate.getTime()) {
                setError(dateInput, 'Please select an upcoming date.');
                valid = false;
            } else {
                clearError(dateInput);
            }

            // Car type validation
            var carTypeInput = document.querySelector('select[name="car_type"]');
            if (carTypeInput.value === '') {
                setError(carTypeInput, 'Please choose a car type.');
                valid = false;
            } else {
                clearError(carTypeInput);
            }

            // Prevent form submission if validation fails
            if (!valid) {
                e.preventDefault();
            }
        });

        function setError(input, message) {
            input.classList.add('is-invalid');
            var errorElement = document.createElement('div');
            errorElement.className = 'invalid-feedback';
            errorElement.innerText = message;
            input.parentNode.appendChild(errorElement);
        }

        function clearError(input) {
            input.classList.remove('is-invalid');
            var errorElement = input.parentNode.querySelector('.invalid-feedback');
            if (errorElement) {
                errorElement.parentNode.removeChild(errorElement);
            }
        }
    });
</script>


</body>
    
</html>

MMCT - 2023