<?php
    include('include/header.php');

        $product_id =$_GET['pro_code'];
        $sql_pro = "SELECT * FROM `tbl_product` where `pro_id` ='$product_id'";
        $run_pro = mysqli_query($link,$sql_pro);
        $result_pro = mysqli_fetch_assoc($run_pro);

        $cattt =$result_pro['pro_category'];

        $sql_cats = "SELECT * FROM `tbl_category` where `cat_id` ='$cattt'";
        $run_cats = mysqli_query($link,$sql_cats);
        $result_cats = mysqli_fetch_assoc($run_cats);

        

?>
    <!-- ------------------breadcrumb-------------->
    <div class="breadcrumb-container">
      <nav data-depth="5" class="breadcrumb container">
     
        <ol class="bredclr">
          <li>
            <a href="index.php">
              <span>Home</span>
            </a>
          </li>
          <li >
            <a  href="product.php?code=<?=$result_cats['cat_id']?>">
              <span><?=$result_cats['cate_name']?></span>
            </a>
          </li>
          <li>          
              <span><?=$result_pro['pro_name']?></span>
          </li>
        </ol>
      </nav>
    </div>
    <!-- ---------------section-------------------- -->
    <section id="wrapper" style="padding:80px 0 !important;  background-size:cover !important; background-repeat:no-repeat;">
      <div class="container">
        <div class="row">
          <div id="content-wrapper" class="col-12">
            <section id="main">
              <div class="row">
                <div class="col-md-6">
                  <section class="page-content" id="content">
                    <!-- <ul class="product-flags">
                      <li class="product-flag new">New</li>
                    </ul> -->
                    <div class="images-container">
                      <div class="product-cover">
                        <div id="product-zoom">
                          <img class="js-qv-product-cover" src="product-image/<?=$result_pro['pro_image'];?>" alt="product-image" title="product-image" style="width:100%;">
                        </div>
                      </div>
                      <div class="col-md-12">
                        <div class="js-qv-mask mask">
                          <ul class="qv-carousel product-images owl-carousel">
                            <li class="thumb-container item">
                              <img
                              class="thumb js-thumb  selected "
                              src="product-image/<?=$result_pro['pro_image'];?>"
                              alt="<?=$result_cats['cate_name']?>"
                              title="<?=$result_cats['cate_name']?>"
                              data-image-large-src="product-image/<?=$result_pro['pro_image'];?>"
                              width="100"
                              itemprop="image"
                              >
                            </li>
                            <?php
                                     $sn=1;
                                        $sql_pro_im = "SELECT * FROM `tbl_product_image` where `pro_id`='$product_id'";
                                        $run_pro_im = mysqli_query($link,$sql_pro_im);
                                        while($result_pro_im = mysqli_fetch_assoc($run_pro_im))
                                        {
                                            ?>
                                            <li class="thumb-container item">
                                             <img  class="thumb js-thumb " src="product-image/<?=$result_pro_im['gal_image']?>" alt="<?=$result_cats['cate_name']?>" title="<?=$result_cats['cate_name']?>" data-image-large-src="product-image/<?=$result_pro_im['gal_image']?>"  width="100" itemprop="image">
                                            </li>
                                           <?php
                                           $sn++;
                                        }
                                    ?>
                           
                            <!-- <li class="thumb-container item">
                              <img
                              class="thumb js-thumb "
                              src="assets/images/products-catg/1.jpg"
                              alt="related-items"
                              title=""
                              data-image-large-src="assets/images/products-catg/1.jpg"
                              width="100"
                              itemprop="image"
                              >
                            </li>
                            <li class="thumb-container item">
                              <img
                              class="thumb js-thumb "
                              src="assets/images/products-catg/1.jpg"
                              alt="related-items"
                              title=""
                              data-image-large-src="assets/images/products-catg/1.jpg"
                              width="100"
                              itemprop="image"
                              >
                            </li>
                            <li class="thumb-container item">
                              <img
                              class="thumb js-thumb "
                              src="assets/images/products-catg/1.jpg"
                              alt="related-items"
                              title=""
                              data-image-large-src="assets/images/products-catg/1.jpg"
                              width="100"
                              itemprop="image"
                              >
                            </li> -->
                          </ul>
                        </div>
                      </div>
                    </div>
                    <div class="scroll-box-arrows">
                      <i class="material-icons left">&#xE314;</i>
                      <i class="material-icons right">&#xE315;</i>
                    </div>
                  </section>
                </div>
                <div class="col-md-6 productfullldetails">
                  <h1 class="h1 product-title">  <?=$result_pro['pro_name']?>    </h1>
                  <p style="color:#2e3093  !important;"><?=$result_cats['cate_name']?></p>
                  <!-- <h4 style="margin:10px 0 15px !important; font-size:25px !important; color:#ff6f69 !important;">Rs.  <?=$result_pro['pro_price']?> /- </h4> -->
                  <p> <b>Product-Availability  : </b>
                      <?php
                        if($result_pro['pro_type']!=="" && $result_pro['pro_type'] > 0)
                          {
                              echo "In stock"; 
                           }
                           else
                           {
                              echo "Out of stock";   
                           }
                     ?>
                   </p>
                   
                  
                   
                  <div class="product-information">
                    <div id="product-description-short-1">
                      <p><?=$result_pro['pro_brf']?></p>
                    </div>                   
                    <div class="product-actions">
                          <div class="product-add-to-cart">                            
                            <div class="product-quantity clearfix">
                                <div id="product-availability">                                   
                                    </div>


                                    <div class="row product-block-information">
                    <div class="col-12 product-details">
                      <div class="tabs">
                        <ul class="nav nav-tabs" role="tablist">
                          <li class="nav-item active">
                           <a
                           class="nav-link"
                           data-toggle="tab"
                           href="#description"
                           role="tab"
                           aria-controls="description"
                           aria-selected="true">Pack Sizes</a>
                          </li>
                        </ul>
                        <div class="tab-content" id="tab-content">
                          <div class="tab-pane fade show active" id="description" role="tabpanel">
                            <div class="product-description">
                              <?=$result_pro['pro_desc']?>
                              <!-- <p>Little's Kingdom Toys World is a reputed name in India for offering high-quality toys and utility products for children. We are the top kids’ playing equipment manufacturers in Delhi and are actively engaged in manufacturing, designing, and supplying a wide range of products.</p> -->
                            </div>
                          </div>
                        
                        
                        </div>
                      </div>
                    </div>
                    
            
                  </div>



                              <div class="add">
                                <a class="btn btn-primary add-to-cart bgcclrsprdtenq" href="enquiry.php?code=<?=$result_pro['pro_name']?>">                                 
                                 Enquiry
                              </a>
                              </div>
                            </div>
                          </div>
                    </div>
                  </div>

                 
                </div>
              </div>
              
            </section>
          </div>
        </div>
      </div>
    </section>
    <div class="container">
      <div id="_mobile_left_column" class="row"></div>
      <div id="_mobile_right_column" class="row"></div>
      <div class="clearfix"></div>
    </div>
    <!-- -----------------footer-------------------- -->

<?php
    include('include/footer.php');
?>