HOME


sh-3ll 1.0
DIR: /home/magicrsz/public_html
/home/magicrsz/public_html/
Upload File:
Current File : /home/magicrsz/public_html/shop.php
<?php

include("header.php");

$query = "SELECT * from product";
$products =db::getRecords($query);

?>


<!--Page Header Start-->
<section class="page-header">
    <div class="page-header-bg" style="background-image: url(assets/images/backgrounds/juices.jpg)">
    </div>
    <div class="container">
        <div class="page-header__inner">
            <ul class="thm-breadcrumb list-unstyled">
                <li><a href="index.php">Home</a></li>
                <li><span>/</span></li>
                <li>Shop</li>
            </ul>
            <h2>Our Juices</h2>
            <h4 class="text-white">Purchase here, we deliver to you.Minimum Purchase £10. London Only</h4>
        </div>
    </div>
</section>
<!--Page Header End-->

<!--Product Start-->
<section class="product">
    <div class="container">
        <div class="row">

            <div class="col-xl-12 col-lg-9">
                <div class="product__items">

                    <div class="product__all">
                        <div class="row">
                            
                            <?php
                            if($products!=NULL)
                            {
                                foreach($products as $product)
                                {

                                    $product_id          = $product['id'];
                                    $query               = "SELECT * from product_image where product_id='$product_id'";
                                    $product_image      = db::getRecord($query);


                            ?>
                            <!--New Product Single Start-->
                            <div class="col-xl-6 col-lg-6 col-md-6 wow fadeInUp" data-wow-delay="100ms">
                                <div class="new-product__single">
                                    <div class="new-product__img-box">
                                        <div class="new-product__img">
                                            <a href="product-detail.php?id=<?php echo $product['id']; ?>"><img src="<?php echo "admin/product/images/".$product_image['image_name']; ?>" alt="" style="height:400px;"></a>
                                            <?php
                                    if($product['featured']==1){
                                    ?>
                                            <span class="new-product__sale">Featured</span>
                                            <?php
                                    }
                                        ?>
                                            <div class="new-product__img-icon">
                                                <a onclick="call_product_id(<?php echo $product['id']; ?>)"><i class="icon-shopping-cart text-white"></i></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="new-product__content">

                                        <h3 class="new-product__title"><a href="product-detail.php?id=<?php echo $product['id']; ?>"><?php echo $product['name']; ?></a></h3>
                                        
                                        <?php 
                                    $product_id=$product['id'];
                                    $query     = "SELECT * from sizes where product_id='$product_id'";
                                    $package_detail      = db::getRecord($query);
                                    if($package_detail!=NULL){
                                        ?>
                                        <input class="form-control" min="1" name="text" type="text" value="1" id="quantity" style="display: none;">
                                         <input class="form-control" type="text" value="<?php echo $package_detail['price']; ?>" id="getprice<?php echo $product_id; ?>" style="display: none;">
                                  <input class="form-control" type="text" value="<?php echo $package_detail['size']; ?>" id="size<?php echo $product_id; ?>" style="display: none;">
                                        <p class="new-product__price"><?php echo $package_detail['price']; ?></p>
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                            <!--New Product Single End-->
                            <?php
                                }
                            }
                            ?>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!--Product End-->
































<?php

include("footer.php");

?>

<script type="text/javascript">
    function call_product_id(id) {
        var product_id = id;
        var quantity = document.getElementById("quantity").value;
            var size = $('#size'+product_id).val();
            var getprice = $('#getprice'+product_id).val();
            if(getprice!==null){
            $.ajax({
                url: "actions/add_product_id.php",
                type: "POST",
                data: {
                    'product_id': product_id,
                    'quantity' : quantity,
                    'size':size,
                    'getprice':getprice,
                },
                success: function(response)
                {
                    $("#add_product_id").html(response);
                    if(response == "Product out of stock") {
                        swal({
                            title: response,
                            timer: 3000,
                            type:'warning',
                            showConfirmButton: true
                        });
                    }
                    else {
                        swal({
                            title: response,
                            timer: 3000,
                            type:'success',
                            showConfirmButton: true
                        });
                    }
                },
            });
            }

    }

</script>