ok
Direktori : /home2/selectio/public_html/thecomponents.in/ |
Current File : /home2/selectio/public_html/thecomponents.in/product.php |
<?php include "header.php"; $product_id = $_GET['product']; $query = $pdo->prepare("SELECT products.*,product_variant.measurement,product_variant.price,product_variant.stock,product_variant.discounted_price,product_variant.serve_for,product_variant.stock,product_variant.sku FROM `products` LEFT JOIN product_variant ON products.id=product_variant.product_id WHERE products.id=".$product_id); $query->execute(); $result = $query->fetchAll(PDO::FETCH_ASSOC); $query = $pdo->prepare("SELECT products.*,product_variant.measurement,product_variant.price,product_variant.stock,product_variant.discounted_price,product_variant.serve_for,product_variant.stock,product_variant.sku FROM `products` LEFT JOIN product_variant ON products.id=product_variant.product_id"); $query->execute(); $result_pro = $query->fetchAll(PDO::FETCH_ASSOC); ?> <style> .minipopup-area{ display: none; } .category-dropdown.fixed .dropdown-box{ display: none; } </style> <main class="main single-product"> <div class="page-content mb-8"> <div class="container"> <div class="product-navigation"> <ul class="breadcrumb breadcrumb-lg"> <li> <a href="index.php"> <i class="d-icon-home"></i> </a> </li> <li> <a href="#" class="active">Products</a> </li> <li>Detail</li> </ul> </div> <div class="row gutter-lg"> <aside class="col-lg-3 right-sidebar sidebar-fixed sticky-sidebar-wrapper"> <div class="sidebar-overlay"> <a class="sidebar-close" href="#"> <i class="d-icon-times"></i> </a> </div> <a href="#" class="sidebar-toggle"> <i class="fas fa-chevron-left"></i> </a> <div class="sidebar-content"> <div class="sticky-sidebar"> <div class="service-list mb-4"> <div class="icon-box icon-box-side icon-box3"> <span class="icon-box-icon mr-lg-4 mb-lg-4 mb-0"> <i class="d-icon-secure"></i> </span> <div class="icon-box-content"> <h4 class="icon-box-title ls-m">Secured Payment</h4> <p class="ls-m">We ensure secure payment!</p> </div> </div> <div class="icon-box icon-box-side icon-box1"> <span class="icon-box-icon mr-lg-4 mb-lg-4 mb-0"> <i class="d-icon-truck"></i> </span> <div class="icon-box-content"> <h4 class="icon-box-title ls-m">Free Shipping</h4> <p class="ls-m">On all US orders above ₹99</p> </div> </div> <div class="icon-box icon-box-side icon-box2"> <span class="icon-box-icon mr-lg-4 mb-lg-4 mb-0"> <i class="d-icon-money"></i> </span> <div class="icon-box-content"> <h4 class="icon-box-title ls-m">Money Back guarantee</h4> <p class="ls-m">Any back within 30 days</p> </div> </div> </div> <div class="banner banner-fixed mb-6"> <figure> <img src="images/new-product-detail/dc-drone-f.jpg" alt="banner" width="280" height="320"> </figure> <div class="banner-content text-center"> <h5 class="banner-subtitle ls-l text-uppercase mb-0">DJI DC Motor</h5> <h3 class="banner-title ls-s text-uppercase mb-0">New Trend 2023</h3> </div> </div> <div class="widget widget-products"> <h4 class="widget-title border-no">Our Featured</h4> <div class="widget-body"> <div class="owl-carousel owl-nav-top" data-owl-options="{ 'items': 1, 'loop': true, 'nav': true, 'dots': false, 'margin': 20 }"> <div class="products-col"> <?php foreach ($result_pro as $row_result){ ?> <div class="product product-list-sm"> <figure class="product-media"> <a href="product.php?product=<?=$product_id?>"> <img src="admin/<?=$row_result['image']?>" alt="product" width="100" height="100"> </a> </figure> <div class="product-details"> <h3 class="product-name"> <a href="product.php?product=<?=$product_id?>">R<?=$row_result['name']?></a> </h3> <div class="product-price"> <span class="price">₹<?=$row_result['price']?></span> </div> <div class="ratings-container"> <div class="ratings-full"> <span class="ratings" style="width:100%"></span> <span class="tooltiptext tooltip-top"></span> </div> </div> </div> </div> <?php } ?> </div> </div> </div> </div> </div> </div> </aside> <div class="col-lg-9"> <?php foreach ($result as $row_product){ ?> <?php // echo '<pre>'; // print_r($row_product); // echo '</pre>'; ?> <?php $other_images = json_decode($row_product['other_images']); foreach ($other_images as $img){ //echo "$img"; } //print_r($other_images); ?> <div class="product product-single row mb-10"> <div class="col-md-6"> <div class="product-gallery"> <div class=""> <!--admin/upload/images/8019-2023-10-09.jpg--> <figure > <img src="admin/<?=$row_product['image']?>" id="parent" alt="Blue Pinafore Denim Dress" width="800" height="900"> </figure> </div> <div class="product-thumbs-wrap"> <div class="product-thumbs"> <?php foreach ($other_images as $other_img){ $url= "admin/".$other_img ?> <div class="product-thumb active" onclick="changed('<?=$url?>')"> <img src="admin/<?=$other_img?>" alt="product thumbnail" width="109" height="122"> </div> <?php } ?> </div> <button class="thumb-up disabled"> <i class="fas fa-chevron-left"></i> </button> <button class="thumb-down disabled"> <i class="fas fa-chevron-right"></i> </button> </div> </div> </div> <div class="col-md-6"> <div class="product-details"> <h1 class="product-name"><?=$row_product['name']?></h1> <div class="product-meta" style="margin-bottom: 3px;"> <span style="font-size: 13px;color: black;font-weight: 600;">SKU:</span> <span class="product-sku" style="color: #05b895;font-size: 13px;"><?=$row_product['sku']?></span> </div> <div class="product-meta" style="margin-bottom: 3px;"> <span style="font-size: 13px;color: black;font-weight: 600;">Manufacturer :</span> <span class="product-sku" style="color: #05b895;font-size: 13px;"><?=$row_product['made_in']?></span> </div> <div class="product-meta" style="margin-bottom: 3px;"> <span style="font-size: 13px;color: black;font-weight: 600;">Availability :</span> <span class="product-sku" style="color: #05b895;font-size: 13px;"><?=$row_product['serve_for']?></span> </div> <div class="product-meta" style="margin-bottom: 3px;"> <span style="font-size: 13px;color: black;font-weight: 600;">Pcs :</span> <span class="product-sku" style="color: #05b895;font-size: 13px;"><?=$row_product['measurement']?></span> </div> <div class="product-meta" style="margin-bottom: 3px;"> <span style="font-size: 13px;color: black;font-weight: 600;">Stock :</span> <span class="product-sku" style="color: #05b895;font-size: 13px;"><?=$row_product['stock']?></span> </div> <div class="product-price total-Product-Price"> <i class="bi bi-currency-rupee"></i> <?=$row_product['price']?> </div> <h4>Product Details:</h4> <p class="product-short-desc"> <?=$row_product['product_details']?> <input value="<?= $row_product['price'] ?>" id="price" type="hidden" > </p> <hr class="product-divider"> <div class="product-form product-qty"> <!--<label>QTY:</label>--> <div class="product-form-group"> <div class="input-group"> <button class="quantity-minus d-icon-minus" OnClick="grand_total()" ></button> <input id="quantity_<?=$product_id?>" class="quantity form-control" value="1" type="number" min="1" max="<?= $result[0]['stock'] ?>" readonly> <button class="quantity-plus d-icon-plus" OnClick="grand_total()" ></button> </div> <?php $statementp=$pdo->prepare("SELECT * FROM `cart` where product_id=? and user_id=?"); $statementp->execute(array($product_id,$_SESSION['caliber']['id'])); $totalp=$statementp->rowCount(); $resultp=$statementp->fetchAll(PDO::FETCH_ASSOC); if($totalp==1) { ?> <span class="btn-product btn-cart" style="color: green;">Added</span> <?php } else{ ?> <span id="items_<?= $result[0]['id'] ?>" class="btn-product btn-cart" onclick="Quick_AddToCart(<?= $result[0]['id'] ?>)"> <i class="d-icon-bag"></i>Add To Cart </span> <?php } ?> </div> </div> <hr class="product-divider mb-3"> </div> </div> </div> <div class="tab tab-nav-simple product-tabs mt-2 mb-4"> <ul class="nav nav-tabs justify-content-center" role="tablist"> <li class="nav-item"> <a class="nav-link active" href="#product-tab-description">Description</a> </li> <li class="nav-item"> <a class="nav-link" href="#product-tab-additional">Specification</a> </li> <li class="nav-item"> <a class="nav-link" href="#product-tab-reviews">Warranty</a> </li> </ul> <div class="tab-content"> <div class="tab-pane active in" id="product-tab-description"> <div class="row mt-6"> <div class="mb-4"> <!--<h5 class="description-title mb-4 font-weight-semi-bold ls-m"> Features</h5>--> <ul class="list-none"> <?=nl2br($row_product['description'])?> </ul> </div> </div> </div> <div class="tab-pane" id="product-tab-additional"> <ul class="list-none"> <?=nl2br($row_product['shipping_delivery'])?> </ul> </div> <div class="tab-pane " id="product-tab-reviews"> <div class="row"> <div class="col-12 comments pt-2 pb-10 border-no"> <?=$row_product['warranty']?> </div> </div> </div> </div> </div> <?php } ?> <section class="product-wrapper mb-4"> <h2 class="title mb-0 d-block text-center">Related Products </h2> <div class="owl-carousel owl-theme owl-nav-full owl-split row cols-2 cols-md-3 cols-lg-4 gutter-xs" data-owl-options="{ 'items': 5, 'nav': true, 'loop': false, 'dots': false, 'margin': 1, 'responsive': { '0': { 'items': 2 }, '768': { 'items': 3 }, '992': { 'items': 4 } } }"> <div class="product text-center"> <?php $statement = $pdo->prepare("SELECT * FROM products WHERE category_id=? AND id=?"); $statement->execute($result[0]['category_id'],$product_id); $related = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($related as $related_products){ ?> <figure class="product-media"> <a href="product1.php"> <img src="admin/<?=$related_products['image']?>" alt="product" width="220" height="206"> </a> <div class="product-action-vertical"> <a href="#" class="btn-product-icon btn-cart" data-toggle="modal" data-target="#addCartModal" title="Add to cart"> <i class="d-icon-bag"></i> </a> <a href="#" class="btn-product-icon btn-wishlist" title="Add to wishlist"> <i class="d-icon-heart"></i> </a> </div> <div class="product-action"> <a href="#" class="btn-product btn-quickview" title="Quick View">Quick View</a> </div> </figure> <div class="product-details"> <h3 class="product-name"> <a href="product1.php">Raspberry PI 3 Model B+ Basic Kit</a> </h3> <div class="product-price"> <ins class="new-price">₹199.00</ins> <del class="old-price">₹210.00</del> </div> <div class="ratings-container"> <div class="ratings-full"> <span class="ratings" style="width:100%"></span> <span class="tooltiptext tooltip-top"></span> </div> <a href="product1.php" class="rating-reviews">( 6 reviews )</a> </div> </div> </div> <?php } ?> </div> </section> </div> </div> </div> </div> </main> <?php include "footer.php"; ?> <script> $(document).ready(function(){ grand_total(); $("#quantity").keyup(function(){ grand_total(); }); }); function grand_total(){ $(".total-Product-Price").empty(); var price = $("#price").val(); var qty = $(".quantity").val(); $(".total-Product-Price").text(qty * price); }; function changed(id){ $("#parent").attr("src", id); $('#parent').attr('data-zoom-image', id); } </script>