<?php session_start();
   require_once("./config/config.php");
   
   
   
   $limit =8;  
       if (isset($_GET["page"])) { 
         $pn  = $_GET["page"]; 
       } 
       else { 
         $pn=1; 
       };  
     
   $start_from = ($pn-1) * $limit;  
   
   $sqlcou="SELECT * FROM product_master ORDER BY RAND() LIMIT $start_from, $limit";
   $myquerycou=$conn->query($sqlcou);
   $mydaracou= $myquerycou->fetchAll()  ;
   $rows_foundcou = $myquerycou->rowCount();
    if($rows_foundcou=='0'){
           $status='active';
           }
   
           $sql_tag = "SELECT * FROM meta_tag_setting WHERE pages = 'deals-of-the-day.php'";
           $mydara_sql = $conn->query($sql_tag);
           $fetch_tag = $mydara_sql->fetchAll();
           $rows_tag =$mydara_sql->rowCount();
           
           if($rows_tag !=0 ){
              foreach( $fetch_tag  as $rowcon ) {
                 $title = $rowcon['title'];
                 $description  = $rowcon['description'];
                 $keyword = $rowcon['keyword'];
              }
           }
       // This is a code for php minifiers Begin
       ob_start("minifier");
       function minifier($code) {
           $search = array(
                
               // Remove whitespaces after tags
               '/\>[^\S ]+/s',
                
               // Remove whitespaces before tags
               '/[^\S ]+\</s',
                
               // Remove multiple whitespace sequences
               '/(\s)+/s',
                
               // Removes comments
               '/<!--(.|\s)*?-->/'
           );
           $replace = array('>', '<', '\\1');
           $code = preg_replace($search, $replace, $code);
           return $code;
       }
       // This is a code for php minifiers End
      ?>

<!DOCTYPE html>
<html lang="en">
   <head>
      <!-- Character set configuration -->
      <base href="<?=$base_link?>" target="_self">
      <meta charset="UTF-8" />
      <title><?=$title?></title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge" />
      <link id="favicon" rel="icon" type="image/x-icon" href="images/web-images/home/favicon.png"/>
      <meta name="robots" content="index, follow" />
      <meta name="description" content="<?=$description?>">
      <meta name="keywords" content="<?=$keyword?>">
      <link rel="canonical" href="deals-of-the-day.php"/>
      <!-- Viewport configuration, scaling options -->
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>

      <!-- CSS Stylesheet -->
      <link href="css/icouponworld.css" rel="stylesheet" />
      <!-- Font Awesome icon -->
      <link href="fontawesome/css/fontawesome.css" rel="stylesheet" />
      <!-- Google Analytics Code Begin-->
      <?=$google_ana ?>
      <!-- Google Analytics Code End-->
      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
      <![endif]-->
   </head>
   <body>
      <!-- Preloader Begin-->
      <div class="preloader">
         <div class="loading">
            <img src="images/web-images/home/loader.gif" alt="loader" title="loader" class="mx-auto d-flex"> 
            <h2 class="text-center fw-light">loading...</h2>
         </div>
      </div>
      <!-- Preloader End-->
      <!--Header Begin-->
      <?php include("./includefiles/header.php"); ?>
      <!--Header End-->
      <!--Overlay Begin-->
      <div id="overlay"></div>
      <!--Overlay End-->
      <!--Subheader Section Begin Begin-->
      <?php include("./contentpages/deals_of_the_day/deal_of_the_header.php"); ?> 
      <!--Subheader Section Begin End-->
      <!--Deal of the Day product and Coupon Begin-->
      <section class="bg-primary-gradient py-4">
         <div class="container">
            <ul class="nav nav-pills product-coupons-tab mt-5 justify-content-center align-items-center" id="pills-tab" role="tablist">
               <li class="nav-item" role="presentation">
                  <button class="nav-link <?php  if (isset($_GET["page"])) { echo 'active'; }else{ if (empty($_GET["page_coupon"])){ echo 'active'; } } ?>" id="pills-product-dealoftheday-tab" data-bs-toggle="pill" data-bs-target="#pills-product-dealoftheday" type="button" role="tab" aria-controls="pills-product-dealoftheday" aria-selected="true"><i class="fas fa-store pe-2"></i> Product</button>
               </li>
               <li class="nav-item" role="presentation">
                  <button class="nav-link <?php  if (isset($_GET["page_coupon"])) { echo 'active'; } ?>" id="pills-coupons-dealoftheday-tab" data-bs-toggle="pill" data-bs-target="#pills-coupons-dealoftheday" type="button" role="tab" aria-controls="pills-coupons-dealoftheday" aria-selected="false"><i class="fas fa-tags pe-2"></i> Coupons</button>
               </li>
            </ul>
            <div class="tab-content" id="pills-tabContent">
               <!--pills product dealoftheday Begin-->
               <?php include("./contentpages/deals_of_the_day/deal_of_the_product.php"); ?> 
               <!--pills product dealoftheday End-->
               <!--pills coupons dealoftheday Begin-->
               <?php include("./contentpages/deals_of_the_day/deal_of_the_coupon.php"); ?> 
               <!--pills coupons dealoftheday End-->
            </div>
         </div>
      </section>
      <!--Deal of the Day product and Coupon End-->
      <!--Text Section Begin-->
      <?php include("./contentpages/deals_of_the_day/deal_of_the_description.php"); ?> 
      <!--Text Section End-->
      <!--like product Modal Begin-->
      <div class="modal fade" id="like-product" tabindex="-1" aria-labelledby="likeproductLabel" aria-hidden="true">
         <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
               <div class="modal-header border-0">
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
               </div>
               <div class="modal-body">
                  <div class="mx-auto d-block text-center">
                     <h6 class="likethead">Please <a href="#">Sign in </a><strong> for like</strong></h6>
                     <img src="images/web-images/home/like.png" alt="like" title="like" width="50" class="img-fluid">
                  </div>
               </div>
               <div class="modal-footer bg-transparent">
                  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
               </div>
            </div>
         </div>
      </div>
      <!--like product Modal End-->
      <!--favourate  Product Modal Begin -->
      <div class="modal fade" id="favorite-product" tabindex="-1" aria-labelledby="favoriteproductLabel" aria-hidden="true">
         <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
               <div class="modal-header border-0">
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
               </div>
               <div class="modal-body">
                  <div class="mx-auto d-block text-center">
                     <h6 class="likethead">Please <a href="#">Sign in </a><strong> for favorite</strong></h6>
                     <img src="images/web-images/home/favorite.png" alt="favorite" title="favorite" width="50" class="img-fluid">
                  </div>
               </div>
               <div class="modal-footer bg-transparent">
                  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
               </div>
            </div>
         </div>
      </div>
      <!--favourate  Product Modal End -->
      <!--share-coupon Modal -->
      <!--like coupon Modal Begin-->
      <div class="modal fade" id="like-coupon" tabindex="-1" aria-labelledby="likecouponLabel" aria-hidden="true">
         <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
               <div class="modal-header border-0">
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
               </div>
               <div class="modal-body">
                  <div class="mx-auto d-block text-center">
                     <h6 class="likethead">Please <a href="#">Sign in </a><strong> for like</strong></h6>
                     <img src="images/web-images/home/like.png" alt="like" title="like" width="50" class="img-fluid">
                  </div>
               </div>
               <div class="modal-footer bg-transparent">
                  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
               </div>
            </div>
         </div>
      </div>
      <!--like coupon Modal End-->
      <!--favourate coupon Modal Begin-->
      <div class="modal fade" id="favorite-coupon" tabindex="-1" aria-labelledby="favoritecouponLabel" aria-hidden="true">
         <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
               <div class="modal-header border-0">
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
               </div>
               <div class="modal-body">
                  <div class="mx-auto d-block text-center">
                     <h6 class="likethead">Please <a href="#">Sign in </a><strong> for favorite</strong></h6>
                     <img src="images/web-images/home/favorite.png" alt="favorite" title="favorite" width="50" class="img-fluid">
                  </div>
               </div>
               <div class="modal-footer bg-transparent">
                  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
               </div>
            </div>
         </div>
      </div>
      <!--favourate coupon Modal End-->
      <!--For more saving  subscribe now Begin-->
      <?php include("./contentpages/common-files/hubspot.php"); ?>
      <!--For more saving subscribe now End-->
      <!--Modal Begin-->
      <?php include("./contentpages/common-files/modal.php"); ?>   
      <!--Modal End -->
      <!--footer Section Begin-->
      <?php include("./includefiles/footer.php"); ?>
      <!--footer Section End-->
      <!--scroll to top Begin-->
      <button onclick="topFunction()" id="gobackToTop" title="Go To Top"><i class="fas fa-angle-up"></i></button>
      <!--scroll to top end-->
      <!-- jquery-3.4.1.min js Begin-->
      <script src="js/jquery-3.4.1.min.js"></script>
      <!-- jquery-3.4.1.min js End-->
      <!-- bootstrap.bundle.min js Begin-->
      <script src="js/bootstrap.bundle.min.js"></script>
      <!-- bootstrap.bundle.min js End-->
      <!-- icouponworld js Begin-->
      <script src="js/icouponworld.js"></script>
      <!-- icouponworld js end-->
      <!-- sweetalert.min.js Begin-->
      <script src="js/sweetalert.min.js"></script>
      <!-- sweetalert.min.js End-->
      <!--script for googleTranslateElementInit Begin-->
      <!-- <script>
         function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
      </script> -->
      <!--script for googleTranslateElementInit End-->
      <!--script for googleTranslate Begin-->
      <!-- <script src="js/googletranslate.js"></script> -->
      <!--script for googleTranslate End-->
      <!-- like_dislike_product script Begin-->
      <script type="text/javascript">  
         function cwRating_product(id,type,target){
         $.ajax({
           type:'POST',
           url:'forms/like_dislike_product.php',
           data:'id='+id+'&type='+type,
           success:function(msg){
               if(msg == 'err'){
                   alert('Some problem occured, please try again.');
               }else{
                   $('.like'+target).html(msg);
                   swal({
         title: "Hurray!",
         text: "Your liking was just saved.",
         imageUrl: 'thumbs-up.jpg'
         });
               }
           }
         });
         }
      </script>
      <!-- like_dislike_product script End-->
      <!-- fav_master_product script Begin-->
      <script type="text/javascript">  
         function fav_product(id,type){
         $.ajax({
           type:'POST',
           url:'forms/fav_master_product.php',
           data:'id='+id+'&type='+type,
           success:function(msg){
               if(msg == 'err'){
                   alert('Some problem occured, please try again.');
               }else{
                   $('.fav'+id).html(msg);
                   swal({
         title: "Yay!",
         text: "We just saved your favourite.",
         imageUrl: 'thumbs-up.jpg'
         });
               }
           }
         });
         }
      </script> 
      <!-- fav_master_product script End-->
      <!-- like_dislike script Begin-->
      <script type="text/javascript">  
         function cwRating(id,type,target){
         $.ajax({
           type:'POST',
           url:'forms/like_dislike.php',
           data:'id='+id+'&type='+type,
           success:function(msg){
               if(msg == 'err'){
                   alert('Some problem occured, please try again.');
               }else{
                   $('.like'+target).html(msg);
                   swal({
         title: "Hurray!",
         text: "Your liking was just saved.",
         imageUrl: 'thumbs-up.jpg'
         });
               }
           }
         });
         }
      </script>
      <!-- like_dislike script End-->
      <!--fav_master script Begin-->
      <script type="text/javascript">  
         function fav(id,type){
         $.ajax({
           type:'POST',
           url:'forms/fav_master.php',
           data:'id='+id+'&type='+type,
           success:function(msg){
               if(msg == 'err'){
                   alert('Some problem occured, please try again.');
               }else{
                   $('.fav'+id).html(msg);
                   swal({
         title: "Yay!",
         text: "We just saved your favourite.",
         imageUrl: 'thumbs-up.jpg'
         });
               }
           }
         });
         }
      </script>
      <!--fav_master script End-->
      <!--script for copytoclipboard Begin-->
      <script>
         function copy(inputId) {
             /* Get the text field */
         
             // Changed to get the Element by the parameter containing the ElementID
             var copyText = document.getElementById(inputId);
         
             /* Select the text field */
             copyText.select();
             copyText.setSelectionRange(0, 99999); /* For mobile devices */
         
             /* Copy the text inside the text field */
             navigator.clipboard.writeText(copyText.value);
         
             /* Alert the copied text */
             alert("Copied the text: " + copyText.value);
         }
      </script>
      <!--script for copytoclipboard End-->
   </body>
</html>
<?php
ob_end_flush();  // This is a code for php minifiers
?>