ok
Direktori : /home2/selectio/www/ramali.in/ui-api/ |
Current File : /home2/selectio/www/ramali.in/ui-api/cart_details.php |
<?php ob_start(); session_start(); include '../config/config.php'; $statement = $pdo->prepare("SELECT cart.*,products.image,products.name,products.manufacturer,taxes.percentage ,product_variant.catelogue_pieces,product_variant.price,product_variant.measurement,product_variant.stock FROM `cart` LEFT JOIN products ON products.id=cart.product_id LEFT JOIN product_variant ON product_variant.id=cart.product_variant_id LEFT JOIN taxes ON taxes.id=products.tax_id WHERE user_id=".$_SESSION['ramali_textiles']['id']); $statement->execute(); $cart = $statement->fetchAll(PDO::FETCH_ASSOC); $total_count = $statement->rowCount(); ?> <?php if($total_count > 0) { ?> <table class="shop-table cart-table"> <thead> <tr> <th style="width: 15%;"><span>Product <?= $total_count ?> </span></th> <th class="product-size"><span>Name</span></th> <th class="product-size"><span>Size</span></th> <th class="product-price"><span>Price</span></th> <th class="product-price"><span>Stock</span></th> <th class="product-quantity"><span>Pieces</span></th> <th class="product-price"><span>GST</span></th> <th class="product-subtotal"><span>Subtotal</span></th> </tr> </thead> <tbody> <?php foreach ($cart as $rowcart) { ?> <tr class="row_cart" data-rowid="<?=$rowcart['id'];?>"> <td class="product-thumbnail"> <div class="p-relative"> <figure> <img src="dashboard/<?=$rowcart['image'] ?>" alt="product" width="300" height="338"> </figure> <span class="btn btn-close cart_remove" onclick="removeCart(<?=$rowcart['id']?>)" > <i class="fas fa-times"></i> </span> </div> </td> <td class="resize" > <?=$rowcart['name'] ?> </td> <td class="product-size" style="text-align: center;"> <?=$rowcart['measurement'] ?> </td> <td class="product-price" style="text-align: center;"> <span class="amount "> <!--<i class="bi bi-currency-rupee"></i>--> <span class="product_price"><?=number_format($rowcart['price'],2) ?></span></span> </td> <input value="<?=$rowcart['price']?>" id="total_price" name="price[]" type="hidden"> <?php $total_amount = ($rowcart['price']) ; $taxrate=$rowcart['percentage']; // 22% $total_amount; $priceMinusTax=($total_amount/(($taxrate/100)+1)); ?> <td class="product-quantity" style="text-align: center;"> 1 </td> <td class="product-quantity" style="text-align: center;"> <?=$rowcart['catelogue_pieces'] ?> </td> <td class="product-quantity" style="text-align: center;"> <?php if($rowcart['percentage']){ echo $rowcart['percentage'].'%'; } else { echo '0%'; } ?> </td> <td class="product-subtotal" style="text-align: center;"> <span class="amount"> <span class="product_total"><?php if($rowcart['stock']>0){ echo (($total_amount/100)*$rowcart['percentage'])+$total_amount ; } else { echo $rowcart['price']; }?> </span> </span> </td> </tr> <?php } ?> </tbody> </table> <?php } else{ echo '<h3 style="text-align:center;">No products</h3>'; } ?>