<?php
session_start();
include_once("../scripts/connect.php");
include_once("../scripts/session.php");   //Validar Session
$sesion=new Sesion("","","");/*Se crea un objeto nuevo con el privilegio necesario para la pag. actual*/

if(!$sesion->isValida("4")){ /*Sesion invalida*/
	 header("Location: ../index.php?err=NoSesion");
    }/*no hay sesion*/

    else{
       $dato=explode("|",$_SESSION['usuario']);
       $sesion->setDatos($dato[0],$dato[1],$dato[2]);
       $sesion->setSesion();
    }
   //fin validar session
 $conexion=conecta_default();
  $ok=0; $idin = $sesion->id; 


echo"<html>
<head>
  <title></title>
</head>
<body bgcolor=\"#c3dfed\" alink=\"#2b385d\" link=\"#2b385d\" vlink=\"#2b385d\">
<font size=\"3\">
<hr color=\"#666666\">

<b><center>

</center></b>

<hr color=\"#666666\">
<font color=\"#000000\">";


$qp3 = "select * from asignacols where idcd=$idin";
   $cp3 = mysqli_query($conexion, $qp3) or die ('Error (Registrouu No Encontrado): ' . mysqli_error($conexion));
	
	if(mysqli_affected_rows($conexion)){


 echo" <img src=\"../files/usuarios.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\">
 <font color=\"#000000\"><b> Usuarios</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=1
	  order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}

echo" <br><hr color=\"#666666\"><img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Operaciones</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=2 order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}
	
echo" <br><hr color=\"#666666\"><img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Productos</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=6 order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}
echo" <br><hr color=\"#666666\"><img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Inventarios</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=3 order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}	
	
echo" <br><hr color=\"#666666\"><img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Movimientos Efectivo</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=4 order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}
	
echo" <br><hr color=\"#666666\"><img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Reportes</b></font>
<br />";

	  $q2 = "select nombre, link, menu from col_cd join asignacols on col_cd.idcol=asignacols.idcol where idcd='$idin' and menu=5 order by idasig";
  
  $c2 = mysqli_query($conexion, $q2) or die ('Error en la consulta' . mysqli_error($conexion));
  
  for($i=0;$r1 = mysqli_fetch_row($c2);$i++)
   {
	   $a0 = $r1[0];
	   $a1 = $r1[1];
	  
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$a1\" target=\"P\"> <font size=\"4\">$a0</font></a><br>";
	}	
	
	}else{
/*
if($idin<=13 || $idin>=100 ){
 echo" <img src=\"../files/usuarios.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\">
 <font color=\"#000000\"><b> Usuarios</b></font>
<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"inscripcion.php\" target=\"P\"> <font size=\"4\">Nuevo Usuario</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"buscausr.php\" target=\"P\"> <font size=\"4\">Buscar Usuario</font></a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"agregacta.php\" target=\"P\"> <font size=\"4\">Agregar Cuenta Banco</font></a><br />

<br>


C

<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Operaciones</b></font>";
/*echo"<br /><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"evento.php\" target=\"P\"><font size=\"4\">VENTAS EVENTO</font></a>
<br /><br>";*//*
echo"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"insc1.php\" target=\"P\"><font size=\"4\">Inscripciones</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"inv_mens1.php\" target=\"P\"><font size=\"4\">Nota de Venta</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"nota_salida1.php\" target=\"P\"><font size=\"4\">Nota de Salida</font></a>
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"otrassalidas.php\" target=\"P\"><font size=\"4\"> Otras Salidas</font></a><br>";
if($idin==12 || $idin==8 || $idin==5){ 
echo"	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"entregaped.php\" target=\"P\"><font size=\"4\">Entregar Pedido</font></a>

<br />";
 } 
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"guias.php\" target=\"P\"><font size=\"4\">Env&iacute;os / Gu&iacute;as</font></a>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"vta_pub1.php\" target=\"P\"><font size=\"4\">Venta Publico</font></a>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"cancelanota.php\" target=\"P\"><font size=\"4\">Cancelar Pedido</font></a>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pagarregaliasx2.php\" target=\"P\"><font size=\"4\">Regalias por pagar</font></a>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"unir_voucher.php\" target=\"P\"><font size=\"4\">Unir Voucher</font></a>
<br>

<br /><hr color=\"#666666\">


<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Inventarios</b></font>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"existencias.php\" target=\"P\"><font size=\"4\"> Existencias</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"altasprod.php\" target=\"P\"><font size=\"4\"> Alta Productos</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pedidostock.php\" target=\"P\"><font size=\"4\"> Pedidos de Stock</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"ventasproducto.php\" target=\"P\"><font size=\"4\"> Desplazamiento Prod.</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"hacerinventario.php\" target=\"P\"><font size=\"4\"> Inventario F&iacute;sico</font></a><br>
<br /><hr color=\"#666666\">



<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Movimientos Efectivo</b></font>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"gastos.php\" target=\"P\"><font size=\"4\"> Generar Gasto</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"entradaef.php\" target=\"P\"><font size=\"4\"> Entrada de Efectivo</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"salidaef.php\" target=\"P\"><font size=\"4\"> Salida de Efectivo</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"cortecaja.php\" target=\"P\"><font size=\"4\"> Corte de Caja</font></a><br>
<br>
<hr color=\"#666666\"><img src=\"../files/reportes.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Reportes</b></font>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"calificado.php\" target=\"P\"><font size=\"4\">Reporte del mes</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"reporte2.php\" target=\"P\"><font size=\"4\">Reporte Generacional</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"reportedia.php\" target=\"P\"><font size=\"4\">Ventas d&iacute;a imprimir</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"comprasdia_admin.php\" target=\"P\"><font size=\"4\">Ventas del d&iacute;a</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"comprastotales.php\" target=\"P\"><font size=\"4\">Ventas por fecha</font></a>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"comprastotalesant.php\" target=\"P\"><font size=\"4\">Ventas (Anterior)</font></a>

<br />

<br /><hr color=\"#666666\">
<br /><br />

";
}else{
echo"
 <img src=\"../files/usuarios.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Usuarios</b></font>
<br />


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"inscripcion.php\" target=\"P\"> <font size=\"4\">Nuevo Usuario</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"buscausr.php\" target=\"P\"> <font size=\"4\">Buscar Usuario</font></a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"agregacta.php\" target=\"P\"> <font size=\"4\">Agregar Cuenta Banco</font></a><br />


 




<br />
<hr color=\"#666666\">

<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Operaciones</b></font>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"insc1.php\" target=\"P\"><font size=\"4\">Inscripciones</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"inv_mens1.php\" target=\"P\"><font size=\"4\">Nota de Venta</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"nota_salida1.php\" target=\"P\"><font size=\"4\">Nota de Salida</font></a>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"otrassalidas.php\" target=\"P\"><font size=\"4\"> Otras Salidas</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pagarregaliasx.php\" target=\"P\"><font size=\"4\">Regalias por pagar</font></a>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"cancelanota.php\" target=\"P\"><font size=\"4\">Cancelar Pedido</font></a>

<br />
<!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"agrega_ficha.php\" target=\"P\"><font size=\"4\">Agregar ficha de dep&oacute;sito</font></a>
<br />-->
<br /><hr color=\"#666666\">



<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Inventarios</b></font>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"existencias.php\" target=\"P\"><font size=\"4\"> Existencias</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"altasprod.php\" target=\"P\"><font size=\"4\"> Alta Productos</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"pedidostock.php\" target=\"P\"><font size=\"4\"> Pedidos de Stock</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"ventasproducto.php\" target=\"P\"><font size=\"4\"> Desplazamiento Prod.</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"hacerinventario.php\" target=\"P\"><font size=\"4\"> Inventario F&iacute;sico</font></a><br>
<br /><hr color=\"#666666\">



<img src=\"../files/pedidos.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Movimientos Efectivo</b></font>

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"gastos.php\" target=\"P\"><font size=\"4\"> Generar Gasto</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"entradaef.php\" target=\"P\"><font size=\"4\"> Entrada de Efectivo</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"salidaef.php\" target=\"P\"><font size=\"4\"> Salida de Efectivo</font></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"cortecaja.php\" target=\"P\"><font size=\"4\"> Corte de Caja</font></a><br>
<br>

<br /><hr color=\"#666666\">

<img src=\"../files/reportes.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"\"><font color=\"#000000\"><b> Reportes</b></font>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"calificado.php\" target=\"P\"><font size=\"4\">Reporte del mes</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"reportedia.php\" target=\"P\"><font size=\"4\">Ventas d&iacute;a imprimir</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"comprasdia_admin.php\" target=\"P\"><font size=\"4\">Ventas del d&iacute;a</font></a>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"comprastotales.php\" target=\"P\"><font size=\"4\">Ventas por fecha</font></a>

<br />


<br /><hr color=\"#666666\">
<br /><br />

</font>";

}*/

}



