 <style type="text/css">
    .authclass .nav.sub-menu .nav-item::before{display: none; left:3%;}
     .authclass .nav.sub-menu .nav-item.active::before{display: block;}
 </style>
 <nav class="sidebar sidebar-offcanvas" id="sidebar">
        <?php 
        $menu_name = $this->uri->segment('2');
        $action    = $this->uri->segment('3');

        $menu_active   = "";
        $area_expend   = "false";
        $collapse_show = "";
        $collapse      = "collapsed";
        $page_active   = "";

        $active_add_user_page    = "";
        $active_manage_user_page = "";
        $collapse2 = "collapsed";
        $menu_active2   = "";
        $area_expend2   = "false";
        $collapse_show2 = "";
        $active_add_user_page_3    = "";
        $active_manage_user_page_3 = "";
        $collapse_3 = "collapsed";
        $menu_active_3   = "";
        $area_expend_3   = "false";
        $collapse_show_3 = "";
        
        if($menu_name == 'lock') {

            $menu_active   = "active";
            $area_expend   = "true";
            $collapse_show = "show";

            if($action == 'add') {
                $active_add_page = 'active';
            } elseif ($action == 'manage') {
                $active_manage_page = 'active';                
            }

        } elseif ($menu_name == 'user') {
            $menu_active2   = "active";
            $area_expend2   = "true";
            $collapse_show2 = "show";

            if($action == 'add') {
                $active_add_user_page = 'active';

            } elseif ($action == 'manage') {
                $active_manage_user_page = 'active';                
            }            
        }elseif ($menu_name == 'bridge') {
            $menu_active_3   = "active";
            $area_expend_3   = "true";
            $collapse_show_3 = "show";

            if($action == 'add') {
                $active_add_user_page_3 = 'active';

            } elseif ($action == 'manage') {
                $active_manage_user_page_3 = 'active';                
            }            
        }

        ?>

        <ul class="nav">

            <!-- Lock Section -->
            <li class="nav-item <?php echo @$menu_active; ?>" id ="menu_id_1">
                <a class="nav-link authclass <?php echo @$collapse; ?> " data-toggle="collapse"  href="#auth" aria-expanded="<?php echo @$area_expend; ?>" aria-controls="auth">
                  <i class="typcn typcn-mortar-board menu-icon"></i>
                  <span class="menu-title">Manage Lock</span>
                  <i class="menu-arrow"></i>
                </a>
                <div class="collapse authclass <?php echo @$collapse_show; ?> " id="auth">
                    <ul class="nav flex-column sub-menu">
                        <li class="nav-item <?php echo @$active_add_page; ?>"> <a class="nav-link" href="<?php echo base_url('admin/lock/add'); ?>"> Add Lock </a></li>
                        <li class="nav-item <?php echo @$active_manage_page; ?>"> <a class="nav-link" href="<?php echo base_url('admin/lock/manage'); ?>"> Manage Lock </a></li>
                  </ul>
                </div>
            </li>
            <!-- Bridge Section -->

            <li class="nav-item <?php echo @$menu_active_3; ?>" id ="menu_id_3">
                <a class="nav-link authclass <?php echo @$collapse_3; ?> " data-toggle="collapse" href="#auth3" aria-expanded="<?php echo @$area_expend_3; ?>" aria-controls="auth3">
                  <i class="typcn typcn-mortar-board menu-icon"></i>
                  <span class="menu-title">Manage Bridge</span>
                  <i class="menu-arrow"></i>
                </a>
                <div class="collapse authclass <?php echo @$collapse_show_3; ?> " id="auth3">
                    <ul class="nav flex-column sub-menu">
                        <li class="nav-item <?php echo @$active_add_user_page_3; ?>"> <a class="nav-link" href="<?php echo base_url('admin/bridge/add'); ?>"> Add Bridge </a></li>
                        <li class="nav-item <?php echo @$active_manage_user_page_3; ?>"> <a class="nav-link" href="<?php echo base_url('admin/bridge/manage'); ?>"> Manage Bridge </a></li>
                  </ul>
                </div>
            </li>    
            <!-- User Section -->
            <li class="nav-item <?php echo @$menu_active2; ?>" id ="menu_id_2">
                <a class="nav-link authclass <?php echo @$collapse2; ?> " data-toggle="collapse" href="#auth2" aria-expanded="<?php echo @$area_expend2; ?>" aria-controls="auth2">
                  <i class="typcn typcn-mortar-board menu-icon"></i>
                  <span class="menu-title">Manage User</span>
                  <i class="menu-arrow"></i>
                </a>
                <div class="collapse authclass <?php echo @$collapse_show2; ?> " id="auth2">
                    <ul class="nav flex-column sub-menu">
                        <li class="nav-item <?php echo @$active_add_user_page; ?>"> <a class="nav-link" href="<?php echo base_url('admin/user/add'); ?>"> Add User </a></li>
                        <li class="nav-item <?php echo @$active_manage_user_page; ?>"> <a class="nav-link" href="<?php echo base_url('admin/user/manage'); ?>"> Manage User </a></li>
                  </ul>
                </div>
            </li>    
             
        </ul>
      </nav>
