GIF89a
<?php
if(isset($_POST['bookNow'])){
include('adminpanel/config.php');
if(isset($_POST['plan']) && $_POST['plan']=="plan2")$discount = $explodeDist[1];
else if(isset($_POST['plan']) && $_POST['plan']=="plan3")$discount = $explodeDist[2];
else if(isset($_POST['plan']) && $_POST['plan']=="plan4")$discount = $explodeDist[3];
else $discount = 0;
if(isset($_POST['amount']))$advAmount = $_POST['amount'];else $advAmount = 0;
if(isset($_POST['addon']) && $_POST['addon']=="Yes")$addonSts = $_POST['addon'];else $addonSts = "No";
$channelUrl = '';
$channelName = '';
for($ch=0;$ch<sizeof($_POST['channelUrl']);$ch++){
$channelurlRst[] = $_POST['channelUrl'][$ch];
$channelnameRst[] = $_POST['channelName'][$ch];
}
$channelUrl = json_encode($channelurlRst);
$channelName = json_encode($channelnameRst);
//final payable amount
$quantity = sizeof($_POST['channelUrl']);
$receipt_id=substr(hash('sha256', mt_rand() . microtime()), 0, 20);
$totalAmount = $_SESSION['amount'];
//insert order
if(empty($_POST['recreate_video']))$tot_shipping_charge=0;else $tot_shipping_charge = $_POST['recreate_video'];
$ins_order_Q = mysqli_query($con,"insert into `cart` set reg_id='$_SESSION[reg_id]',product_id='$_SESSION[productId]',quantity='$quantity',bll_name='$_POST[name]',bll_email='$_POST[email]',bll_mob='$_POST[mobile]',code_id='$receipt_id',disPercentage='$discount',discountAmt='$advAmount',Size='$addonSts',order_date='$currentTime',Color='$_POST[song_type]',bll_country='$channelUrl',orderBy='$channelName',tot_shipping_charge='$tot_shipping_charge',totalAmount='$totalAmount'") or die(mysqli_error($con));
if($ins_order_Q){
$_SESSION['name']=$_POST['name'];
$_SESSION['email']=$_POST['email'];
$_SESSION['mobile']=$_POST['mobile'];
$_SESSION['receipt_id']=$receipt_id;
$_SESSION['cname']=$_POST['name'];
$_SESSION['cemail']=$_POST['email'];
unset($_SESSION['productId']);
echo "<script>window.location='payment/'</script>";
//echo "<script>alert('Order has placed successfully.');window.location='booking.php'<//script>";
}
}
?>