[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: cart1.php
<?php include("header.php"); ?> <!-- Inner Banner --> <!--<div class="inner-banner"> <div class="container"> <h4>Check Out</h4> <ul> <li><a href="index.php">Home</a></li> <li><i class="fa-solid fa-angles-right"></i></li> <li>Check Out</li> </ul> </div> </div> --> <div class="check-out"> <div class="container"> <h2>Check out</h2> <form method="post" enctype="multipart/form-data"> <table class="table"> <tbody> <tr> <th class="t-head head-it ">Product</th> <th class="t-head price-head">Price</th> <th class="t-head quantity">Quantity</th> <th class="t-head price-head">Total Price</th> <th class="t-head remove">Remove</th> </tr> <!-- fast product --> <?php $count_add=1; if(isset($_SESSION["cart_item"])){ $item_total = 0; ?> <?php foreach ($_SESSION["cart_item"] as $item){ //print_r($item); ?> <script> $(document).ready(function(){ $("#qty<?php echo $count_add; ?>").change(function(){ var qty =$("#qty<?php echo $count_add; ?>").val(); var code =$("#code<?php echo $count_add; ?>").val(); var price =$("#price<?php echo $count_add; ?>").val(); var gprice = qty*price; var valueinshow=price+"*"+qty+"="+gprice; $.ajax({ type: "POST", url: "cart_update.php", data: "qty="+qty+"&code="+code+"&price="+price, cache: false, success: function(result){ a=result; $("#gprice<?php echo $count_add; ?>").val(gprice); $("#sub_tot").val(gprice); $("#quantity<?php echo $count_add; ?>").val(qty); $("#base_total").val(gprice); calculateSum(); } }); }); }); </script> <tr class="cross"> <td class=" t-data"> <div class="sed2"> <a href="single.php" class="at-in"> <img src="<?=$pic_img?>/<?=$item["img"]; ?>" alt="LOGO"> </a> </div> <div class="sed"> <h5><input type="text" name="product_name[]" value="<?=$item["pro_name"]; ?>" readonly /></h5> </div> <div class="clearfix"> </div> </td> <td class="t-data price-head"> <input type="text" name="price[]" id="price<?php echo $count_add; ?>" value="<?=$item["price"]; ?>" readonly /> </td> <td class="t-data quantity"> <div class="quantity"> <select id="qty<?php echo $count_add; ?>" name="qty[]" > <?php for($i=1;$i<=10;$i++){ ?> <option value="<?php echo $i; ?>" <?php if($i==$qty) echo 'selected'; ?>><?php echo $i; ?></option> <?php }?> </select> </div> </td> <td class="t-data price-head"> <input type="hidden" name="code[]" id="code<?php echo $count_add; ?>" value="<?php echo $item["code"]; ?>" readonly /> <input type="text" name="totalp[]" class="gprice" id="gprice<?php echo $count_add; ?>" value="<?php echo $item["price"]; ?>" readonly /> </td> <td class="t-data remove"> <div class="close1"> <a href="cart.php?action=remove&code=<?php echo $item["code"]; ?>&size=<?php echo $item["size"]; ?>" class="button" ><i class="fa fa-times" aria-hidden="true"></i></a> </div> </td> </tr> <?php // $item["price"]=explode("Rs",$item["price"]); $item_total += ($item["price"]*$item["quantity"]); ++$count_add; } echo"<input type='hidden' value='$item_total' id='tot' name='tot'>"; ?> <?php } ?> <!-- <tr class="cross"> <td class="ring-in t-data"> <div class="sed2"> <a href="single.php" class="at-in"> <img src="images/earrings-2.png" class="img-responsive" alt=""> </a> </div> <div class="sed"> <h5><input type="text" name="product_name[]" value="Product 003321" readonly /></h5> </div> <div class="clearfix"> </div> </td> <td class="t-data"> <input type="text" name="price[]" value="560" readonly /> </td> <td class="t-data"> <div class="quantity"> <input type="text" name="name" value="1"> </div> </td> <td class="t-data"> <input type="text" name="totalp[]" id="c_price<?=$cn?>" class="total" value="560" readonly /> </td> <td class="ring-in t-data"> <div class="close1"> <a href="#" class="button" ><i class="fa fa-times" aria-hidden="true"></i></a> </div> </td> </tr> <tr class="cross"> <td class="ring-in t-data"> <div class="sed2"> <a href="single.php" class="at-in"> <img src="images/earrings-3.png" class="img-responsive" alt=""> </a> </div> <div class="sed"> <h5><input type="text" name="product_name[]" value="Product 003321" readonly /></h5> </div> <div class="clearfix"> </div> </td> <td class="t-data"> <input type="text" name="price[]" value="560" readonly /> </td> <td class="t-data"> <div class="quantity"> <input type="text" name="name" value="1"> </div> </td> <td class="t-data"> <input type="text" name="totalp[]" id="c_price<?=$cn?>" class="total" value="560" readonly /> </td> <td class="ring-in t-data"> <div class="close1"> <a href="#" class="button" ><i class="fa fa-times" aria-hidden="true"></i></a> </div> </td> </tr> --> <div class="clearfix"> </div> </tbody> </table> <div class="subtotal"> <span id="sum"></span> <div class="totall"> <label>Subtotal Rs : </label> <input type="text" name="sub_tot" id="sub_tot" value="<?=$item_total?>" readonly=""> <!---- <label> Tax [ GST ] : </label> <input type="text" name="gst" id="gst" value="18%" readonly> <label for="delivery">Delivery :</label> <input type="radio" id="delivery" name="del_type" value="delivery" style="margin: 10px 0 0;"> <br> <label for="pickup">Self-Pickup<small>[Get 30rs off]</small></label> <input type="radio" id="pickup" name="del_type" value="pickup" style="margin: 10px 0 0;"> <input type="hidden" id="del_amt" name="del_amt" value="40"> <div id="delv" style="display:none"> <label id="show_del" > <small>Delivery charge Rs :</small></label> <input type="text" name="delivery_chrge" id="delivery_chrge" value="0"> </div> <small><a href="login.php?">Login To See promocode</a></small> <input type="hidden" id="discount" value='0'> ------------------------------- <label> Grand Total Rs : </label> <input type="text" name="total" id="gtotal" value="" readonly> <br> </div> --> <div class="submit-chekout"> <input type="submit" value="CHECKOUT" name="sub" class="button"> </div> </div> </form> <?php if(isset($_POST['sub'])){ // echo "aaa"; if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) { $oid=$show->getid('ids','ORD'); $item_name=$_POST['product_name']; $item_code=$_POST['code']; $item_qty=$_POST['qty']; $item_price=$_POST['price']; $totalp=$_POST['totalp']; for($i = 0; $i < count($item_name); $i++){ $price =$item_price[$i]; //$total_p=intval($price*$item_qty[$i]); // $gst_value=($gst[$i]/100)*$total_p; $data=array( 'order_id'=>$oid, 'product_id'=>$item_code[$i], 'product_name'=>$item_name[$i], 'quantity'=>$item_qty[$i], 'price'=>$item_price[$i], 'order_time'=>date('Y-m-d h:i:s'), 'user_id'=>$_SESSION['user_id'], 'total'=>$totalp[$i], ); // print_r($data); echo "<br>"; $r=$show->insert('bill',$data); } $data2=array( 'order_id'=>$oid, 'amount'=>$_POST['sub_tot'], 'user_id'=>$_SESSION['user_id'], 'client_name'=>$_SESSION['user'], 'email'=>$_SESSION['username'], 'phon'=>$_SESSION['user_phone'], 'pay_status'=>'Pending', 'status'=>'Pending' ); // print_r($data2); echo "<br>"; // print_r($data1_c); echo "<br>"; $r1=$show->insert('place_order',$data2); if($r1 && $r){ echo 'ok'; $_SESSION['total']=$tot; // echo "<script>window.location.href='place_order.php?order=".$oid."&no_of_p=".urlencode($item_qty[$i])."'</script>"; echo "<script>window.location.href='place_order.php?order=".$oid."&no_of_p=".urlencode($item_qty[$i])."'</script>"; } }else { $url="cart.php"; echo '<script> setTimeout(function() { swal({ title: "Oops!", text: "Please Login/Sign up to continue", type: "error" }, function() { swal("You will be redirected to Login page"); window.location = "log-in.php?pg='.base64_encode($url).'"; }); }, 1000); </script>'; } } ?> </div> </div> <?php include("footer.php"); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.54 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619