<?php
    // เช็ค session ในการเช้าสู่ระบบ
    if($_SESSION['user_id'] == ''){
            $path = site_url()."/Login/show_login";
            header("Location: ".$path);     
            exit();
    }
?>
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light navbar-fixed">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
    </li>
  </ul>
  <ul class="navbar-nav ml-auto">
    <li class="nav-item dropdow">
      <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true"><?php echo $_SESSION['first_name'].' '.$_SESSION['last_name']  ?></a>
      <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right" style="left: inherit; right: 0px;">
        <span class="dropdown-header">Setting</span>
      <div class="dropdown-divider"></div>
      <a href="#" class="dropdown-item">
        <!-- <i class="fas fa-envelope mr-2"></i>  -->
          Change Password
      </a>
      <div class="dropdown-divider"></div>
      <a href="<?php echo site_url() . '/Login/logout'; ?>" class="dropdown-item dropdown-footer">Logout</a>
      </div>
    </li>
  </ul>
</nav>
