MMCT TEAM
Server IP : 82.112.239.40  /  Your IP : 18.222.146.86
Web Server : LiteSpeed
System : Linux in-mum-web1676.main-hosting.eu 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
User : u641149403 ( 641149403)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u641149403/domains/cabz4you.com/public_html/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u641149403/domains/cabz4you.com/public_html/submit.php
<?php
session_start();
include('./include/config.php');
$cust_name=$_POST['cust_name'];
$cust_email=$_POST['cust_email'];
$cust_mob=$_POST['cust_mob'];
$cust_add=$_POST['cust_add'];
$cab_cat_id=  $_POST['cab_cat_id'];
$origin= $_POST['o'];
$destination= $_POST['d'];
$pickup_date= $_POST['pickup_date'];
$drop_date=  $_POST['drop_date'];
$pickup_time=  date('H:i:s',strtotime($_POST['pickup_time']));
$rate = $_POST['rate'];
$paid = $_POST['paid'];
$distance = $_POST['distance'];
$user_id = $_POST['user_id'];
$trip_type = $_POST['trip_type'];
$toll_tax = $_POST['toll_tax'];
$state_tax=$_POST['state_tax'];
$parking=$_POST['parking'];
$package_type=$_POST['package_type'];
$lat_to = $_POST['lat_to'];
$long_to = $_POST['long_to'];
$lat_from = $_POST['lat_from'];
$long_from = $_POST['long_from'];
$passenger = $_POST['passenger'];
$coupon = $_POST['coupon'];
$drop_address = $_POST['drop_add'];
$package_id = $_POST['package_id'];
$amenities = implode(",", $_POST['amenities']);
// if ($_POST['amenities'][0]>0) {
//   $carrier = 1;
// }else{
//   $carrier = 0;
// }
// $pet = $_POST['amenities'][1];

$carrier = 0;  // Initialize before the loop
$pet = 0;      // Initialize before the loop
$extra_charge = 0;      // Initialize before the loop
$luggage = 0;      // Initialize before the loop

$amenitiess = $db->query("SELECT * FROM amenities WHERE id IN($amenities)");

while ($amenity = mysqli_fetch_array($amenitiess)) {
    // Check if 'carrier' exists in the 'note' field
  if (strpos(strtolower($amenity['note']), 'carrier') !== false) {
        $carrier = 1;  // Set carrier to 1 if any amenity mentions carrier
        $luggage = $amenity['price'];  // Set carrier to 1 if any amenity mentions carrier
      }

    // Check if 'pet' exists in the 'note' field
      if (strpos(strtolower($amenity['note']), 'pet') !== false) {
        $pet = $amenity['price'];  // Use the price of the first matching pet amenity
      }

    // Check if 'extra Charge' exists in the 'note' field
      if (strpos(strtolower($amenity['note']), 'Extra Charges') !== false) {
        $extra_charge = $amenity['price'];  // Use the price of the first matching pet amenity
      }
    }


    $billing_name = $_POST['billing_name'];
    $gst_no = $_POST['gst_no'];
    $extra_km = $_POST['extra_km'];
    $_SESSION['paid_amount']=$paid;

    $sql="select * from users where contact='".$cust_mob."' or email='".$cust_email."' "; 
    $result = $db->query($sql);
    if ($result->num_rows > 0) 
    {
      $row = $result->fetch_assoc(); 
      $user_id = $row['id'];
    }else{
      $user=$db->query("INSERT INTO users (name, contact, email) VALUES ('$cust_name', '$cust_mob', '$cust_email')");
      $user_id = $db->insert_id;
    } 


    $cab_types = $db->query("SELECT * FROM cab_types WHERE id='$cab_cat_id'");
    $result = mysqli_fetch_array($cab_types);
    $cab_type = $result['type'];
    if($trip_type=='Airport'){
      $cab_types = $db->query("SELECT * FROM airport WHERE id='$cab_cat_id'");
      $result = mysqli_fetch_array($cab_types);
      $cab_type = $result['type'];
    }

    if ($trip_type=='Local') {
   $origin=$cust_add;
   $destination=$_POST['o'];
}

    $sql="INSERT INTO `bookings` (`booking_from`, `booking_to`, `pickup_date`, `drop_date`, `pickup_time`, `cab_type`, 
      `trip_type`, `price`, `pickup_address`, `status`, `user_id`, `distance`, `cust_name`, `cust_email`, `cust_mob`, `cust_add`, `toll_tax`, `state_tax`,`parking`, `latitude_from`, `longitude_from`, `latitude_to`, `longitude_to`, `luggage`,`city`,`pid`,`booking_type`,`amenities`,`billing_name`,`gst_no`,`extra_price`,`carrier`,`pet`,`extra_charge`) 
    VALUES ('$origin', '$destination', '$pickup_date', '$drop_date','$pickup_time', '$cab_type', '$trip_type','$rate','$cust_add',  'booked' ,'$user_id', '$distance',  '$cust_name', '$cust_email', '$cust_mob', '$cust_add', '$toll_tax', '$state_tax','$parking', '$lat_from', '$long_from', '$lat_to', '$long_to', '$luggage','$destination', '$package_id','Website','$amenities','$billing_name','$gst_no','$extra_km','$carrier','$pet','$extra_charge')";
    if($db->query($sql)===true)
    {
      $booking_id = $db->insert_id;
      $ORDER_ID=$user_id.time().uniqid(mt_rand(),true);

      $sql="insert into payment_log(booking_id,txn_id,txn_amount,txn_status) values('$booking_id','$ORDER_ID','$paid',1)";


    }
    if($db->query($sql)===true)
    {
      $sql = "SELECT *,bookings.id as id FROM bookings INNER JOIN users ON users.id=bookings.user_id LEFT JOIN cab_types ON cab_types.id=bookings.cab_type WHERE bookings.id=$booking_id";
      $result = $db->query($sql);

      if ($result->num_rows > 0) 
      {
        $row = $result->fetch_assoc();
        $contact = $row['contact'];
                    // whatsapp
        $included_exclude='';

        $included_exclude.="Toll Tax - Included \n";

        $included_exclude.="State Tax - Included \n";

        $included_exclude.="Parking - Included \n";

// customer msg send
        $msg = "Hi  ".$row['name']." 
        that Booking ID  C4U".$booking_id." 
        From - ".$origin."
        To - ".$destination." 
        Cab Type - ".$row['type']." 
        Trip Type -".$trip_type." 
        Pickup Date - ".$pickup_date."
        Pickup Time - ".$pickup_time."

        Booking Amount: ".$rate."/-Rupees
        Advance Amount: ".$paid."/-Rupees

        ".$included_exclude."
        Night Charge 0/-Rupees

        Distance  ".$distance."Kms.

        BOOKING has been CONFIRMED
        Booking Confirmed Make Your Part Payment.. Pay the Rest to the driver

        Welcome to 
        cabz4U Taxi Service 
        Contact number 
        👇
        7830530004 7060000113 7830530005 
        👇
        🚕Book now taxi 🚕

        http://www.cabz4you.com/";

        $url="https://wa2sms.com/api/send?number=91".$row['contact']."&type=media&message=".urlencode($msg)."&media_url=".$whatsapp_image."&filename=".$whatsapp_image."&instance_id=".$instance_id."&access_token=".$access_token."";
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $data = curl_exec($ch);
        curl_close($ch);

// admin msg send
        $message = "Received New Booking From Website 

        Hi that Booking ID  C4U".$booking_id."  ".$origin." To ".$destination." ".$row['type']." ".$trip_type." Date ".$pickup_date." Time ".$pickup_time."

        Customer Name : ".$row['name']."
        Customer Contact : ".$row['contact']."

        Booking Amount: ".$rate."/-Rupees

        ".$included_exclude."
        Night Charge 0/-Rupees

        Distance  ".$distance."Kms.

        BOOKING has been CONFIRMED
        Booking Confirmed Make Your Part Payment.. Pay the Rest to the driver

        www.cabz4you.com

        Thanks for

        Cabz4you";

        $url="https://wa2sms.com/api/send?number=917830530004&type=media&message=".urlencode($message)."&media_url=".$whatsapp_image."&filename=".$whatsapp_image."&instance_id=".$instance_id."&access_token=".$access_token."";
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $data = curl_exec($ch);
        curl_close($ch);

        $row = $result->fetch_assoc();
        $email = $row['email'];
        $pick_date=date("d-m-Y", $p_date);
        $p_time = strtotime($row['pickup_time']);
        $pick_time=date("h:i A", $p_time);

        include('admin/smtp/PHPMailerAutoload.php');
        $mail=new PHPMailer();
        $mail->isSMTP();
        $mail->Host='smtp.hostinger.com';
        $mail->Port=465;
        $mail->SMTPSecure="ssl";
        $mail->SMTPAuth=true;
        $mail->Username="info@cabz4u.in";
        $mail->Password="Rock@2022";
        $mail->setFrom("info@cabz4u.in");
        $mail->addAddress($email);
        $mail->AddAddress('rowtravels@gmail.com');
        $mail->isHTML(true);
        $mail->Subject="Booking Details";
        $mail->Body='<html lang="en">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
        <meta name="format-detection" content="telephone=no"> 
        <title></title>

        <style type="text/css">
        body {
          margin: 0;
          padding: 0;
          -ms-text-size-adjust: 100%;
          -webkit-text-size-adjust: 100%;
        }

        table {
          border-spacing: 0;
        }

        table td {
          border-collapse: collapse;
        }

        .ExternalClass {
          width: 100%;
        }

        .ExternalClass,
        .ExternalClass p,
        .ExternalClass span,
        .ExternalClass font,
        .ExternalClass td,
        .ExternalClass div {
          line-height: 100%;
        }

        .ReadMsgBody {
          width: 100%;
          background-color: #ebebeb;
        }

        table {
          mso-table-lspace: 0pt;
          mso-table-rspace: 0pt;
        }

        img {
          -ms-interpolation-mode: bicubic;
        }

        .yshortcuts a {
          border-bottom: none !important;
        }

        @media only screen and (max-width: 600px) {
      *[class="gmail-fix"] {
          display: none !important;
        }
      }
      @media screen and (max-width: 599px) {
        table[class="force-row"],
        table[class="container"] {
          width: 100% !important;
          max-width: 100% !important;
        }

        table[class="force-row two"] {
          width: 50% !important;
          max-width: 50% !important;
        }
      }
      @media screen and (max-width: 400px) {
        td[class*="container-padding"] {
          padding-left: 12px !important;
          padding-right: 12px !important;
        }
      }
      .ios-footer a {
        color: #aaaaaa !important;
        text-decoration: underline;
      }

      @media screen and (max-width: 599px) {
        td[class="col"] {
          width: 50% !important;
          text-align: center;
        }

        td[class="cols-wrapper"] {
          padding-top: 18px;
        }

        img[class="image"] {
          padding-bottom: 10px;
        }

        div[class="subtitle"] {
          margin-top: 0 !important;
        }
      }
      @media screen and (max-width: 400px) {
        td[class="cols-wrapper"] {
          padding-left: 0 !important;
          padding-right: 0 !important;
        }

        td[class="content-wrapper"] {
          padding-left: 12px !important;
          padding-right: 12px !important;
        }
      }
      </style>

      </head>
      <body style="margin:0; padding:0;" bgcolor="#e1e1e1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

      <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="#e1e1e1">


      <table border="0" width="600" cellpadding="0" cellspacing="0" class="container" style="width:600px;max-width:600px">
      <tr class="gmail-fix">
      <td>
      <table cellpadding="0" cellspacing="0" border="0" align="center" width="600">
      <tr>
      <td cellpadding="0" cellspacing="0" border="0" height="1"; style="line-height: 1px; min-width: 600px;">
      <img src="http://coloredge.com/newsletters/2015/06/images/spacer.gif" width="600" height="1" style="display: block; max-height: 1px; min-height: 1px; min-width: 600px; width: 600px;"/>
      </td>
      </tr>
      </table>
      </td>
      </tr>

      <tr>
      <td class="content" align="left" style="background-color:#ffffff">

      <table width="600" border="0" cellpadding="0" cellspacing="0" class="force-row" style="width: 100%;">
      <tr style="background:url(https://cabz4you.com/admin/web-admin/upload/6481c642b2224kedarnath-package.jpg); background-size: cover;height:300px;">

      <td style="padding-top: 50px;padding-left: 10px;">

      </td>
      </tr>
      <tr>
      <td class="content-wrapper" style="padding-left:24px;padding-right:24px;">
      <p style="text-transform:capitalize;font-family:sans-serif;font-size: 26px !important;margin-top: 15px; margin-bottom: 15px;">Dear '.$row['name'].'</p> 


      <hr style="border-bottom: solid 1px #000; border-top: 0;">
      </td>
      </tr>
      <tr>
      <td style="padding:5px 25px;font-size:22px"><p>Your Booking ID : '.$row['id'].'</p>
      <p>Pickup date & Time : '.$pick_date.' '.$pick_time.'.</p>
      <p>From : '.$row['pickup_address'].' To '.$row['booking_to'].' is confirmed driver & cab details will be sent before 2 hr. of pickup time.</p>
      <p>Thanks For Booking Cabz4you.</p>
      <p>24x7 Customer Support: 7830530004.</p>
      <p>Online Booking visit: www.cabz4you.com</p></td>
      </tr>

      <tr>
      <td style="background:#fff;text-align:center;width:100%;height:15px;"></td>  
      </tr>
      <tr>
      <td class="content-wrapper" style="padding-left:24px;padding-right:24px;text-align: center;" align="center">
      <hr style="border-bottom: solid 1px #000; border-top: 0;">
      <br>

      </td>
      </tr>
      <tr>
      <td style="background:#fff;text-align:center;width:100%;height:25px;"></td>  
      </tr>

      <tr>
      <td style="background:#e1e1e1;text-align:center;width:100%;height:15px;"></td>  
      </tr>
      <tr>
      <td style="background:#e1e1e1;text-align: center;">
      <a href="#" title="Facebook"><img src="https://cabz4you.com/images/facebook-logo.png" width="40" height="40" alt="Facebook"></a>
      <a href="#"  title="Twitter"><img src="https://cabz4you.com/images/twitter.png" width="40" height="40" alt="Twitter"></a>
      <a href="#" target="_blank" title="Instagram"><img src="https://cabz4you.com/images/instagram.png" width="40" height="40" alt="Instagram"></a>

      </td>
      </tr>
      <tr>
      <td style="background:#e1e1e1;text-align:center;width:100%;height:5px;"></td>  
      </tr>
      <tr>
      <td style="background:#e1e1e1;text-align:center;">
      <div style="font-family:Helvetica, Arial, sans-serif;font-size:13px !important;color:#000000;text-align: center;line-height:1.4;">
      92 Dron Vihar Housing Society old Mitthi beri<br> Prem Nagar Dehradun Pin-248007<br>

      </div>  
      </td>  
      </tr>
      <tr>
      <td style="background:#e1e1e1;text-align:center;width:100%;height:30px;"></td>  
      </tr>

      </table>

      </td>
      </tr>


      </table>


      </td>
      </tr>
      </table>

      </body>
      </html>';

      $mail->send();
    }
    header('Location:success.php');
  }
  else{
    echo "<script>if(confirm('Oops something went wrong please try again...!')){document.location.href='index'};</script>";    
  }
  ?>

MMCT - 2023