<!DOCTYPE html>
<html>
  <body class="skin-blue">
    <div class="wrapper">
      
      <header class="main-header">
        <!-- Logo -->
        <a href="dashboard.php" class="logo"><b>Admin</b>LTE</a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
          <!-- Sidebar toggle button-->
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
              <!-- Messages: style can be found in dropdown.less-->
              
              <!-- User Account: style can be found in dropdown.less -->
              <?php
              // fetch data using login session
                  if(isset($_SESSION['login_id']))
    			{
        			$slt3="select * from registration where login_session='".$_SESSION['login_id']."'";
        			$qry=mysqli_query($conn,$slt3);
        			if(mysqli_num_rows($qry))
        			{
        				$rw=mysqli_fetch_array($qry);
        				$name=$rw['user_name'];
        				$unique_id=$rw['unique_user_id'];
        				$date=explode(' ',$rw['created_date']);
						/*echo '<pre>';
						print_r($rw);
						die;*/
        			}
    			}
    			
    			//  fetch image
    			$slt4="select * from registration where unique_user_id='$unique_id' ";
               $connection=mysqli_query($conn,$slt4);
                  if(mysqli_num_rows($connection)>0)
                  {
                      while($rows2=mysqli_fetch_array($connection))
                      {
                          $result2=$rows2['images'];
                      }
                  }
                  //  fetch date 
                    $convert_date = strtotime($date['0']);
                    $month = date('F',$convert_date);
                    $date2=explode("-",$date['0']);

    			?>
              <li class="dropdown user user-menu">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <?php
                if($result2!='')
                {
                ?>
                    <img src="<?php echo $result2;?>" class="img-circle" style="width: 20px; height: 20px" alt="<?php echo $result2;?>1" />
                <?php
                }
                else
                {
                ?>
                    <img src="images/no-user-img.jpg" style="width: 20px; height: 20px" class="img-circle" alt="User Image" />
                <?php
                }
                ?>
                  &nbsp <span class="hidden-xs"><?php echo $name;?></span>
                </a>
                <ul class="dropdown-menu">
                  <!-- User image -->
                  <li class="user-header">
                    <?php
                if($result2!='')
                {
                ?>
                    <img src="<?php echo $result2;?>" class="img-circle" style="width: 80px; height: 80px" alt="<?php echo $result2;?>1" />
                <?php
                }
                else
                {
                ?>
                    <img src="images/no-user-img.jpg" class="img-circle" style="width: 80px; height: 80px" alt="User Image" />
                <?php
                }
                ?>
                    <p>
                      <?php echo $name;?>
                      <small><?php if(!EMPTY($rw['created_date'])){ echo $date2["0"]." ".$month." ".$date2["2"];}?></small>
                    </p>
                  </li>
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="profile.php" class="btn btn-default btn-flat">View</a>
                    </div>
                    <div class="pull-left" style="padding-left: 40px">
                      <a href="edit_list_user.php?id=<?php echo $unique_id;?>" class="btn btn-default btn-flat">Edit</a>
                    </div>
                    <div class="pull-right">
                      <a href="logout.php" class="btn btn-default btn-flat">Sign out</a>
                    </div>
                  </li>
                </ul>
              </li>
              
              
            </ul>
          </div>
        </nav>
      </header>