<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<div class="page-sidebar-wrapper">
		<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
		<!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
		<div class="page-sidebar navbar-collapse collapse">
			<!-- BEGIN SIDEBAR MENU -->
			<!-- DOC: Apply "page-sidebar-menu-light" class right after "page-sidebar-menu" to enable light sidebar menu style(without borders) -->
			<!-- DOC: Apply "page-sidebar-menu-hover-submenu" class right after "page-sidebar-menu" to enable hoverable(hover vs accordion) sub menu mode -->
			<!-- DOC: Apply "page-sidebar-menu-closed" class right after "page-sidebar-menu" to collapse("page-sidebar-closed" class must be applied to the body element) the sidebar sub menu mode -->
			<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
			<!-- DOC: Set data-keep-expand="true" to keep the submenues expanded -->
			<!-- DOC: Set data-auto-speed="200" to adjust the sub menu slide up/down speed -->
			<ul class="page-sidebar-menu " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200">
				<?php
                $varmenu = '';
                foreach($permissaomenu->getResult() as $menu){
                    if($menu->LINK==substr($_SERVER["REQUEST_URI"],1)){$active = ' class="active"';}else{$active = '';}
                    $varmenu = $varmenu.'
                    <li '.$active.' editarativo>';
                        $varmenu = $varmenu.'<a href="'.base_url().$menu->LINK.'">';
                        $varmenu = $varmenu.'<i class="'.$menu->ICONE.'"></i>
                            <span class="title">'.$menu->DESCRICAO.'</span>';
                            if(count($menu->submenu->getResult())>0){
                                $varmenu = $varmenu.'<span class="arrow">
                                </span>';
                            }
                            $varmenu = $varmenu.' </a>
                        ';
                        if(count($menu->submenu->getResult())>0){
                            
                            $varmenu = $varmenu.'<ul class="sub-menu">';
                                foreach ($menu->submenu->getResult() as $submenu){
                                    if($submenu->LINK==substr($_SERVER["REQUEST_URI"],1)){$active = ' active '; $varmenu = str_replace('editarativo','class="active open"',$varmenu); }else{$active = '';}
                                    $varmenu = $varmenu.'<li class="'.$active.'"><a href="'.base_url().$submenu->LINK.'"><i class="'.$submenu->ICONE.'"></i>'.$submenu->DESCRICAO.'</a></li>';
                                }
                            $varmenu = $varmenu.'</ul> ';
                        }
                    $varmenu = $varmenu. '</li>    '; 
                    echo $varmenu;
                    $varmenu = '';
                }
        ?> 
                <li>					
                    <a href="<?php echo  base_url();?>/Login/Sair">
                        <i class="fa fa-sign-out"></i>
                        <span class="title">Sair</span>
                    </a>
                </li>
                
			</ul>
			<!-- END SIDEBAR MENU -->
		</div>
	</div>
	<!-- END SIDEBAR -->