<?php
if($user_type_id==11){
$dashboardMenu = $this->dashboardMenu()->getStaffModule($user_id,$user_role_id);
}else{
$dashboardMenu = $this->dashboardMenu()->getDashboardModule($user_type_id);
}
//echo '<pre>';print_r($dashboardMenu);die();
?>

<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 203px;">

        <section class="sidebar">
            <!-- Sidebar user panel -->

            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">

                <?php if(isset($dashboardMenu)){
                foreach($dashboardMenu as $menu){
                      $menuUrl     = $menu['url'];
                      $icon_class  = $menu['icon_class'];
                      $moduleName = $menu['module_name'];
                      if($menu['url']!='' && $menu['action']!=''){
                            $href = $this->url($menu['url'], array('action' => $menu['action']));
                        }
                    ?>
                 <li>

                    <a href="<?php echo $href; ?>">
                        <i class="<?php echo $icon_class; ?>"></i> <span><?php echo $moduleName; ?></span>
                          <?php if(!empty($menu['submenu'])){ ?>
                         <i class="fa fa-angle-left pull-right"></i>
                          <?php } ?>

                    </a>

                    <?php if(!empty($menu['submenu'])){ ?>
			<ul class="treeview-menu">
                            <?php foreach($menu['submenu'] as $submenu){
                                 $href = '';
                                 $subiconClass = $submenu['icon_class'];
                                 $submoduleName = $submenu['module_name'];
                                 if($submenu['url']!='' && $submenu['action']!=''){
                                     $href = $this->url($submenu['url'], array('action' => $submenu['action']));
                                 }
                          ?>


                            <li><a href="<?php echo $href; ?>"><i class="<?php echo $subiconClass; ?>"></i> <span><?php echo $submoduleName; ?></span>
                                <?php if(!empty($submenu['submenu'])){ ?>
                                <i class="fa fa-angle-left pull-right"></i>
                                 <?php } ?>
                                </a>
                             
                                <?php if(!empty($submenu['submenu'])){ ?>
                                    <ul class="treeview-menu">
                                        <?php foreach($submenu['submenu'] as $subchildmenu){
                                         $href = '';
                                         $subiconClass = $subchildmenu['icon_class'];
                                         $submoduleName = $subchildmenu['module_name'];
                                         if($subchildmenu['url']!='' && $subchildmenu['action']!=''){
                                             $href = $this->url($subchildmenu['url'], array('action' => $subchildmenu['action']));
                                          }
                                        ?>
                                    <li><a href="<?php echo $href; ?>"><i class="<?php echo $subiconClass; ?>"></i> <span><?php echo $submoduleName; ?></span></a></li>
                                        <?php } ?>
                                    </ul>   
                              <?php }?>
                                
                            </li>

                         
                          <?php }?>
			</ul>
		<?php } ?>

                </li>
                <?php }} ?>


            </ul>
        </section>

    </div>
    <!-- /.sidebar -->
</aside>