<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>


<aside class="main-sidebar">
<?php  //$_SESSION['probando'] = 'HOLA'; ?>
	<section class="sidebar">
	<?php 
		

		//print_r($_SESSION['grupos']); ?>
		<?php //if ($admin_prefs['user_panel'] == TRUE): ?>
			<!-- Sidebar user panel -->
			<div class="user-panel">
				<div class="pull-left image">
					<img src="<?php echo base_url($avatar_dir . '/m_001.png'); ?>" class="img-circle" alt="User Image">
				</div>
				<div class="pull-left info">
					<p><?php echo $user_login['firstname'].$user_login['lastname']; ?></p>
					<a href="#"><i class="fa fa-circle text-success"></i> <?php echo lang('menu_online'); ?></a>
				</div>
			</div>

		<?php //endif; ?>
		<?php if ($admin_prefs['sidebar_form'] == TRUE): ?>
			<!-- Search form -->
			<form action="#" method="get" class="sidebar-form">
				<div class="input-group">
					<input type="text" name="q" class="form-control" placeholder="<?php echo lang('menu_search'); ?>...">
					<span class="input-group-btn">
						<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
					</span>
				</div>
			</form>

		<?php endif; ?>
		<!-- Sidebar menu -->
		<ul class="sidebar-menu">
			<!-- DASHBOARD -->
			
			<!--<li>
				<a href="<?php echo site_url('/'); ?>">
					<i class="fa fa-home text-primary"></i> <span><?php echo lang('menu_access_website'); ?></span>
				</a>
			</li>
			<li class="header text-uppercase"><?php echo lang('menu_main_navigation'); ?></li>-->
			<?php if (menu_habilitado(69)): ?>
			<li class="<?=active_link_controller('dashboard')?>">
				<a href="<?php echo site_url('admin/dashboard'); ?>">
					<i class="fa fa-dashboard"></i> <span><?php echo lang('menu_dashboard'); ?></span>
				</a>
			</li>
			<?php endif ?>

			<!-- SEGURIDAD -->

			<?php /*if (menu_habilitado(14) ||
					  menu_habilitado(16) || 
					  menu_habilitado(49) || 
					  menu_habilitado(70)):*/ ?>

			<?php ?>

					<li class="header text-uppercase"><?php echo lang('menu_seguridad'); ?></li>
			<?php ?>
			<!-- PUEDE TAMBIEN ESTABLECERSE DE ESTS MANERA:
			(grupo_usuario(17) or grupo_usuario(27))
			-->

			<?php if (menu_habilitado(7)): ?>
				<li class="<?=active_link_controller('cambiar_password')?>">
					<a href="<?php echo site_url('admin/cambiar_password/cambiar_password'); ?>">
						<i class="glyphicon glyphicon-lock"></i> <span><?php echo lang('menu_cambiar_password'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(14)): ?>
				<li class="<?=active_link_controller('users')?>">
					<a href="<?php echo site_url('admin/users'); ?>">
						<i class="fa fa-user"></i> <span><?php echo lang('menu_users'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(16)): ?>				
				<li class="<?=active_link_controller('vistas/vistas')?>">
					<a href="<?php echo site_url('vistas/vistas'); ?>">
						<i class="fa fa-fw fa-vine"></i> <span><?php  echo lang('menu_vistas'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(49)): ?>				
				<li class="<?=active_link_controller('menus/menus')?>">
					<a href="<?php echo site_url('menus/menus'); ?>">
						<i class="fa fa-fw fa-maxcdn"></i> <span><?php  echo lang('menu_menus'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(15)): ?>				
				<li class="<?=active_link_controller('groups')?>">
					<a href="<?php echo site_url('admin/groups'); ?>">
						<i class="fa fa-shield"></i> <span><?php echo lang('menu_security_groups'); ?></span>
					</a> 
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(70)): ?>				
				<li class="<?=active_link_controller('auditoria')?>">
					<a href="<?php echo site_url('auditoria/auditoria'); ?>">
						<i class="fa fa-history"></i> <span><?php echo lang('menu_auditoria'); ?></span>
					</a> 
				</li>
			<?php endif ?>
		
			<!-- ########## Preferencias 
			<li class="treeview <?=active_link_controller('prefs')?>">
				<a href="#">
					<i class="fa fa-cogs"></i>
					<span><?php echo lang('menu_preferences'); ?></span>
					<i class="fa fa-angle-left pull-right"></i>
				</a>
				<ul class="treeview-menu">
					<li class="<?=active_link_function('interfaces')?>">
						<a href="<?php echo site_url('admin/prefs/interfaces/admin'); ?>">
							<?php echo lang('menu_interfaces'); ?>
						</a>
					</li>
				</ul>
			</li>-->
			

			<!-- ADMINISTRACION -->
			<?php //if (condition) {?>
				
			<?php if (menu_habilitado(50) ||
					  menu_habilitado(71) || 
					  menu_habilitado(22) || 
					  menu_habilitado(53)): ?>
			<li class="header text-uppercase"><?php echo lang('menu_administracion'); ?></li>
			<?php endif ?>

			<?php if (menu_habilitado(50)): ?>				
			<li class="<?=active_link_controller('conceptos/conceptos')?>">
				<a href="<?php echo site_url('conceptos/conceptos'); ?>">
					<i class="fa fa-align-justify "></i> <span><?php  echo lang('menu_conceptos'); ?></span>
				</a>
			</li>
			<?php endif ?>

			<!-- 
			<?php if (menu_habilitado(71)): ?>
			<li class="<?=active_link_controller('departamentos')?>">
				<a href="<?php echo site_url('man_espacial/departamentos/departamentos'); ?>">
					<i class="fa fa-map"></i> <span><?php echo lang('menu_departamentos');; ?></span>
				</a>
			</li>
			<?php endif ?>

            
			<?php if (menu_habilitado(22)): ?>
			<li class="<?=active_link_controller('distritos')?>">
				<a href="<?php echo site_url('man_espacial/distritos/distritos'); ?>">
					<i class="fa fa-map"></i> <span><?php echo lang('menu_distritos'); ?></span>
				</a>
			</li>
			<?php endif ?>
			-->

			<?php if (menu_habilitado(53)): ?>				
			<li class="<?=active_link_controller('equipos')?>">
				<a href="<?php echo site_url('monitoreo/equipos'); ?>">
					<i class="glyphicon glyphicon-th-large"></i> <span><?php echo lang('monitoreo_equipos');?></span>
				</a>
			</li>
			<?php endif ?>


			<?php if (menu_habilitado(56) ||
					  menu_habilitado(57) ||
					  //menu_habilitado(58) ||
					  menu_habilitado(72) ||
					  menu_habilitado(73) ||
					  menu_habilitado(56)): ?>				
			<li class="treeview <?=active_link_controller('panel_control')?>">
				<a href="#">
					<i class="fa fa-cogs"></i>
					<span><?php echo lang('menu_panel_control'); ?></span>
					<i class="fa fa-angle-left pull-right"></i>
				</a>
				<?php if (menu_habilitado(56)): ?>
					<ul class="treeview-menu">
						<li class="<?=active_link_function('control_operador')?>">
							<a href="<?php echo site_url('monitoreo/panel_control/panel_control/control_operador'); ?>">
							<?php echo lang('menu_control_operador'); ?>
							</a>
						</li>
					</ul>
				<?php endif ?>
				<?php if (menu_habilitado(57)): ?>
					<ul class="treeview-menu">
						<li class="<?=active_link_function('control_supervisor')?>">
							<a href="<?php echo site_url('monitoreo/panel_control/panel_control/	control_supervisor'); ?>">
								<?php echo lang('menu_control_supervisor'); ?>
							</a>
						</li>
					</ul>
				<?php endif ?>
				<?php if (menu_habilitado(72)): ?>
					<ul class="treeview-menu">
					<li class="<?php if (active_link_function('empate_principal') 		  == 'active'  || 
										 active_link_function('empate_empatados') 		  == 'active'  || 
										 active_link_function('empate_sin_parcelas') 	  == 'active'  || 
										 active_link_function('empate_sin_cuestionarios') == 'active')
									 {
										 echo 'active';
									 }else{
										 echo NULL;
									 }
								?>">
						<a href="<?php echo site_url('monitoreo/panel_control/panel_control/empate_principal'); ?>">
							<?php echo lang('menu_empate'); ?>
						</a>
					</li>
					</ul>
				<?php endif ?>
				<?php if (menu_habilitado(73)): ?>
				<ul class="treeview-menu">
					<li class="<?php if (active_link_function('informe_principal') 		  	== 'active'  || 
										 active_link_function('informe_finiquitados') 		== 'active'  || 
										 active_link_function('informe_formulados') 	  	== 'active'  || 
										 active_link_function('informe_ocupacion_efectiva') == 'active'  ||
										 active_link_function('informe_ocupacion_irregular')== 'active'  || 
										 active_link_function('informe_adjudicados') 	  	== 'active')
									 {
										 echo 'active';
									 }else{
										 echo NULL;
									 }
								?>">
						<a href="<?php echo site_url('monitoreo/panel_control/panel_control/informe_principal'); ?>">
							<?php echo lang('menu_informes'); ?>
						</a>
					</li>
				</ul>
				<?php endif ?>
			</li>
			<?php endif ?>


			<!-- EXPEDIENTES -->
			<?php if (menu_habilitado(77)): ?>
			<li class="header text-uppercase"><?php echo lang('menu_expedientes'); ?></li>
			<?php endif ?>
			

			<?php if (menu_habilitado(77)): ?>				
				<li class="<?=active_link_controller('expedientes')?>">
					<a href="<?php 
						echo site_url('expedientes/expedientes'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_expedientes');?></span>
					</a>
				</li>
			<?php endif ?>



			<!-- MANTENIMIENTO DE DATOS ESPACIALES -->
			<?php if (menu_habilitado(51) ||
					  menu_habilitado(52) ||
					  menu_habilitado(74) ||
					  menu_habilitado(75) ||
					  menu_habilitado(67) ||
					  menu_habilitado(59) ||
					  menu_habilitado(60)): ?>
			<li class="header text-uppercase"><?php echo lang('menu_man_espacial'); ?></li>
			<?php endif ?>
			

			<?php if (menu_habilitado(51)): ?>				
				<li class="<?=active_link_controller('geocolonias')?>">
					<a href="<?php 
						echo site_url('man_espacial/geocolonias/geocolonias/index/'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_geocolonias');?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(52)): ?>				
				<li class="<?=active_link_controller('colonias')?>">
					<a href="<?php echo site_url('man_espacial/colonias/colonias/index/'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_colonias'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(74)): ?>				
				<li class="<?=active_link_controller('colonias_fincas')?>">
					<a href="<?php echo site_url('man_espacial/fincas/colonias_fincas/index/'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_colonias_fincas'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(75)): ?>				
				<li class="<?=active_link_controller('fincas')?>">
					<a href="<?php echo site_url('man_espacial/fincas/fincas/index/'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_fincas'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(67)): ?>				
				<li class="<?=active_link_controller('colonias')?>">
					<a href="<?php echo site_url('man_espacial/colonias/colonias/index_geo/'); ?>">
						<i class="fa fa-user"></i> <span><?php echo 'Control de Colonias<br> (	Geoprocesamiento)'; ?></span>
					</a>
				</li>
			<?php endif ?>


			<?php if (menu_habilitado(59)): ?>				
				<li class="<?=active_link_controller('in_temp')?>">
					<a href="<?php echo site_url('man_espacial/in_temp/in_temp'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_in_temp'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<?php if (menu_habilitado(60)): ?>
				<li class="<?=active_link_controller('in_parc')?>">
					<a href="<?php echo site_url('man_espacial/in_parc/in_parc'); ?>">
						<i class="fa fa-map"></i> <span><?php echo lang('menu_in_parc'); ?></span>
					</a>
				</li>
			<?php endif ?>

			<!-- Intranet SIGEO SEAM -->
			<?php if (menu_habilitado(61)): ?>
			<li class="header text-uppercase"><?php echo $title; ?></li>
			<?php endif ?>
			<?php if (menu_habilitado(61)): ?>
			<li class="treeview <?=active_link_controller('carga_masiv_fotos')?>">
				<a href="#">
					<i class="fa fa-cogs"></i>
					<span><?php echo lang('menu_tool'); ?></span>
					<i class="fa fa-angle-left pull-right"></i>
				</a>
				<!--<ul class="treeview-menu">
					<li class="<?=active_link_function('tool_arreglar')?>">
						<a href="<?php echo site_url('herramientas/tool/tool'); ?>">
							<?php echo lang('tool_arreglar'); ?>
						</a>
					</li>
				</ul>-->
				<?php if (menu_habilitado(61)): ?>
				<ul class="treeview-menu">
					<li class="<?=active_link_function('index')?>">
						<a href="<?php echo site_url('herramientas/carga_masiv_fotos/carga_masiv_fotos/index'); ?>">
							<?php echo 'Carga Masiva de Fotos'; ?>
						</a>
					</li>
				</ul>
				<?php endif ?>
			</li>
			<?php endif ?>

			<?php if (menu_habilitado(62)): ?>
			<li class="treeview <?=active_link_controller('pestanhas')?>">
				<a href="#">
					<i class="fa fa-compass"></i>
					<span><?php echo lang('menu_componentes'); ?></span>
					<i class="fa fa-angle-left pull-right"></i>
				</a>
				<ul class="treeview-menu">
					<li class="<?=active_link_function('pestanhas')?>">
						<a href="<?php echo site_url('componentes/pestanhas'); ?>">
							<?php echo lang('componente_pestanha'); ?>
						</a>
					</li>
				</ul>
			</li>
			<?php endif ?>
			
			<li class="<?=active_link_controller('files')?>">
				<a href="<?php echo site_url('admin/files'); ?>">
					<i class="fa fa-file"></i> <span><?php echo lang('menu_files'); ?></span>
				</a>
			</li>

			<?php if (menu_habilitado(76)): ?>
			<li class="<?=active_link_controller('database')?>">
				<a href="<?php echo site_url('admin/database'); ?>">
					<i class="fa fa-database"></i> <span><?php echo lang('menu_database_utility'); ?></span>
				</a>
			</li>
			<?php endif ?>

			<li class="<?=active_link_controller('license')?>">
				<a href="<?php echo site_url('admin/license'); ?>">
					<i class="fa fa-legal"></i> <span><?php echo lang('menu_license'); ?></span>
				</a>
			</li>

			<li class="<?=active_link_controller('resources')?>">
				<a href="<?php echo site_url('admin/resources'); ?>">
					<i class="fa fa-cubes"></i> <span><?php echo lang('menu_resources'); ?></span>
				</a>
			</li>

		</ul>
	</section>
</aside>
