<!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=iso-8859-1" />
<title>Virtual Server .::WMS::. -- || By SIYSC-Solutions ||</title>
<style type="text/css">
<!--
.Estilo4 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.Estilo5 {font-size: 16px; font-family: Arial, Helvetica, sans-serif; }
.Estilo7 {
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FFFFFF;
}
.Estilo9 {font-size: 24px; font-family: Arial, Helvetica, sans-serif; }
.Estilo10 {font-size: 22px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.Estilo11 {font-size: 18px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
-->
</style>
</head>

<body>
<div align="right">
<?php
		include ("../../../Conexion.php");
			$UsuEn=$_POST['USUkp'] or $UsuEn=$_GET['USUkp'];
			$NoPalletEn=$_POST['txt_CvePallet'] or $NoPalletEn=$_GET['txt_CvePallet'];
	
	if ($UsuEn=="")
		{
		echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=Login.php' target='_parent'>";
		}
		else
		{
		/////////IDENTIFICAR DATOS DE NIVEL///////
		$sql = mysql_query("select * from tabla_usuarios where USUARION='$UsuEn'");
						
	if (mysql_numrows($sql)==0) echo "";
		else{
		$registro=mysql_fetch_array($sql);
		}
		if (mysql_numrows($sql)>0)
		{
		$CNiv=$registro["NIVEL"];
		}
			
	if ($CNiv<>"01" and $CNiv<>"02")
		{
		echo "<script>alert('No estas autorizado para realizar esta operaci&oacute;n');</script>";
		echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=Contenedor.php'>";
		}
	
	/////////CONSULTAR EL PALLET EN LA TABLA INVENTARIO///////
		$sql = mysql_query("select * from  tabla_inventario where NO_PALLET='$NoPalletEn'");
						
		if (mysql_numrows($sql)==0) 
		{
		echo "<script>alert('El pallet que deseas imprimir no existe\\nFavor de corroborarlo');</script>";
		echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=../../../RedireccionDeCierre.php'>";
		}
		else
		{
		$registro=mysql_fetch_array($sql);
		}
		if (mysql_numrows($sql)>0)
		{
		$PDocComple=$registro["NO_DOC_COMPLE"];
		$PSKU=$registro["SKU"];
		$PCadu=$registro["CADUCIDAD"];
		$PSKUAlt=$registro["SKU_ALT"];
		$PDescrip=$registro["DESCRIPCION"];
		$PCantidad=$registro["CANTIDAD"];
		
		$PiXCaja=$registro["PIEZASXCAJA"];
		$PCajasProceso=$PCantidad/$PiXCaja;
		$PCajas=number_format("$PCajasProceso", 2, ".", ".");
		
		echo "<script language='JavaScript'>window.print();</script>";
		//echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=../../../RedireccionDeCierre.php'>";
		}
	/////////CONSULTAR AL CONTRATANTE/////////////////////////////////////
		$sql = mysql_query("select * from  tabla_contratante");
						
		if (mysql_numrows($sql)==0) echo "";
		else{
		$registro=mysql_fetch_array($sql);
		}
		if (mysql_numrows($sql)>0)
		{
		$NomCuentaContrata=$registro["CUENTA"];
		}
	/////////FIN CONSULTAR AL CONTRATANTE/////////////////////////////////
	}
	  
	  	////$num = "00-20504030-artsana2012";///
		$num = $NoPalletEn;
		$num = isset($_REQUEST) && is_array($_REQUEST) && isset($_REQUEST['num']) ? $_REQUEST['num'] : $num;
	  ?>
	  
  <table width="551" height="355" border="0" style="border-collapse: collapse">
    <tr>
      <td width="6" align="left" bgcolor="#000000">&nbsp;</td>
      <td width="205" height="21" align="left" bgcolor="#000000"><span class="Estilo7">www.logsyswms.com</span></td>
      <td width="206" align="right" bgcolor="#000000"><? echo "<font size='20' class='Estilo7'>".$NomCuentaContrata."</font>" ?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25" colspan="2"><div align="left"><span class="Estilo9">Doc. Comple</span><span class="Estilo4">:</span> <? echo "<font size='20' class='Estilo10'>".$PDocComple."</font>" ?></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25"><div align="left"><span class="Estilo9">SKU</span><span class="Estilo4">:</span> <? echo "<font size='20' class='Estilo10'>".$PSKU."</font>" ?></div></td>
      <td height="25"><div align="left"><span class="Estilo9">Caducidad</span><span class="Estilo4">:</span> <? echo "<font size='20' class='Estilo10'>".$PCadu."</font>" ?></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25" colspan="2"><div align="left"><span class="Estilo9">SKU</span><span class="Estilo9"> Alt:</span> <? echo "<font size='20' class='Estilo10'>".$PSKUAlt."</font>" ?></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25" colspan="2"><div align="left"><span class="Estilo9">Descripci&oacute;n</span><span class="Estilo4">:</span></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25" colspan="2"><div align="left"><? echo "<font size='20' class='Estilo11'>".$PDescrip."</font>" ?></div></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td height="25"><div align="left"><span class="Estilo9">Piezas</span><span class="Estilo4">:</span> <? echo "<font size='20' class='Estilo10'>".$PCantidad."</font>" ?></div></td>
      <td height="25"><div align="left"><span class="Estilo9">Cajas</span><span class="Estilo4">:</span> <? echo "<font size='20' class='Estilo10'>".$PCajas."</font>" ?></div></td>
    </tr>
    <tr>
      <td height="97" colspan="3" align="center"><img src="barcode_img.php?num=<?php echo($num) ?>&type=code128&imgtype=png" alt="PNG: <?php echo($num) ?>" title="PNG: <?php echo($num) ?>" width="90%" height="93%"></td>
    </tr>
  </table>
  <?PHP
  echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=../../../RedireccionDeCierre.php'>";
  ?>
</div>
</body>
</html>