<?php
    // เช็ค session ในการเช้าสู่ระบบ
    if(! $_SESSION['user_id']){
            $path = site_url()."/Login/show_login";
            header("Location: ".$path);     
            exit();
    }
?>
<nav class="main-header navbar navbar-expand-md navbar-light navbar-white">
	<div class="container">
	<span class="brand-text font-weight-light">Online Exhibition</span>
	</a>
	<button class="navbar-toggler order-1" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
	<span class="navbar-toggler-icon"></span>
	</button>
	<div class="collapse navbar-collapse order-3" id="navbarCollapse">

	<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>
      <div class="dropdown-divider"></div>
      <a href="<?php echo site_url() . '/Login/logout'; ?>" class="dropdown-item dropdown-footer">Logout</a>
      </div>
    </li>
  </ul>
	</div>
</nav>

