<?php $sqlcou_coupon="SELECT DISTINCT(category) FROM coupon WHERE category!='' ORDER BY rand()  LIMIT 10";
   $myquerycou_coupon=$conn->query($sqlcou_coupon);
   $mydaracou_coupon= $myquerycou_coupon->fetchAll()  ;
   
   $rows_foundcou_coupon = $myquerycou_coupon->rowCount();
   
   
   $sqlc = "SELECT * FROM banner_master  WHERE slider_type='discount_banner' AND activestatus='1'  ORDER BY rand() LIMIT 3";
   
    $myq=$conn->query($sqlc);
   $mydar= $myq->fetchAll()  ;
   
   $rows_fou = $myq->rowCount();
   
   
   $sqlcompany = "SELECT * FROM coupon ORDER BY rand() LIMIT 3 ";
   
    $myqcompany=$conn->query($sqlcompany);
   $mydarcompany= $myqcompany->fetchAll()  ;
   
   $rows_foucompany = $myqcompany->rowCount();
   
   
   $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'];
     
         
   }
   
   
   ?> 
 <style type="text/css">
	.goog-te-banner-frame.skiptranslate {display: none!important;} 
.goog-logo-link {
    display:none !important;
} 
    
.goog-te-gadget {
    color: transparent !important;
}

.goog-te-banner-frame.skiptranslate {
display: none !important;
} 
body {top: 0px!important;}
.VIpgJd-ZVi9od-ORHb-OEVmcd  {
  visibility: hidden !important;
}
</style>             
<header>
   <!--hide on screens smaller than lg-->
   <div class="d-none d-lg-block fixed-top bg-white">
      <div class="py-3">
         <div class="container">
            <div class="row g-4 g-lg-5 align-items-center">
               <div class="col-2">
                  <!--icouponworld-logo-->
                  <a href="index">
                  <img src="images/web-images/logo/<?=$company_logo?>" alt="logo" title="logo" class="img-fluid"></a>
               </div>
               <div class="col-8">
                  <!--Search for brands, categories -->
                  <div class="input-group"  data-bs-toggle="modal" data-bs-target="#searchModal">
                     <span class="input-group-text bg-smoke-white" id="basic-addon1">
                        <svg xmlns="http://www.w3.org/2000/svg" width="18" height="17" viewBox="0 0 18 17">
                           <path fill="#888" d="M7.44412,0 C3.89304889,0 1,3.04362024 1,6.77956734 C1,10.5155004 3.89304444,13.5591417 7.44412,13.5591417 C8.97992889,13.5591417 10.3906356,12.9879695 11.4994711,12.0395771 L15.8603644,16.6274712 C16.1206778,16.9013327 16.5444311,16.9013561 16.80476,16.6274712 C17.0650867,16.3535863 17.0650867,15.9150898 16.80476,15.6412283 L12.4438689,11.0533342 C13.3471556,9.88618462 13.88824,8.39712964 13.88824,6.77956734 C13.88824,3.04362024 10.9951933,0 7.44412,0 Z M7.44412,1.40266959 C10.2746378,1.40266959 12.5549733,3.8016865 12.5549733,6.77956734 C12.5549733,9.75741311 10.2746333,12.1564721 7.44412,12.1564721 C4.61360667,12.1564721 2.33326667,9.75741311 2.33326667,6.77956734 C2.33326667,3.8016865 4.61360222,1.40266959 7.44412,1.40266959 Z" transform="rotate(-3 9 8.416)"></path>
                        </svg>
                     </span>
                     <input type="text" class="form-control bg-smoke-white" placeholder="Search for brands, categories">
                  </div>
               </div>
               <div class="col-2">
                  <div class="d-flex float-end">
                     <!--Login / SignUp-->
                     <?php if($_SESSION[ADD_TAG.'_UserId_vendor']!=''){
                        ?>
                     <a href="merchant-profile" class="btn btn-primary">My Account</a>
                     <?php }elseif($_SESSION[ADD_TAG.'_UserId_user']!=''){ ?>
                     <a href="user-profile" class="btn btn-primary">My Account</a>
                     <?php    } else{ ?>
                     <a href="login-role/user" class="btn btn-primary">Login / SignUp</a>
                     <?php   }?>
                  </div>
               </div>
            </div>
         </div>
      </div>
      <!--Navbar Begin-->
      <nav class="navbar navbar-expand-lg navbar-dark bg-smoke-white border-top-1">
         <div class="container">
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mynavbar">
            <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="mynavbar">
               <!--navbar-nav left-->
               <ul class="navbar-nav me-auto">
               <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="brand" href="brand">Brand</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Categories" href="categories">Categories</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Coupons" href="coupon">Coupons</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Product" href="product">Product</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Stores" href="stores">Stores</a>
                  </li>
                 
                 
                 
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" target="_blank" title="Blog" href="blog">Blog</a> <span class="me-1 badge bg-secondary rounded-0">New</span>
                  </li>
               </ul>
               <!--navbar-nav Right-->
               <ul class="navbar-nav ms-auto">
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Become a partner" href="login-role/merchant">Become a partner</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link hvr-underline-from-center" title="Deals Of The Day" href="deals-of-the-day">Deals Of The Day</a>
                  </li>
                  <!-- <li class="nav-item">
                  <div id="google_translate_element" class="p-1 hvr-underline-from-center"></div>
                  </li> -->
               </ul>
            </div>
         </div>
      </nav>
   </div>
   <!--Navbar End-->
   <!--hide on lg and wider screens-->
   <div class="d-lg-none shadow-sm py-3 fixed-top bg-white">
      <!--mySidenav-->
      <div id="mySidenav" class="sidenav shadow-sm">
         <ul class="list-unstyled p-0 m-0">
            <li> <a href="#" class="bg-secondary closebtn" onclick="closeNav()"><i class="fas fa-times"></i></a></li>
            <li>
               <div class="bg-secondary d-flex align-items-center px-3 py-4">
                  <div class="w-50"><img src="images/banners/login-banner.png" alt="login-banner" title="login-banner" class="img-fluid"></div>
                  <div class="w-50 text-center">
                     <p class="text-white fs-12">Grab Best</p>
                     <p class="text-white fs-12"> Coupons & Deals</p>
                     
                     <p> <?php if($_SESSION[ADD_TAG.'_UserId_vendor']!=''){
                        ?>
                     <a href="merchant-profile" class="text-white pt-2 p-0 text-decoration-underline">My Account</a>
                     <?php }elseif($_SESSION[ADD_TAG.'_UserId_user']!=''){ ?>
                     <a href="user-profile" class="text-white pt-2 p-0 text-decoration-underline">My Account</a>
                     <?php    } else{ ?>
                     <a href="login-role/user" class="text-white pt-2 p-0 text-decoration-underline">Login / SignUp</a>
                     <?php   }?></p>
                  </div>
               </div>
            </li>
            <li> <a title="Stores" href="stores">Stores</a></li>
            <li> <a title="Categories" href="categories">Categories</a></li>
            <li> <a title="Coupons" href="coupon">Coupons</a></li>
            <li> <a title="product" href="product">Product</a></li>
            <li> <a title="Blog" target="_blank" href="blog">Blog <span class="ms-2 badge bg-secondary rounded-0">New</span></a></li>
            <li>
               <div class="divider my-2"></div>
            </li>
            <li> <a title="Become a partner" href="login-role/merchant">Become a partner</a></li>
            <li> <a title="Deal Of The Day" href="deals-of-the-day">Deal Of The Day</a></li>
            <li> <a title="Contact us" href="contact">Contact us</a></li>
         </ul>
      </div>
      <div class="container">
         <div class="row align-items-center">
            <div class="col-12">
               <span>
               <span onclick="openNav()"><i class="fs-20 fas fa-bars"></i></span>
               <img src="images/web-images/logo/<?=$company_logo?>" alt="logo" title="logo" class="img-fluid ms-2">
               </span>
               <span class="float-end">
                  <svg  data-bs-toggle="modal" data-bs-target="#searchModal" xmlns="http://www.w3.org/2000/svg" width="18" height="17" viewBox="0 0 18 17">
                     <path fill="#888" d="M7.44412,0 C3.89304889,0 1,3.04362024 1,6.77956734 C1,10.5155004 3.89304444,13.5591417 7.44412,13.5591417 C8.97992889,13.5591417 10.3906356,12.9879695 11.4994711,12.0395771 L15.8603644,16.6274712 C16.1206778,16.9013327 16.5444311,16.9013561 16.80476,16.6274712 C17.0650867,16.3535863 17.0650867,15.9150898 16.80476,15.6412283 L12.4438689,11.0533342 C13.3471556,9.88618462 13.88824,8.39712964 13.88824,6.77956734 C13.88824,3.04362024 10.9951933,0 7.44412,0 Z M7.44412,1.40266959 C10.2746378,1.40266959 12.5549733,3.8016865 12.5549733,6.77956734 C12.5549733,9.75741311 10.2746333,12.1564721 7.44412,12.1564721 C4.61360667,12.1564721 2.33326667,9.75741311 2.33326667,6.77956734 C2.33326667,3.8016865 4.61360222,1.40266959 7.44412,1.40266959 Z" transform="rotate(-3 9 8.416)"></path>
                  </svg>
               </span>
            </div>
         </div>
      </div>
   </div>
   <!-- search modal-fullscreen Begin-->
   <div class="modal" id="searchModal">
      <div class="modal-dialog modal-fullscreen">
         <div class="modal-content">
            <div class="container">
               <div class="row">
                  <!-- Modal Header -->
                  <div class="modal-header border-0">
                     <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                  </div>
                  <!-- Modal body -->
                  <div class="modal-body">
                     <div class="pt-3">
                        <!--form-control-lg-search-->
                        <form action="./forms/search.php" method="post">
                           <div class="input-group">
                              <input type="text" class="form-control form-control-lg form-control-lg-search" name="search" placeholder="Search for stores, coupons & offers...">
                              <input type="submit" class="hs-button btn btn-primary primary large" value="Submit">
                           </div>
                        </form>
                        <p class="text-muted text-end pt-2">What do you want to search today?</p>
                        <!--Trending Now-->
                        <div class="row  ptb-50">
                           <div class="trending-now bottom-line">
                              <h6 class="mb-4">Trending Now</h6>
                              <ul class="list-unstyled">
                                 <?php  foreach( $mydaracou_coupon as $rowcou ){
                                    $category   = $rowcou["category"]; 
                                    
                                    $category_array =explode(",",$category);
                                   // var_dump($category_array);
                                    foreach($category_array as $row){
                                       $row = str_replace(" ","-",$row);
                                       $row = str_replace("'","",$row);
                                       $row = strtolower($row);
                                    ?>
                                 <li>
                                    <a href="./research/<?=($row)?>"  title="<?=$category?>"><?=$row?></a>
                                 </li>
                                 <?php } } ?>
                              </ul>
                           </div>
                        </div>
                        <hr>
                        <!--hide on lg and wider screens Begin-->
                        <div class="d-lg-none">
                           <div class="row ptb-50 ">
                              <!--Hottest Now-->
                              <div class="col-md-7">
                                 <div class="bottom-line">
                                    <h6 class="mb-4">Hottest Now</h6>
                                 </div>
                                 <div class="row">
                                    <ul class="list-unstyled">
                                       <?php  foreach( $mydar as $rowcon ) {
                                          $rowId = $rowcon['rowId'];
                                          $banner_path = $rowcon['banner_path'];
                                            $activestatus = $rowcon['activestatus'];
                                             $banner = $rowcon['banner'];
                                             $title = $rowcon['title'];
                                           $activestatus_ch='';
                                            if($banner==1){
                                              $activestatus_ch='active';
                                            }
                                          
                                           ?>
                                       <li>
                                          <div class="rounded-box mb-3">
                                             <div class="d-flex align-items-center">
                                                <div class="flex-shrink-0">
                                                   <img alt="<?=$title?>" title="<?=$title?>" src="<?=$banner_path?>" class="img-fluid merchant-logo">
                                                </div>
                                                <div class="flex-grow-1 pt-1 ms-5">
                                                   <h3 title="<?=$title?>" class="fs-12 mb-2 fw-bold text-truncate">
                                                      <?=$title?>
                                                   </h3>
                                                </div>
                                                <span class="icons-circle"></span>
                                             </div>
                                          </div>
                                       </li>
                                       <?php } ?>
                                    </ul>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!--hide on lg and wider screens End-->
                        <!--hide on screens smaller than lg Begin-->
                        <div class=" d-none d-lg-block">
                           <div class="row ptb-50">
                              <!--Hottest Now-->
                              <div class="col-md-7">
                                 <div class="bottom-line">
                                    <h6 class="mb-4">Hottest Now</h6>
                                 </div>
                                 <div class="row">
                                    <?php  foreach( $mydar as $rowcon ) {
                                       $rowId = $rowcon['rowId'];
                                       $banner_path = $rowcon['banner_path'];
                                         $activestatus = $rowcon['activestatus'];
                                          $banner = $rowcon['banner'];
                                          $title = $rowcon['title'];
                                        $activestatus_ch='';
                                         if($banner==1){
                                           $activestatus_ch='active';
                                         }
                                       
                                        ?>
                                    <div class="col-md-4">
                                       <div class="featured">
                                          <a class="text-decoration-none"  href="./discount-off/<?=($rowId)?>" target="_blank">
                                             <img src="<?=$banner_path?>" class="img-fluid shadow-default rounded-3 mb-2" alt="<?=$title?>" title="<?=$title?>">
                                             <img src="images/merchant/amazon-logo.jpg" class="img-fluid merchant-logo mb-2" alt="<?=$title?>" title="<?=$title?>">
                                             <h3 title="<?=$title ?>" class="h6 mb-2 fw-bold text-truncate">
                                                <?=$title ?>
                                             </h3>
                                             <p class="text-muted py-1 d-para">Today's Deals Of The Day - Up to 90% OFF On Products</p>
                                             <small title="See All Amazon Offers"  class="fs-12">See All Amazon Offers</small>
                                          </a>
                                       </div>
                                    </div>
                                    <?php } ?>
                                 </div>
                              </div>
                              <!-- Featured Deal-->
                              <div class="col-md-5">
                                 <div class="bottom-line">
                                    <h6 class="mb-4">Featured Deal</h6>
                                 </div>
                                 <div class="featured-deal">
                                    <ul class="list-unstyled">
                                       <?php   foreach( $mydarcompany as $rowcn) {
                                          $full_title_search  = $rowcn['full_title'];
                                           $short_title_search  = $rowcn['short_title'];
                                            $company_name_search  = $rowcn['company_name'];
                                            $image  = $rowcn['image']; 
                                             $rowId_search  = $rowcn['rowId']; 
                                          
                                            ?> 
                                       <li class="mb-4">
                                          <a class="text-decoration-none" href="#">
                                             <div class="d-flex shadow-default p-2">
                                                <div class="flex-shrink-0">
                                                   <?php     if (!filter_var($image, FILTER_VALIDATE_URL) === false) { ?>
                                          <a class="text-decoration-none" href="redeem-id/<?=($rowId_search)?>">
                                          <img title="<?=$company_name_search ?>" src="<?=$image?>" class="img-fluid rounded-3" alt="..."></a>
                                          <?php  } else { ?>
                                          <a class="text-decoration-none" href="redeem-id/<?=($rowId_search)?>">
                                          <!-- <img src="images/merchant/myntra-logo.jpg" alt="Avatar" class="w-100 img-fluid store-overlay"> -->
                                          <span title="<?=$company_name_search ?>" class="p-store text-truncate"><?=$company_name_search ?></span>
                                          </a>
                                          <?php } ?>
                                          </div>
                                          <div class="d-grid ms-3">
                                          <h3 title=" <?=$short_title_search?>" class="h6 mb-2 fw-bold  text-truncate">
                                          <?=$short_title_search?>
                                          </h3>
                                          <p title="<?=$full_title_search?>" class="text-default d-para"> <?=$full_title_search?></p>
                                          </div>
                                          </div>
                                          </a>
                                       </li>
                                       <?php } ?>
                                    </ul>
                                    </ul>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <!--hide on screens smaller than lg End-->
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
   <!-- search modal-fullscreen End-->
</header>