<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
    <ul class="nav">
        <li  class="dropdown" id="profile-messages" >
            <?php
            $id_user = 0;
            $username = '';
            $nama_lengkap = '';
            $avatar = '';
            $session_user = $this->session->userdata('cbt_sess_pelaksana');
            if (is_array($session_user)) {
                $id_user = $session_user['id_user'];
                $username = $session_user['username'];
                $nama_lengkap = $session_user['nama_lengkap'];
                $avatar = $session_user['avatar'];
                $akses = $session_user['akses'];
            }

            $images = 'assets/uploads/user/' . $avatar;
            $images2 = 'assets/uploads/siswa/' . $avatar;

            if (file_exists($images)) {
                $user_img = base_url('assets/uploads/user/') . '/' . $avatar;
            } else if (file_exists($images2)) {
                $user_img = base_url('assets/uploads/siswa/') . '/' . $avatar;
            } else {
                $user_img = base_url('assets/images/') . '/defaultuser.png';
            }
            ?>
            <a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span class="text">Selamat datang <?php echo $nama_lengkap; ?></span><b class="caret"></b></a>
            <ul class="dropdown-menu">
                <li><a href="#"><i class="icon-user"></i> My Profile</a></li>
                <li class="divider"></li>
                <li><a href="<?php echo site_url('home/logout'); ?>"><i class="icon-key"></i> Log Out</a></li>
            </ul>
        </li>
        <li class=""><a title="" href="<?php echo site_url('home/logout'); ?>"><i class="icon icon-share-alt"></i> <span class="text">Logout</span></a></li>
    </ul>
</div>
<!--close-top-Header-menu-->