<?php session_start();
   require_once("./config/config.php");
   $store_name = ($_REQUEST['store_name']);
   
    $sqlcou="SELECT * FROM  coupon WHERE company_name LIKE '$store_name%' OR short_title LIKE '$store_name%' ";
                    $myquerycou=$conn->query($sqlcou);
      $mydaracou= $myquerycou->fetchAll()  ;
      
      $rows_foundcou = $myquerycou->rowCount();
    
   if($rows_foundcou=='0'){
           
           $status='active';
           
       }
   
         
   
   
   $sqlcou_coupon="SELECT * FROM coupon WHERE coupon_code !='' AND company_name LIKE '$store_name%' OR short_title LIKE '$store_name%' AND coupon_code !=''";
      $myquerycou_coupon=$conn->query($sqlcou_coupon);
      $mydaracou_coupon_company= $myquerycou_coupon->fetchAll()  ;
      
      $rows_foundcou_coupon_data = $myquerycou_coupon->rowCount();
   
   
   $sqlcou_offers="SELECT * FROM coupon WHERE coupon_code ='' AND company_name LIKE '$store_name%' OR short_title LIKE '$store_name%' OR full_title LIKE '$store_name%'";
      $myquerycou_offers=$conn->query($sqlcou_offers);
      $mydaracou_offers= $myquerycou_offers->fetchAll()  ;
      
      $rows_foundcou_offers = $myquerycou_offers->rowCount();
   
      $sql_tag = "SELECT * FROM meta_tag_setting WHERE pages = 'store_specific'";
      $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" />
      <link rel="canonical" href="store_specific.php"/>
      <meta name="description" content="<?=$description?>">
      <meta name="keywords" content="<?=$keyword?>">
      <!-- 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-->
      <!--All Coupons Offers Section Begin-->
      <?php include("./contentpages/store_specific/store_specific_header.php"); ?> 
      <!--All Coupons Offers Section End--> 
      <!--Filters and showdetails Section Begin--> 
      <section class="bg-light">
         <!--container Begin--> 
         <div class="container">
            <!--row Begin--> 
            <div class="row">
               <!--col-md-3 Begin--> 
               <!--store_specific_sidebar Begin-->
               <?php include("./contentpages/store_specific/store_specific_sidebar.php"); ?> 
               <!--store_specific_sidebar End-->
               <!--col-md-3 End--> 
               <!--col-md-9 Begin--> 
               <!--store_specific Begin-->
               <?php include("./contentpages/store_specific/store_specific.php"); ?> 
               <!--store_specific End-->
               <!--col-md-9 End--> 
               <!--Horizontal banner Begin-->
               <div class="col-md-12">
                  <?php    if(!empty($google_adar )){
                     echo $google_adar ;
                     }else{
                     echo ' <img src="admin/forms/'.$adimg3.'" alt="Horizontal banner" title="Horizontal banner" class="img-fluid w-100 rounded-3 mt-4 mb-4">';
                     } ?>
               </div>
               <!--Horizontal banner End-->
            </div>
            <!--row End--> 
         </div>
         <!--container End--> 
      </section>
      <!--Filters and showdetails Section End--> 
      <!--Get The Latest & Best Coupon/Offer Alerts Begin-->
      <?php include("./contentpages/common-files/hubspot.php"); ?>
      <!--Get The Latest & Best Coupon/Offer Alerts End-->
      <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="./login-role/user">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>
      <!--favourate  Product Modal -->
      <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="./login-role/user">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>
      <!--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-->
      <!-- show_details and hide_details Script Begin-->
      <script>
         function show_details(id){
            
         $('#target-details-'+id).show();
         $('#show-details'+id).hide(0);
         $('#hide-details'+id).show(0);
         
         }
         function hide_details(id){
           
          $('#target-details-'+id).hide();
         $('#show-details'+id).show(0);
         $('#hide-details'+id).hide(0);
         
         }
         
      </script>
      <!-- show_details and hide_details 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 storeall Begin-->
      <script>
    function storeall(inputId) {
        /* Get the text field */

        // Changed to get the Element by the parameter containing the ElementID
        var storeallText = document.getElementById(inputId);

        /* Select the text field */
        storeallText.select();
        storeallText.setSelectionRange(0, 99999); /* For mobile devices */

        /* all the text inside the text field */
        navigator.clipboard.writeText(storeallText.value);

        /* Alert the copied text */
        alert("Copied the text: " + storeallText.value);
    }
</script>
 <!-- Script for copytoclipboard storeall End-->
  <!-- Script for copytoclipboard storecoupon Begin-->
<script>
    function storecoupon(inputId) {
        /* Get the text field */

        // Changed to get the Element by the parameter containing the ElementID
        var storecouponText = document.getElementById(inputId);

        /* Select the text field */
        storecouponText.select();
        storecouponText.setSelectionRange(0, 99999); /* For mobile devices */

        /* all the text inside the text field */
        navigator.clipboard.writeText(storecouponText.value);

        /* Alert the copied text */
        alert("Copied the text: " + storecouponText.value);
    }
</script>
 <!-- Script for copytoclipboard storecoupon End-->
  <!-- Script for copytoclipboard storeoffers Begin-->
<script>
    function storeoffers(inputId) {
        /* Get the text field */

        // Changed to get the Element by the parameter containing the ElementID
        var storeoffersText = document.getElementById(inputId);

        /* Select the text field */
        storeoffersText.select();
        storeoffersText.setSelectionRange(0, 99999); /* For mobile devices */

        /* all the text inside the text field */
        navigator.clipboard.writeText(storeoffersText.value);

        /* Alert the copied text */
        alert("Copied the text: " + storeoffersText.value);
    }
</script>
 <!-- Script for copytoclipboard storeoffers End-->
   </body>
</html>
<?php
ob_end_flush();  // This is a code for php minifiers
?>