<?php session_start();
   require_once("./config/config.php");
   $offer_id = $_REQUEST['offer'];
   
   $sqlc = "SELECT * FROM banner_master  WHERE rowId='$offer_id'";
   
   $myq=$conn->query($sqlc);
   $mydar= $myq->fetchAll()  ;
   $rows_fou = $myq->rowCount();
   foreach($mydar as $rowcn) {
         
           $banner_path_discount = $rowcn['banner_path'];
                 $activestatus_discount = $rowcn['activestatus'];
                  $banner_discount = $rowcn['banner'];
                  $title_discount = $rowcn['title'];
                  $search_discount = $rowcn['search'];
   }
   
   $sqlcou="SELECT * FROM coupon WHERE short_title LIKE '%$search_discount%' OR full_title LIKE '%$search_discount%' ";
   $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 short_title LIKE '%$search_discount%' OR full_title LIKE '%$search_discount%'";
      $myquerycou_coupon=$conn->query($sqlcou_coupon);
      $mydaracou_coupon_company= $myquerycou_coupon->fetchAll()  ;
      
      $rows_foundcou_couponss = $myquerycou_coupon->rowCount();
   
   
   $sqlcou_offers="SELECT * FROM coupon WHERE short_title LIKE '%$search_discount%' OR full_title LIKE '%$search_discount%' AND coupon_code ='' ";
      $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 = 'discount-offer'";
   $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="discount-offer.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-->
      <!--All Coupons Offers Section Begin-->
      <?php include("./contentpages/discount_offer/discount_offer_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--> 
               <!--discount_offer_sidebar Begin--> 
               <?php include("./contentpages/discount_offer/discount_offer_sidebar.php"); ?>
               <!--discount_offer_sidebar End--> 
               <!--col-md-3 End--> 
               <!--col-md-9 Begin--> 
               <!--discount_offer Begin--> 
               <?php include("./contentpages/discount_offer/discount_offer.php"); ?>
               <!--discount_offer End-->
               <!--col-md-9 End--> 
               <div class="col-md-12">
                  <!--banner Footer-->
                  <?php    if(!empty($google_adar )){
                     echo $google_adar ;
                     }else{
                     echo ' <img src="admin/forms/'.$adimg4.'" alt="Horizontal Banner" title="Horizontal Banner" class="img-fluid rounded-3 mb-4">';
                     } ?>
               </div>
            </div>
            <!--row End--> 
         </div>
         <!--container End--> 
      </section>
      <!--Filters and showdetails Section End--> 
      <!--for more saving subscribe now Begin-->
      <?php include("./contentpages/common-files/hubspot.php"); ?>
      <!--for more saving subscribe now 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-->
      <!-- 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-->
      <!--copytoclipboard disacountall tab script Begin-->
      <script>
         function disacountall(inputId) {
             /* Get the text field */
         
             // Changed to get the Element by the parameter containing the ElementID
             var disacountallText = document.getElementById(inputId);
         
             /* Select the text field */
             disacountallText.select();
             disacountallText.setSelectionRange(0, 99999); /* For mobile devices */
         
             /* disacountall the text inside the text field */
             navigator.clipboard.writeText(disacountallText.value);
         
             /* Alert the copied text */
             alert("Copied the text: " + disacountallText.value);
         }
      </script>
      <!--copytoclipboard disacountall tab script End-->
      <!--copytoclipboard disacountcoupon tab script Begin-->
      <script>
         function disacountcoupon(inputId) {
             /* Get the text field */
         
             // Changed to get the Element by the parameter containing the ElementID
             var disacountcouponText = document.getElementById(inputId);
         
             /* Select the text field */
             disacountcouponText.select();
             disacountcouponText.setSelectionRange(0, 99999); /* For mobile devices */
         
             /* disacountcoupon the text inside the text field */
             navigator.clipboard.writeText(disacountcouponText.value);
         
             /* Alert the copied text */
             alert("Copied the text: " + disacountcouponText.value);
         }
      </script>
      <!--copytoclipboard disacountcoupon tab script End-->
      <!--copytoclipboard discountoffers tab script Begin-->
      <script>
         function discountoffers(inputId) {
             /* Get the text field */
         
             // Changed to get the Element by the parameter containing the ElementID
             var discountoffersText = document.getElementById(inputId);
         
             /* Select the text field */
             discountoffersText.select();
             discountoffersText.setSelectionRange(0, 99999); /* For mobile devices */
         
             /* discountoffers the text inside the text field */
             navigator.clipboard.writeText(discountoffersText.value);
         
             /* Alert the copied text */
             alert("Copied the text: " + discountoffersText.value);
         }
      </script>
      <!--copytoclipboard discountoffers tab script End-->
   </body>
</html>
<?php
ob_end_flush();  // This is a code for php minifiers
?>