<?php 
	$sidebar="sidebar responsive compact";
	if($this->session->userdata("admi_menu")=="left"){
		$sidebar="sidebar responsive compact";
	}
	else if($this->session->userdata("admi_menu")=="top"){
		$sidebar="sidebar h-sidebar navbar-collapse collapse";
	}
	else if($this->session->userdata("admi_menu")=="min"){
		$sidebar="sidebar responsive compact menu-min";
	}
?>
<div id="sidebar" class="<?php echo $sidebar; ?>">
	<script type="text/javascript">
		try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
	</script>
	<div class="sidebar-shortcuts" id="sidebar-shortcuts" style="max-height:100px;">
		<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
			<a class="btn btn-success" href="<?php echo $pagina_web; ?>" title="Inicio" target="_blanck">
				<i class="ace-icon fa fa-globe"></i>
			</a>
			<a class="btn btn-warning" href="#" onclick="$('#dialog_change_pass').dialog('open')" title="Cambiar Clave">
				<i class="ace-icon fa fa-key"></i>
			</a>
			<a class="btn btn-info" href="#" onclick="$('#dialog_datos_contacto').dialog('open')" title="Contacto">
				<i class="ace-icon glyphicon glyphicon-earphone"></i>
			</a>
			<a class="btn btn-danger" href="<?php echo site_url("sistema/cerrar_session"); ?>" title="Salir">
				<i class="ace-icon fa fa-power-off"></i>
			</a>
		</div>
		<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
			<span class="btn btn-success"></span>
			<span class="btn btn-info"></span>
			<span class="btn btn-warning"></span>
			<span class="btn btn-danger"></span>
		</div>
	</div>
	<ul class="nav nav-list">
		<?php 
			$title=array();
			$img=array();
			$sub=array();
			$link=array();
			$tmp="";
			$i=-1;
			$j=0;
			foreach($menu as $reg){
				if($reg->role_modulo!=$tmp){
					$title[]=$reg->role_modulo;
					$img[]=$reg->role_icono;
					$tmp=$reg->role_modulo;
					$i++;
					$j=0;
				}
				$sub[$i][$j]=$reg->role_nombre;
				$link[$i][$j]=$reg->role_url;
				$j++;
			}
			for($i=0;$i<count($title);$i++){
				echo "<li class='hsub hover li-menu' id='li".$i."'>";
				echo "
					<a href='#' class='dropdown-toggle'>
						<i class='menu-icon fa fa-$img[$i]'></i>
						<span class='menu-text'> $title[$i] </span>
						<b class='arrow fa fa-angle-down'></b>
					</a>
					<b class='arrow'></b>
					<ul class='submenu'>
				";
				for($j=0;$j<count($sub[$i]);$j++){
					echo "
						<li class='hover' id='li".$i.$j."'>
							
						<a href='#' onclick='cargar_funcion(\"".$link[$i][$j]."\",$i,$j,\"".$sub[$i][$j]."\")'>
								<i class='menu-icon fa fa-caret-right'></i>".
									$sub[$i][$j]
							."</a>
							<b class='arrow'></b>
						</li>
					";
				}
				echo "</ul>";
				echo "</li>";
			}
		?>
	</ul>
	<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
		<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
	</div>
	<script type="text/javascript">
		try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
	</script>
</div>

<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>
		<ul class="breadcrumb">
			<li>
				<i class="ace-icon fa fa-home home-icon"></i>
				<a href="<?php echo $pagina_web; ?>" target="_blanck">
					<?php echo $institucion; ?>
				</a>
			</li>
		</ul>
	</div>
	<div class="page-content">
		<div class="page-content-area">
			<div class="row">				
				<div 
					class="col-sm-12" 
					style="font-weight: 700;color: #2b7dbc;font-size: 24px;" 
					id="titulo_principal"
				></div>
				<div class="col-xs-12" id="body-main">
					