%PDF-1.4
Directory : /var/www/vhosts/lautnusantara.com/httpdocs/mis/app/Views/theme/BeyondAdmin/system/ |
<?php use App\Models\Menu_Model; $user_id = session()->get('user_id'); $username = session()->get('username'); $this->Menu_Model = new Menu_Model(); //if($username=='swalt'){ // $menu_data = $this->Menu_Model->get_menu(0)->getResultArray(); // } else { $menu_data = $this->Menu_Model->get_menu(0,$user_id)->getResultArray(); // } // $row = $menu_data->getRow(); ?> <ul class="nav sidebar-menu"> <?php foreach($menu_data as $data): ?> <!--Dashboard--> <li class="<?php if($data['id']==$id_menu){ echo 'active';} if($data['id']==$parent_id_menu){ echo 'open';}?>"> <a href="<?= $data['link'];?>" <?php if($data['have_child']==1){ echo 'class="menu-dropdown"';} ?>> <i class="menu-icon <?= $data['icon'];?>"></i> <span class="menu-text"> <?= $data['title'];?> </span> <?php if($data['have_child']==1){ echo '<i class="menu-expand"></i>'; } ?> </a> <?php if($data['have_child']==1){ echo '<ul class="submenu">'; $submenu_data = $this->Menu_Model->get_menu($data['id'],$user_id)->getResultArray(); foreach($submenu_data as $subdata): echo ' <li '; if($subdata['id']==$id_menu){ echo ' class="active"';} if($subdata['id']==$parent_id_menu || $subdata['id']==$parent_id_submenu){ echo 'class="open"';} echo '>'; echo ' <a href="'.$subdata['link'].'" '; if($subdata['have_child']==1){ echo 'class="menu-dropdown"';} echo '">'; if($subdata['icon']!=''){ echo ' <i class="menu-icon '.$subdata['icon'].' "></i>'; } echo ' <span class="menu-text">'.$subdata['title'].'</span>'; if($subdata['have_child']==1){ echo ' <i class="menu-expand"></i>'; } echo ' </a>'; //---- jika ada have_child level 3 ----- if($subdata['have_child']==1){ echo '<ul class="submenu">'; $submenu_data3 = $this->Menu_Model->get_menu($subdata['id'],$user_id)->getResultArray(); foreach($submenu_data3 as $subdata3): echo ' <li '; if($subdata3['id']==$id_menu){ echo ' class="active"';};echo '>'; echo ' <a href="'.$subdata3['link'].'">'; if($subdata3['icon']!=''){ echo ' <i class="menu-icon '.$subdata3['icon'].' "></i>'; } echo ' <span class="menu-text">'.$subdata3['title'].'</span>'; echo ' </a>'; echo ' </li>'; endforeach; echo '</ul>'; } //----- end of file level 3 ---- echo ' </li>'; endforeach; echo '</ul>'; } ?> </li> <?php endforeach; ?> </ul>