<?php
  $moduleAskData=$db->prepare("SELECT * FROM modules where module_id=:module_id");
  $moduleAskData->execute(array(
    'module_id' => 4
    ));
  $moduleCheckData=$moduleAskData->fetch(PDO::FETCH_ASSOC);

if ($moduleCheckData['status']==1){
?>
<section class="gallery-section">
      <div class="outer-section">
      <!-- MixitUp Galery -->
      <div class="mixitup-gallery">
        <div class="auto-container">
          <div class="sec-title">
            <div class="clearfix">
              <div class="pull-left">
                <h2><?php echo $langArray['BEST_PRODUCT_HEAD']; ?></h2>
              </div>
            </div>
          </div>
        </div>
        <div class="sidebar-page-container">
          <div class="auto-container">
              <div class="row clearfix">
                <div class="content-side col-lg-12 col-md-12 col-sm-12">
                  <div class="shop-section">
                    <div class="our-shops">
                      <div class="row clearfix">
                           <?php
                              $homeProductsAsk->execute(array(
                                'post_type'       => 'post_products',
                                'status'          => 1,
                                'home_status'     => 1,
                                'language'        => $getLangCheck['language_id']
                              ));
                              while ($homeProjectCheck=$homeProductsAsk->fetch(PDO::FETCH_ASSOC)){
                                $x = explode("/", $homeProjectCheck['banner']);
                                $y = explode('.', $x[1]);
                                $homeProductsDetailAsk->execute(array(
                                  'product_post_id'       => $homeProjectCheck['post_id'],
                                ));
                                $homeProductsDetailCheck=$homeProductsDetailAsk->fetch(PDO::FETCH_ASSOC);
                            ?>
                          <div class="shop-item col-lg-3 col-md-6 col-sm-12">
                              <div class="inner-box">
                                  <div class="image">
                                      <img src="<?php echo $homeProjectCheck['banner']; ?>" alt="<?php echo $homeProjectCheck['title']; ?>" />
                                      <div class="overlay-box">
                                          <ul class="cart-option">
                                              <li><a href="<?php echo $homeProjectCheck['seo_url']; ?>"><span class="flaticon-unlink"></span></a></li>
                                              <li><a href="<?php echo $homeProjectCheck['banner']; ?>" data-fancybox="images" data-caption="" class="link"><span class="icon fa fa-search"></span></a></li>
                                          </ul>
                                      </div>
                                  </div>
                                  <div class="lower-content clearfix">
                                    <div class="row">
                                        <div class="col-md-12">
                                          <h6><a href="<?php echo $homeProjectCheck['seo_url']; ?>"><?php echo $homeProjectCheck['title']; ?></a></h6>
                                        </div>
                                      </div>
                                      <div class="row">
                                        <div class="col-md-12">
                                          <ul class="price">
                                            <?php
                                                if ($homeProductsDetailCheck['discount_price'] == "") {
                                                  $homeProductsDetailCheck['discount_price'] = 0;
                                                }
                                                $productVatRate = $homeProductsDetailCheck['vat'];
                                                $productPrice = $homeProductsDetailCheck['price'];
                                                $productPercentRate = $homeProductsDetailCheck['discount_price'];
                                                $disPriceRate = percentCalc($productPrice,$productPercentRate);
                                                $productDisTotal = $productPrice-$disPriceRate;
                                                if ($productVatRate>0) {
                                                  $disVatResult = addVat($productDisTotal,$productVatRate);
                                                  $vatResult = addVat($productPrice,$productVatRate);
                                                }else{
                                                  $disVatResult = $productDisTotal;
                                                  $vatResult = $productPrice;
                                                }
                                                ?>
                                                <?php if ($homeProductsDetailCheck['discount_price']) { ?>
                                                <li><del><?php echo $vatResult; ?> <?php echo $homeProductsDetailCheck['currency']; ?></del>
                                                  <b style="font-size:20px"><?php echo $disVatResult; ?> <?php echo $homeProductsDetailCheck['currency']; ?></b>
                                                </li><?php }else{ ?>
                                                  <li><b style="font-size:20px "><?php echo $homeProductsDetailCheck['currency']; ?>  <?php echo $vatResult; ?> </b>
                                                </li><?php } ?>
                                            </ul>
                                        </div>
                                      </div>
                                  </div>
                              </div>
                          </div>
                           <?php } ?>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
          </div>
        </div>
      </div>
    </div>
  </section>

<?php } ?>
