<?php
$this->session = \Config\Services::session();
#Highlight active pages
$settingStyle = $helpStyle = "";
$class = "";
if (!empty($page)) {
    if ($page=='my_settings') {
        $settingStyle = "";
        $class = " active";
    } elseif ($page=='help') {
        $helpStyle = "";
    }
}
?>

<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-white border-bottom">
    <div class="container-fluid d-flex justify-content-between">
        <a class="navbar-brand" href="<?php echo base_url()."/" .get_user_dashboard($this, $this->session->get('__user_id'));?>">
            <img src="<?php echo base_url();?>/assets/images/tmis-logo.svg" alt="TMIS logo" width="auto" height="50">
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse w-auto" id="navbarSupportedContent">
            <ul class="navbar-nav ms-auto me-0 mb-2 mb-lg-0 d-flex align-items-center">
                <li class="nav-item line-clamp-2">
                    <?php echo $this->session->get('__first_name').", ".$this->session->get('__last_name')." (".$this->session->get('__permission_group_name').") ";?>
                </li>
                <li class="nav-item me-3">
                    <i class="bi bi-person-fill"></i>
                    <a href="<?php echo base_url();?>/Profile/user_data" <?php echo $settingStyle;?> class="text-decoration-none text-body fst-normal fw-normal">My Settings</a>
                </li>
                <li class="nav-item">
                    <i class="bi bi-lock-fill"></i>
                    <a href="<?php echo base_url();?>/Account/logout" class="text-decoration-none text-body fst-normal fw-normal">Log Out</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<nav class="navbar fixed-top navbar-expand-lg bg-primary border-bottom border-light top-name">
    <div class="container-fluid d-flex justify-content-between">
        <div class="text-white d-none d-sm-block">TEACHER MANAGEMENT INFORMATION SYSTEM</div>
        <button id="btn-menu">
            <span></span>
        </button>
        <a href="<?php echo base_url();?>/Message/send_new_system" <?php echo $helpStyle;?> class="text-decoration-none text-white fst-normal fw-normal">Help</a>
    </div>
</nav>
<nav class="navbar navbar-expand-lg bg-primary d-none d-md-block d-lg-none">
    <div class="container-fluid d-flex justify-content-between">
        <a href="<?php echo base_url();?>/Message/send_new_system" class="text-decoration-none text-body fst-normal fw-normal" <?php echo $helpStyle;?>>Help</a>
        <a href="<?php echo base_url();?>/Profile/user_data" class="text-decoration-none text-body fst-normal fw-normal" <?php echo $settingStyle;?>>My Settings</a>
        <a href="<?php echo base_url();?>/Account/logout"  class="text-decoration-none text-body fst-normal fw-normal">Log Out</a>
    </div>
</nav>