<?php session_start();
   require_once("./config/config.php");
   $coupon_id = ($_REQUEST['coupon_id']);
   
    $sqlcou="SELECT * FROM coupon WHERE rowId='$coupon_id' ";
                    $myquerycou=$conn->query($sqlcou);
      $mydaracou= $myquerycou->fetchAll()  ;
      
      $rows_foundcou = $myquerycou->rowCount();
    //var_dump($mydaracou);
   if($rows_foundcou=='0'){
           
           $status='active';
           
       }
   
            foreach( $mydaracou as $rowcou ){
              $rowId    = $rowcou["rowId"];
               $short_title   = $rowcou["short_title"];
               $full_title   = $rowcou["full_title"];
               $link = $rowcou["link"];
               $image   = $rowcou["image"];
               $exp_date = $rowcou["exp_date"];
               $google_addis  = $rowcon['google_addis'];
               $coupon_code   = $rowcou["coupon_code"];
               $category   = $rowcou["category"]; 
                $company_name   = $rowcou["company_name"];
            }
            $sql_tag = "SELECT * FROM meta_tag_setting WHERE pages = 'redeem'";
            $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'];
               }
            }
           // echo  $link ;

           // 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?>">
      <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="redeem.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 class="bg-light">
      <!--header Begin-->
      <header class="redeem-header">
         <div class="container">
            <div class="row">
               <div class="col-md-12">
                  <a href="index" class="redeem-logo">
                  <?php      $sql = "SELECT company_logo FROM admin_master ";
                     $myquery=$conn->query($sql);
                     $mydara= $myquery->fetchAll()  ;
                     
                     $rows_found = $myquery->rowCount();
                     foreach ($mydara as $key ) {
                     
                      $company_logo = $key['company_logo'];
                      
                           
                     } ?>
                  <img src="images/web-images/logo/<?=$company_logo?>" alt="logo" title="logo" class="img-fluid">
                  </a>
               </div>
            </div>
         </div>
      </header>
      <!--header End-->
      <!--main Begin-->
      <main>
         <section class="ptb-100">
            <div class="container">
               <div class="row">
                  <div class="col-lg-12">
                     <!--code-successfully-copied-->
                     <div class="code-successfully-copied">
                        <h1 class="text-primary">
                        <i class="fas fa-check-circle pe-2"></i>
                        <span class="h5">Code Successfully Copied!</span>
                      </h1>
                        <p class="paste-code-txt">Paste this code on checkout & carry on shopping</p>
                        <p class="go-coupon"><?=$coupon_code?></p>
                        <div class="opening">
                           <span><img src="images/web-images/home/opening.gif" alt="opening" title="opening" class="img-fluid pe-2" width="30">Opening <?=$company_name ?>...</span>
                        </div>
                     </div>
                     <a class="text-muted text-center d-block" href="./index">Go Back</a>
                  </div>
                  <div class="col-md-12">
                     <?php    if(!empty($google_adar )){
                        echo $google_adar ;
                        }else{
                        echo ' <img src="admin/forms/'.$adimg4.'" alt="banner" class="img-fluid w-100 rounded-3 mt-4 mb-4">';
                        } ?>
                  </div>
                  <div class="col-md-12">
                  <?=$google_addis?>
                  </div>
               </div>
            </div>
         </section>
      </main>
      <!--main 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-->
      <!--function mystore js Begin-->
      <script>
         const myTimeout = setTimeout(mystore, 5000);
         function mystore() {
            document.ready(window.setTimeout(location.href = "<?=$link?>"));
         }
      </script>
      <!--function mystore js End-->
   </body>
</html>
<?php
ob_end_flush();  // This is a code for php minifiers
?>