
<?php 
$id_user='';
$fname='';
$address='';
$number='';

   if (isset($_SESSION['customers_id'])) {
    $id_user=$_SESSION['customers_id'];
    $sql = "SELECT * FROM customers WHERE customer_id='$id_user' ";
    $result=mysqli_query($conn,$sql);
        $row=mysqli_fetch_array($result);
        $fname=$row['fname'];
        $cus_id=$row['customer_id'];
        $number=$row['number'];
        $address=$row['location'];
        $log='Logout';
        $bg='btn-success';
    $link='online_logout';
    $pro_link='online_profile';

   }
   else{
    $log='Login';
    $bg='btn-primary';
    $link='online_login';
    $pro_link='online_login';
   }
   

   if ($page!='online orders') {
    $search='none';
   }
   else{
    $search='block';
   }
   

?>

                    <!---Tittle bar-->
      
                     
                     
                     <?php 
if (!empty($_SESSION['cart'])) {

      $arr=count($_SESSION['cart']);
}
else {
    $arr="0" ;
}

?>                
    
        
              

                  <!--end tittle bar-->


    <nav class=" fixed-top container ">
    <div class=" tit m-0 ">
    <h4 class="text-white"><img  style="width: 50px;" src="logo/<?php echo $store_image ?>" alt="store logo" srcset=""> <?php echo $store_name ?></h4>
  <div class="container-fluid  p-1">
 
    <div class="row no-gutters ">
        <div style="display: <?php echo $search?>;" class="order col-sm-4  col-12">
            <div class="d-flex flex-nowrap">
                
                <input  type="text" id="quicksearch" class="form-control " placeholder="Search product" >
                <span class="input-group-text" id="addon-wrapping"><i class="bi bi-search"></i></span>
              </div>
          </div>

          <div class="col-sm-8">
          <div class="container d-flex justify-content-end">
    <div class="row nav_top ">
      <div class="col-3 text-center">
        <a class="btn btn-outline-light " href="online_order"><i class="fa fa-home" ></i> Home</a>
      </div>
      <div class="col-3 text-center">
      <a class="btn btn-outline-light  " href="online_profile"><i class="fa fa-user"></i>Profile</a>
      </div>
      <div class="col-3 text-center">
      <a class="btn btn-outline-light " href="track_order"><i class="fa fa-history" ></i>History</a>
      </div>
      <div class="col-3 text-center">
      <a class="btn <?php echo $bg?> " href="<?php echo $link?>"><?php echo $log?></a>
      </div>
    </div>
  </div>
          </div>
        <div style="font-size: 15px;" class="col-12  d-flex  justify-content-end">
           <div class="user d-flex  p-0">
              <span style="display: " class="text-white text-uppercase mx-3  "   aria-expanded="false"><i class="bi bi-person-check"></i>Hi, <?php echo $fname?></span>
           
            <span class="text-white mx-0 refreeshme"><a class="text-white" href="online_carts"><b><i class="bi bi-cart"></i> <?php echo $arr ?></b></a></span>
           </div>
        </div>

    </div>
  </div>
</div>
    </nav>  
  

<div class="pad ">

</div>
<script>

   $(document).ready(function(){
setInterval(function(){
      $(".refreeshme").load(window.location.href + " .refreeshme" );
}, 3000);
});
 
</script>