<? ini_set("display_errors",0);session_start();
ini_set("display_errors",0);

if($_SESSION[email]=='') {
	header("location: ../agenteaduanal/login.php");
}else{
	include("../../comun/coneximpo.php");
	include("../comun/conex_ver.php");
	include("../comun/funciones.php");
	
 $CONIMPO=Conectarse();
$link_puerto=con_ver();	 
    
	$rDat = data($CONIMPO,"select C.*,A.nombre_empresa from contactos_agentes_aduanales C inner join
					  agentes_aduanales A on A.id=C.idaa and C.email_contacto like '".$_SESSION[email]."' AND A.registro='VERACRUZ' ");
//select C.*,A.nombre_empresa from contactos_agentes_aduanales C inner join agentes_aduanales A on C.patente = A.patente and  C.email_contacto like 'yvan@moz.com.mx'
	$_SESSION[area] = 'Exportación'; //$rDat[tipoe];
	$_SESSION[idusuario] = $rDat[id];
	$_SESSION[area_long] = 'Agencias Aduanales'; //$rDat[area];
 
	$_SESSION[tipo] = 'AA'; //$rDat[tipoe]; // comercial expo o impo
	$_SESSION[perfil] = 'General'; //$rDat[perfil]; // superadmin consulta general o personalizado
	
	$_SESSION[idusuario]=$rDat[idcto];
	$tipo = 'AA'; //$rDat[tipoe];
	$nombre = $rDat[nombre_contacto];
	$rol = 'A'; //$rDat[rol];
	$empresa = $rDat[nombre_empresa];
	 
	$_SESSION[nombre_usuario] = $nombre; 
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../style.css" media="all" />
	<!--[if IE 7]>
	<link rel="stylesheet" type="text/css" href="../style-ie.css" />
	<![endif]-->
<!-- estilos para popup-->
 <link rel="stylesheet" type="text/css" media="screen" title="basic" href="../css/basic/grid.css" />

 <link rel="alternate stylesheet" type="text/css" href="../css/basic/grid.css" title="coffee" media="screen" />

 <link rel="stylesheet" type="text/css" media="screen" href="../css/jqModal.css" />

 <link rel="stylesheet" type="text/css" media="screen" href="../css/ui.datepicker.css" />

<!-- estilos para popup-->
    
<title>VERACRUZ</title>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/validator.js"></script>
<script type="text/javascript" src="../js/funciones.js"></script>
<script type="text/javascript" src="../js/autocomplete/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="../js/autocomplete/jquery.autocomplete.css" media="all" />
<script src="../js/windowfiles_1/dhtmlwindow.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../js/windowfiles_1/dhtmlwindow.css" media="all" />
<SCRIPT type="text/javascript" src="../../../js/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<link type="text/css" rel="stylesheet" href="../../../js/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" media="screen"></LINK>

<!-- Begin DropDown -->
<? //include("../comun/tooltip.php");?>      
 
</head>

<body>

 <style>
	tr.yellow td {
	border-top: 1px solid #333;
	border-bottom: 1px solid #333;
	background: #FFC;
	font-weight:bold;  
	}
	
	tr.comun td {
	border-top: 1px solid #333;
	border-bottom: 1px solid #333;
	border-right: 1px solid #333;
	border-left: 1px solid #333;
	text-align:center;
	
	/*background: #FFC;*/
	}
	
	table.tablas_con_bordes{
		border:1PX solid #333; border-collapse:collapse
	}
	
	#social {width: 600px; height: 26px; float: left; margin-left:110px;}
	</style>
<div id="header">
<div id="social"><br />Bienvenido: <?=$nombre?>&nbsp;Email: <?=$_SESSION[email]?><br /> 
 <?=$empresa?> &nbsp;Area Agencias Aduanales<br />
  
</div>
</div>

<? 
$query=mysqli_query($link_puerto,"select * from menu where (tipoe = 'AA' or tipoe='AA')  and visible=1 order by posicion");
?>

<ul class="dropdown"><!-- menu -->
<? while ($r=mysqli_fetch_array($query)){?>
<li>
              <a <?  if($r[programa]!='#' or $r[titulo]=='Salir'){?>href="<?="https://".$_SERVER["SERVER_NAME"]?>/VER/<?=$r[programa]?>" <? } ?> ><?=utf8_encode($r[titulo])?></a> 
        <? $queryS=mysqli_query($link_puerto,"select * from submenu where idmenu = '".$r[id]."' and (tipoe = 'AA' or tipoe='AA' ) and visible=1 order by posicion");
        //echo "select * from submenu where idmenu = '".$r[id]."' and (tipo = '$tipo' or tipo='All' or tipo like '%$tipo%') and (rol = 'All' or rol = '$rol')  order by posicion";
        if(mysqli_num_rows($queryS)>0){
        ?>
        <ul >
                <? while($rS=mysqli_fetch_array($queryS)){?>
                <li><a href="<?="https://".$_SERVER["SERVER_NAME"]?>/VER/<?=$rS[programa]?>"><?=utf8_encode($rS[titulo])?></a>
                
                             <? $querySub=mysqli_query($link_puerto,"select * from sub_submenu where idmenu = '".$rS[id]."' and visible=1 order by titulo");
                    
                            if(mysqli_num_rows($querySub)>0){
                            ?>
                            <ul><!-- class="sub_menu"-->
                              <? while($rSub=mysqli_fetch_array($querySub)){?>
                                <li><a href="<?="https://".$_SERVER["SERVER_NAME"]?>/VER/<?=$rSub[programa]?>"><?=$rSub[titulo]?></a></li>
                              <? } ?>  
                            </ul>
                            <? } ?>
                
                </li>
                <? } ?>
        </ul>
        <? } ?>
</li>
<? } ?>

</ul><!-- close menu -->