<nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
                <a class="navbar-brand" href="#">Online Examination</a>
            </div>
            <div id="navbar" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                <?php foreach($menu as $item): ?>
                    <?php if($item->type=='dropdown'): ?>
                        <li class="dropdown <?= ($item->active)? 'active':''?>">
                            <a href="javascript:void()" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            <?= $item->link->page_label ?> <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                            <?php foreach($item->childLinks as $childLink): ?>
                                <li><a href="<?= base_url().$childLink->page_url; ?>"><?= $childLink->page_label; ?></a></li>
                            <?php endforeach; ?>
                            </ul>
                        </li>
                    <?php endif; ?>
                    <?php if($item->type=='link'): ?>
                        <li class="<?= ($item->active)? 'active':''?>"><a href="<?= base_url().$item->link->page_url; ?>"><?= $item->link->page_label ?></a></li>
                    <?php endif; ?>
                <?php endforeach; ?>
                </ul>
                <!--right navbar-->
                <?php if($this->auth->user()): ?>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Notifications <span class="badge">42</span><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">User 1 requests for the approval of particular action.</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#">User 2 changed the name of <strong>term A</strong> to </strong>term B</strong>.</a></li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?= $this->auth->userFullName(); ?><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="<?= base_url('profile') ?>">Profile</a></li>
                            <li role="separator" class="divider"></li>
                            <?php 
                            if($this->auth->allowed_page_access('settings')):
                            ?>
                            <li><a href="<?= base_url('settings') ?>">Settings</a></li>
                            <li role="separator" class="divider"></li>
                            <?php
                            endif;
                             ?>
                            <li><a href="<?= base_url('logout') ?>">Logout</a></li>
                        </ul>
                    </li>
                </ul>
            <?php endif; ?>
            </div>
            <!--/.nav-collapse -->
        </div>
    </nav>
