		
		<?php foreach($listaArea as $area) {
			if(! $_SESSION["admin_bi"])
			{
				$listaBi_pagina = $bi_paginaDAO->buscarFiltro(" where area = ".$area->getCodigo() . "
				and codigo in ( SELECT p.codigo FROM bi_permissao_pagina pg 
				join bi_pagina p on p.codigo = pg.pagina
				join bi_usuario_grupo ug on ug.grupo = pg.grupo
				where ug.usuario = ".$_SESSION["id_usuario_bi"]."
				group by area)");
			}
			else
			{
				$listaBi_pagina = $bi_paginaDAO->buscarFiltro(" where area = ".$area->getCodigo() );
			}
			?>
			<li class="nav-item" data-toggle="tooltip" data-placement="right" title="<?php echo $area->getNome();?>" style="width: 100%; position: relative; border-top: solid 1px #4d4d4d;">
				  <a class="nav-link nav-link-collapse collapsed" data-toggle="collapse" href="#Dashboard<?php echo $area->getCodigo();?>" data-parent="#exampleAccordion">
					
					<span class="nav-link-text" style="font-size: 15px; font-weight: bold;"><?php echo $area->getNome();?></span>
					<i class="fa-solid fa-angle-right" style="position: absolute; left: 80%; top: 12px;"></i>
				  </a>
				  <ul class="sidenav-second-level collapse" id="Dashboard<?php echo $area->getCodigo();?>" style="width: 100%; padding: 0px; margin: 0; "> 
					<?php foreach($listaBi_pagina as $bi_pagina) {?>
						<li style="border-top: solid 1px #4d4d4d;">
							<?php if(trim($bi_pagina->getLink_externo()) == ""){?>
								<a class="aside" style="margin-left: 20px; font-size: 15px; font-weight: bold;" href="JavaScript:void(0)" onclick="abrir_pagina(<?php echo $bi_pagina->getCodigo();?>)" ><?php echo $bi_pagina->getNome();?></a>
							<?php } else { ?>
								<a class="aside" style="margin-left: 20px; font-size: 15px; font-weight: bold;" target="_blank" href="<?php echo trim($bi_pagina->getLink_externo());?>" ><?php echo $bi_pagina->getNome();?></a>
							<?php }  ?>
						</li>
					<?php }?>
				  </ul>
			</li>
		<?php }?>
		
		
		
