Uname : Linux V-ShopU01 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
Server : Apache/2.4.37 (rocky) OpenSSL/1.1.1k
Whoami : apache
Safe Mode : OFF
DOCUMENT ROOT : /var/www/html/site_shopudietDisable Function :
Path : /var/www/html/site_shopudiet/
Server IP : 65.20.74.164
Client IP : 18.220.244.7
Current File : /var/www/html/site_shopudiet/delete_product.php |
<?php
include 'dbconnect.php';
session_start();
$cart_id = $_SESSION['cart_id'];
unset($_SESSION['coupon']);
unset($_SESSION['discount_rate']);
unset($_SESSION['garnd_total1']);
$home_id=$_POST['id'];
$data['grand'] = 0;
$data['grandtotal'] = 0;
$sql = "DELETE FROM product_cart WHERE id=$home_id";
if ($conn->query($sql) === TRUE) {
$squery = "select * from product_cart where cart_id='$cart_id' AND status != 'confirm'";
$result = mysqli_query($conn,$squery);
$data['count'] = mysqli_num_rows($result);
$i=mysqli_num_rows($result);
$grandtotal=0;
$grand=0;
while( $row = mysqli_fetch_array($result))
{
$grand=$grand+$row['total'];
}
$data['grand'] = $grand;
$data['grandtotal']=$grand+30;
echo json_encode($data);
}
?>