<?php session_start();?>
<?php include('../_cfg/config.php');?>
<?php include('php_gene1.php'); ?>
<?php include('php_session.php');?>

<?php foreach($_POST as $campo => $valor){${$campo}=$valor;} ?>
<?php 
$gris1='gainsboro';

$sql_enti ='select * from enti00 ';
$sql_enti.=' left join zsub0 on enti_zsub=zsub_codigo  ';
$sql_enti.=' where enti_codigo like "'.trim($codigo).'"';
$res_enti=msql_query($sql_enti,$link_vcrx);



$sizedescri=10;
$enti_codigo=@msql_result($res_enti,0,'enti_codigo'); 
$enti_descri=@msql_result($res_enti,0,'enti_descri'); 
$enti_razsoc=@msql_result($res_enti,0,'enti_razsoc'); 
$enti_nomcom=@msql_result($res_enti,0,'enti_nomcom'); 
$enti_marca=@ucwords(strtolower(msql_result($res_enti,0,'mrca_descri')));
$enti_master=substr($enti_codigo,0,6);
$bc_ean13=@msql_result($res_enti,0,'bc_ean13');
$enti_zsub=@msql_result($res_enti,0,'enti_zsub');



$enti_eanbc=$enti_ean13bc;
$clor_descri=substr($clor_descri,0,7);



if(substr($enti_master,0,2)=='20')
{$enti_master=substr($enti_codigo,0,8);}

$descri=@substr(msql_result($res_enti,0,'enti_descri'),0,strpos(msql_result($res_enti,0,'enti_descri'),'/'));
if (trim($descri)=="") { $descri=@msql_result($res_enti,0,'enti_descri');}
if (strlen(trim($descri))>20) { $sizedescri =8; }



$talla='';
$xlote=0;
$xpvp1=0;

if (isset($_GET['ipvp1']) && !empty($_GET['ipvp1'])){$xpvp1=msql_result($res_enti,0,'enti_pvp1');}
	
if (isset($_GET['lote']) && !empty($_GET['lote'])){$xlote=1;}



// $bc_ean13=@msql_result($res_enti,0,'bc_ean13');
// $bc_ean13=@msql_result($res_enti,0,'enti_ean13bc');
// $enti_ean=@msql_result($res_enti,0,'enti_ean');
// if(strlen(trim($codigo))==8){$bc_ean13=@msql_result($res_enti,0,'bc_ean8');}
  
//   $enti_ean='881900174700';
	
//if($_GET['eti']=='1'){}
if($_GET['itlla']=='0')
{
	$sql_enti0='select *from enti00 left join tlla0 on enti_tlla=tlla_codigo left join mrca0 on enti_mrca=mrca_codigo where enti_codigo like "'.substr($enti,0,6).'"';
	$res_enti0=msql_query($sql_enti0,$link_vcrx);
	$bc_ean13=msql_result($res_enti0,0,'bc_ean13');
	$enti_ean=msql_result($res_enti0,0,'enti_ean');
	$enti_ean8bc=msql_result($res_enti0,0,'enti_ean8bc');
	$enti_ean13bc=msql_result($res_enti0,0,'enti_ean13bc');
}


// echo '*/*/*/'.$codigo;


?>
<!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" />
   
<title>Etiqueta Codigo de Barras</title>
<style type="text/css">
body{ margin:0px; padding:0px; font:"Arial", Arial;}
#contenedor{ width:1000px;margin:0px;padding:0px;}

@page { margin: 0; }
	
/* @font-face {
    font-family: 'Arial Narrow';
    font-weight: normal;
    font-style: italic;
  }
   
@font-face {
    font-family: 'PalScript';
	src: url('KunstlerScript.ttf')format('truetype'); 
    font-weight: normal;
    font-style: italic;
  }
		
@font-face{
    font-family:'EanP36Tt';
    src: url('../_font/EAN13_36.ttf')format('truetype'); 
    font-weight: normal;
    font-style: normal;
  }
   
@font-face{
    font-family: 'PalaceScriptMT';
    src: url('../_font/PalaceScriptMT.ttf')format('truetype'); 
    font-weight: normal;
    font-style: normal;
}
		
@font-face{
    font-family:'Barcode';
    src: url('BarcodeFont.ttf')format('truetype'); 
    font-weight: normal;
    font-style: normal;
}
	 */
/* barcode
{
   font-family: 'Barcode';
   padding:0px; margin:0px;
}
	
pscript{
   font-family: 'PalaceScriptMT';
   padding:0px; margin:0px;
}
	
cbean13 {
   font-family: 'EanP36Tt';
   padding:0px; margin:0px;
}
 */
#header{
    display: none;
}

   
   
div{font-family:Arial;}

</style>
</head>
<br>
<body >
<div align="left" valign="top">
<div id="contenedor">

  
<?php $xfontsize=30; ?>  
<table valign="top" align="center" width="90%" cellspacing="0" cellpading="0" border="1" style="font-size:<?php echo $xfontsize;?>px; border-collapse:">
<caption style="border:solid 1px; font-weight:bold;background-color:<?php echo $gris1;?>;">DESTINATARIO</caption>  
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">CED./ RUC :</td>
  <td><?php echo $enti_codigo; ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">RAZ.SOC:</td>
  <td style="font-weight:bold;"><?php echo $enti_razsoc; ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">NOM.COM.:</td>
  <td><?php echo $enti_nomcom; ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">DIRECCION:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_matriz').'<br>'.@msql_result($res_enti,0,'enti_parroq'); ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">CIUDAD:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_ciudad'); ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">TELEFONO:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_telefono'); ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">e-MAIL:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_email'); ?></td>
</tr>
</table>

  
<?php
$sql_enti ='select * from enti00 ';
// $sql_enti.=' left join zsub0 on enti_zsub=zsub_codigo  ';
$sql_enti.=' where enti_codigo like "'.trim($cfg_ruc).'"';
$res_enti=msql_query($sql_enti,$link_vcrx);

  
?>  
<br>
<?php $xfontsize=20; ?>  
<table valign="top" align="center" width="90%" cellspacing="0" cellpading="0" border="1" style="font-size:<?php echo $xfontsize;?>px; border-collapse:">
<caption style="border:solid 1px; font-weight:bold;background-color:<?php echo $gris1;?>;">REMITENTE</caption>  
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">RAZ.SOC:</td>
  <td style="font-weight:bold;"><?php echo $cfg_descri; ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">DIRECCION:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_matriz'); ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">CIUDAD:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_ciudad'); ?></td>
</tr>
<tr height="<?php echo $xfontsize*1.8;?>px">
  <td align="left">TELEFONO:</td>
  <td><?php echo @msql_result($res_enti,0,'enti_telefono'); ?></td>
</tr>
</table>
  


</div>
</div>

</body>
</html>
<?php	

?>