
<?php 
 if (isset($_SESSION['user_id'])){
	 
	 function get_usergroup($user_id){
		global $con;//Variable de conexion
		$sql="select user_group.name from user_group, users where user_group.user_group_id=users.user_group_id and users.user_id='$user_id'";
		$query=mysqli_query($con,$sql);
		$user_group=mysqli_fetch_object($query);
		return $user_group->name;	
	}

?>
        <!-- Logo -->
        <a href="index.php" class="logo">
          <!-- mini logo for sidebar mini 50x50 pixels -->
          <span class="logo-mini"><b>POS</b></span>
          <!-- logo for regular state and mobile devices -->
          <span class="logo-lg"><b>Punto </b>de venta</span>
        </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">
             
              
              <!-- 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="dist/img/admin.png" class="user-image" alt="User Image">
                  <span class="hidden-xs"><?php echo $_SESSION['full_name'];  ?></span>
                </a>
                <ul class="dropdown-menu">
				
                  <!-- User image -->
                  <li class="user-header">
                    <img src="dist/img/admin.png" class="img-circle" alt="User Image">
                    <p>
						<?php echo $_SESSION['full_name']; ?>		
                      <small><?php echo get_usergroup($user_id);?></small>
                    </p>
                  </li>
                 
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-left">
                      
                    </div>
                    <div class="pull-right">
                      <a href="login.php?logout" class="btn btn-danger btn-flat"><i class='fa fa-power-off'></i> Salir</a>
                    </div>
                  </li>
                </ul>
              </li>
              
            </ul>
          </div>
        </nav>
	 <?php } ?>		