<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <?php 
  $logos = $this->my_model->select_data('*' , 'logo_settings','','','');
  if(!empty($logos)){
      $logo_img = $logos[0]['logoImage'];
      $urlimg = base_url()."assets/uploads/".$logo_img;
      $logo_title = $logos[0]['logoTitle'];
      if(!empty($title)){
      echo "<title>".$logo_title." ".$title."</title>";
      }else{
      echo "<title>$logo_title</title>";
      }
      echo "<link rel='icon' href='$urlimg' type='image/gif' >";
  }else{
      echo "<title>Home Delivery</title>";
      echo '<link rel="icon" href="<?php echo base_url(); ?>assets/images/logo.png" type="image/gif" >';
  }
 
  ?>

  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 4 -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
  <!-- toastr v 2.1.3-->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/toastr.css">
  <!-- Font Awesome 4.7.0 -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/font-awesome.min.css">
  
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/daterangepicker.css">
  
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap-datepicker.min.css">
  <!-- Ionicons 2.0-->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/ionicons.min.css">
  <!-- select2 4.0.5 -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/select2.min.css">
  <!-- dataTables.bootstrap 4 -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/dataTables.bootstrap4.min.css">
  <!-- jQuery UI - v1.12.1  -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery-ui.min.css">
  <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/responsive.bootstrap.min.css"/>
  
  <!-- Google Fonts -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/fonts.css">
 
  <!-- Admin style -->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/styles.css">
  <script> var base_url = "<?php echo base_url(); ?>"; </script>
  <input type="hidden" value="<?php echo base_url();?>" id="base_url"> 
  
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Preloader Box -->
<div class="preloader">
	<div class="status">
		<img src="<?php echo base_url(); ?>/assets/images/pre_loader.gif" alt="loader">
	</div>
</div>
<div class="wrapper">

    <?php 
    if(isset($_SESSION['USERS_DATA'])){
        
    	$userData = $_SESSION['USERS_DATA'];
    	$user_id = $userData['userId'];	
    	$userRole = $userData['userType'];	
    	
    	
    }  
    ?>
    <header class="main-header">
        <!-- Logo -->
           <?php 
      $logos = $this->my_model->select_data('*' , 'logo_settings','','','');
      $users = $this->my_model->select_data('*' , 'users',array( 'userId' =>$user_id),'','');
      
      if(!empty($logos)){
         
          $header_logo = $logos[0]['headerLogo'];
          ?>
          <a href="<?php echo base_url('dashboard'); ?>" class="logo">
              <span class="logo-mini"><img src="<?php echo base_url('assets/uploads/').$header_logo; ?>"></span>
              <span class="logo-lg"><img src="<?php echo base_url('assets/uploads/').$header_logo; ?>"></span>
          </a>
          <?php
      }else{
          ?>
          <a href="<?php echo base_url('dashboard'); ?>" class="logo">
              <span class="logo-mini"><img src="<?php echo base_url(); ?>/assets/images/fav.svg"></span>
              <span class="logo-lg"><img src="<?php echo base_url(); ?>/assets/images/header-logo.svg"></span>
          </a>
          <?php
         
      }
      ?>
        
        <nav class="navbar navbar-static-top">
          <!-- Sidebar toggle button-->
          <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <div class="navbar-custom-menu">
    	
            <ul class="nav navbar-nav">         
              <!-- User Account: style can be found in dropdown.less -->
              <li class="dropdown user user-menu">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  <img src="<?php echo base_url('assets/'); if(!empty($users[0]['userImage'])){ echo "uploads/users/".$users[0]['userImage'];}else{ echo "images/user.jpg";}?>" class="user-image" >
    			  <?php if(!empty($users[0]['userName'])){ ?>
    				<span class="hidden-xs"><?php echo $users[0]['userName']; ?></span>
    			  <?php } ?>
                </a>
                <ul class="dropdown-menu"> 
                  <!-- User image --> 
                  <li class="user-header">
                    <img src="<?php echo base_url('assets/'); if(!empty($users[0]['userImage'])){ echo "uploads/users/".$users[0]['userImage'];}else{ echo "images/user.jpg";}?>" class="img-circle" >
    					<?php if(!empty($users[0]['userName'])){ ?>
    						<p><?php echo $users[0]['userName']; ?></p>
    					<?php } ?>
                  </li>              
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="<?php echo base_url('admin'); ?>" class="btn btn-block btn-primary btn-flat">Profile</a>
                    </div>
                    <div class="pull-right">
                      <a href="<?php echo base_url('login/logout'); ?>" class="btn btn-block btn-primary btn-flat">Sign out</a>
                    </div>
                  </li>
                </ul>
              </li>
              
            </ul>
          </div>
        </nav>
    </header>