<?php
session_start();
$VarCon = VarServer("MYSQLI");
$objMenu = new clsConexion($VarCon[0],$VarCon[1],$VarCon[2],$VarCon[3],$VarCon[4]);

$ruta = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$ruta = str_replace(basename($_SERVER['SCRIPT_FILENAME']),"",$ruta);
$dirImg = "images/";
?>
<script type="text/javascript" src="js/stmenu.js"></script>
<script id="menu/menu.pgt" type="text/javascript">
<!--
stm_bm(["menu3b81",850,"","<?php echo $dirImg?>blank.gif",0,"","",0,0,250,200,1000,1,0,0,"","",0,0,1,2,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,0,2,16,7,100,"",-2,"",-2,50,0,0,"#999999","transparent","<?php echo $dirImg?>line.gif",3,0,0,"#000000","<?php echo $dirImg?>up.gif",23,210,0,"transparent","",3,"",-1,-1,0,"transparent","<?php echo $dirImg?>rightline.gif",3,"<?php echo $dirImg?>down.gif",22,210,0,"transparent","",3,"",-1,-1,0,"transparent","<?php echo $dirImg?>leftline.gif",3,"<?php echo $dirImg?>leftup.gif","<?php echo $dirImg?>rightup.gif","<?php echo $dirImg?>rightdown.gif","<?php echo $dirImg?>leftdown.gif",19,23,18,23,18,22,19,22]);

stm_ai("p0i0",[0,"Principal","","",-1,-1,0,"index2.php","_self","","","<?php echo $dirImg?>b_inicio.png","<?php echo $dirImg?>b_inicio.png",16,16,0,"","",0,0,0,0,1,"#BAD9E2",0,"#BAD9E2",0,"","",3,3,0,0,"#FFFFFF #9FD1E0 #9FD1E0 #FFFFFF","#999999","#000000","#000000","bold 8pt 'Arial','Verdana'","bold 8pt 'Arial','Verdana'",0,0],206,0);

stm_aix("p0i1","p0i0",[1,"<?php echo "<b>".$_SESSION[_NUSE]."</b>"."<br>".substr($_SESSION[_NTRA],0,25)?>","","",-1,-1,0,"","_self","","","<?php echo $dirImg?>b_user.png","<?php echo $dirImg?>b_user.png",16,16,0,"","",0,0,0,0,1,"#FFFFF7",1,"#C1E7F4",0,"","",3,3,0,0,"#C8E5EE","#000000","#000000","#000000","8pt 'Arial','Verdana'","8pt 'Arial','Verdana'"],206,0);
stm_aix("p0i2","p0i1",[0,"Cambiar Contraseņa","","",-1,-1,0,"clave.php","_self","","Salir del Sistema","<?php echo $dirImg?>b_clave.png","<?php echo $dirImg?>b_clave.png"],206,0);
stm_aix("p0i2","p0i1",[0,"Salir del Sistema","","",-1,-1,0,"logout.php","_self","","Salir del Sistema","<?php echo $dirImg?>logout.gif","<?php echo $dirImg?>logout.gif"],206,0);
<?php
$sql = "call spQuery_Sistema_Menu_Usuario($_SESSION[_CUSE],2,'')";
$objMenu->AbrirConexion();
$Menu = $objMenu->Query($sql);
$objMenu->CerrarConexion();
while ($aMenu = $objMenu->FetchArray($Menu)) {
	if(isset($aMenu["link"])&& $aMenu["link"]<>"#")	$dir=$ruta.$aMenu["link"];
	else $dir="#";
?>
stm_aix("p0i2","p0i0",[0,"<?php echo $aMenu["nombre"]?>","","",-1,-1,0,"<?php echo $dir?>","_self","","","<?php echo $aMenu["img_out"]?>","<?php echo $aMenu["img_over"]?>"],206,0);
stm_ai("p0i3",[6,1,"#999999","",-1,-1,0]);
<?php
$sql = "call spQuery_Sistema_Menu_Usuario($_SESSION[_CUSE],4,'$aMenu[0]')";
$objMenu->AbrirConexion();
$Menu1 = $objMenu->Query($sql);
$objMenu->CerrarConexion();
while ($aMenu1 = $objMenu->FetchArray($Menu1)) {
	if(isset($aMenu1["link"])&& $aMenu1["link"]<>"#") $dir=$ruta.$aMenu1["link"];
	else $dir="#";
	$sql = "call spQuery_Sistema_Menu_Usuario($_SESSION[_CUSE],6,'$aMenu1[0]')";
	$objMenu->AbrirConexion();
	$Menu2 = $objMenu->Query($sql);
	$objMenu->CerrarConexion();
	$NumHijos = $objMenu->NumFilas($Menu2);
	if($NumHijos>0) $CadTemp = ",16,16,0,\"".$dirImg."black-r.gif\",\"".$dirImg."red1-r.gif\",7,7";	
	else $CadTemp = "";
?>

stm_aix("p0i4","p0i1",[0,"<?php echo $aMenu1["nombre"]?>","","",-1,-1,0,"<?php echo $dir?>","_self","","<?php echo $aMenu1["nombre"]?>","<?php echo $aMenu1["img_out"]?>","<?php echo $aMenu1["img_over"]?>"<?php echo $CadTemp?>],206,0);

<?php
if($NumHijos>0) {
?>
stm_bpx("p1","p0",[1,2,0,0,0,1,16,0,100,"",-2,"",-2,50,0,0,"#999999","#C1E7F4","",3,0,0,"#999999","<?php echo $dirImg?>up.gif",23,-1,0,"transparent","",3,"",-1,-1,0,"transparent","<?php echo $dirImg?>rightline.gif",3,"<?php echo $dirImg?>down.gif",22,-1]);
<?php } 
while ($aMenu2 = $objMenu->FetchArray($Menu2)) {
	if(isset($aMenu2["link"])&& $aMenu2["link"]<>"#") $dir=$ruta.$aMenu2["link"];
	else $dir="#";
	
?>
stm_aix("p1i0","p0i1",[0,"<?php echo $aMenu2["nombre"]?>","","",-1,-1,0,"<?php echo $dir?>","_self","","<?php echo $aMenu2["nombre"]?>","<?php echo $aMenu2["img_out"]?>","<?php echo $aMenu2["img_over"]?>",16,16,0,"","",0,0,0,0,1,"#FFFFF7",1,"#FFFFFF"]);
<?php
}
if($NumHijos>0) {
?>
stm_ep();
<?php 
		} 
	} 
} 
?>

stm_ep();
stm_ep();
stm_em();
//-->
</script>