ok
Direktori : /home2/selectio/public_html/ramali.in/ui-api/ |
Current File : //home2/selectio/public_html/ramali.in/ui-api/cart.php |
<?php ob_start(); session_start(); include '../config/config.php'; if(isset($_POST['type']) && $_POST['type']=='remove' && isset($_POST['pro_id']) && $_POST['pro_id']!=0){ $statement=$pdo->prepare("DELETE FROM `cart` WHERE product_id=? and user_id=?"); $statement->execute(array($_POST['pro_id'],$_SESSION['ramali_textiles']['id'])); } ?> <table class="shop-table cart-table"> <thead> <tr> <th class="product-name"><span>Product</span></th> <th></th> <th class="product-price"><span>Price</span></th> <th class="product-quantityy"><span>Quantity</span></th> <th class="product-subtotal"><span>Subtotal</span></th> </tr> </thead> <tbody> <?php $statement = $pdo->prepare("SELECT products.*, cart.product_id,cart.user_id,cart.qty,product_variant.price FROM `products` LEFT JOIN cart ON products.id=cart.product_id LEFT JOIN users ON users.id=cart.user_id LEFT JOIN product_variant ON products.id=product_variant.product_id WHERE cart.user_id=".$_SESSION['ramali_textiles']['id']); $statement->execute(); $cart = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($cart as $rowcart) { ?> <tr> <td class="product-thumbnail"> <div class="p-relative"> <a href="product-default.html"> <figure> <img src="dashboard/<?=$rowcart['image'] ?>" alt="product" width="300" height="338"> </figure> </a> <button type="submit" onclick="get_cart_list('<?=$rowcart['id']; ?>','remove')" class="btn btn-close"><i class="fas fa-times"></i></button> </div> </td> <td class="product-name"> <a href="product-default.html"> <?=$rowcart['name']?> </a> </td> <td class="product-price"> <span class="amount"><i class="bi bi-currency-rupee"></i><span class="product_price"><?=$rowcart['price']?></span></span> </td> <td class="product-quantity"> <div class="input-group"> <input class="quantity form-control" type="number" value="1" min="1" max="100000"> <button class="quantity-plus w-icon-plus"></button> <button class="quantity-minus w-icon-minus"></button> </div> </td> <!--<td class="product-quantity product-qty-form"> <div class="input-group"> <input value="<?=$rowcart['price']?>" id="total_price" name="price[]" type="hidden"> <input name="pro_quantity[]" class="quantity form-control pro_quantity" value="1" type="number" min="1" max="100000"> <button class="quantity-plus w-icon-plus plus"></button> <button class="quantity-minus w-icon-minus plus"></button> </div> </td>--> <td class="product-subtotal"> <span class="amount"><i class="bi bi-currency-rupee"></i><span class="product_total"><?=$rowcart['price']?></span></span> </td> </tr> <?php } ?> </tbody> </table> <script src="../assets/js/main.min.js"></script>