[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: cart.php
<?php include("header.php"); ?> <!-- Inner Banner Start --> <div class="inner-banner"> <img src="images/inner-banner.png" alt="Fashion Tradet Inner Banner"> <div class="inner-banner-text-block"> <div class="container"> <h1>Cart</h1> </div> </div> </div> <div class="check-out"> <div class="container"> <h1>Cart</h1> <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</th> <th class="t-head">Quantity</th> <th class="t-head">Total Price</th> <th class="t-head">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="ring-in 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"> <input type="text" name="price[]" id="price<?php echo $count_add; ?>" value="<?=$item["price"]; ?>" readonly /> </td> <td class="t-data"> <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"> <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="ring-in t-data"> <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 } ?> <div class="clearfix"> </div> </tbody> </table> <div class="subtotal"> <span id="sum"></span> <div class="totall"> <label>Grand Total Rs : </label> <input type="text" name="sub_tot" id="sub_tot" value="<?=$item_total?>" readonly=""> <!--- <div id="promocode111"> <div id="promocode" style="border-bottom: 0.5px dotted #919090;"> <small> <label>Promo code ( If Any ) : </label> <input type="text" name="promo" id="promo" placeholder="Promocode" style="border-bottom: 1px dotted #ad0000;" required=""> <label>Discount : </label> <input type="text" id="discount" name="promo_discount" value="0"> <button class="button" id="promo_apply" type="button">Apply</button> </small> <div id="exist_c"></div> </div> </div> --> <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>"; } }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 = "login.php?pg='.base64_encode($url).'"; }); }, 1000); </script>'; } } ?> </div> </div> <script> function calculateSum() { var tot=0; var i="<?=$count_add?>"; var i=parseInt(i); for(var a=1;a<i;a++){ //alert(a); var gp=""; var gprice =$("#gprice"+a).val(); tot +=parseInt(gprice); $("#sub_tot").val(tot); } } </script> <?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: 692.11 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