<?php
function lbl_barcode($item,$ruta)
{
	require($ruta);
	$item_sql='select *from item00 left join tlla0 on item_tlla=tlla_codigo left join mrca0 on item_mrca=mrca_codigo where item_codigo like "'.trim($item).'"';
	$item_res=mysql_query($item_sql,$link_vcrx);

//echo $item_sql;

$sizedescri=10;
$descri=substr(mysql_result($item_res,0,'item_descri'),0,strpos(mysql_result($item_res,0,'item_descri'),'/'));
if (trim($descri)=="") { $descri=mysql_result($item_res,0,'item_descri');}
if (strlen(trim($descri))>20) { $sizedescri =8; }

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

if (isset($_GET['ipvp1']) && !empty($_GET['ipvp1'])){$xpvp1=mysql_result($item_res,0,'item_pvp1');}
	
if (isset($_GET['lote']) && !empty($_GET['lote'])){$xlote=1;}

$item_marca=ucfirst(strtolower(mysql_result($item_res,0,'mrca_descri')));
$bc_ean13=mysql_result($item_res,0,'bc_ean13');
$item_ean=mysql_result($item_res,0,'item_ean');
	
//if($_GET['eti']=='1'){}
if($_GET['itlla']=='0')
{
	$item_sql0='select *from item00 left join tlla0 on item_tlla=tlla_codigo left join mrca0 on item_mrca=mrca_codigo where item_codigo like "'.substr($item,0,6).'"';
	$item_res0=mysql_query($item_sql0,$link_vcrx);
	$bc_ean13=mysql_result($item_res0,0,'bc_ean13');
	$item_ean=mysql_result($item_res0,0,'item_ean');
}
	
?>
<!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: 
	src: url('KunstlerScript.ttf')  
	format('truetype'); 
    font-weight: normal;
    font-style: italic;
  }
@font-face {
    font-family:'EanP36Tt';
    src: 
	src: url('EAN13_36.TTF')
	format('truetype'); 
    font-weight: normal;
    font-style: normal;
    
  }
@font-face {
    font-family: 'PalaceScriptMT';
    src: 
	url('PalaceScriptMT.ttf')  
	format('truetype'); 
    font-weight: normal;
    font-style: normal;
}
	
#header {
    display: none;
    //background: url("../images/theme/header-large.png") no-repeat scroll 0 0 #C40000;
    //padding-left: 22px;
}
	
pscript {
   font-family: 'PalaceScriptMT';
   padding:0px; margin:0px;
 
}
cbean13 {
   font-family: 'EanP36Tt';
   padding:0px; margin:0px;
}

div{font-family:Arial;}

</style>
</head>

<body >
<div align="left" valign="top">
<div id="contenedor">


<table valign="top" align="left" width="32%" cellspacing="0" cellpading="0" border="0" style="font-size:18px; border-collapse:collapse">
<tr>
<?php for($c=1;$c<=2;$c++) { ?>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="font-size:12px; border-left:solid 0px;border-right:solid 0px">
<?php if ($xlote==0) { ?>
	<tr height="5px"></tr>
<?php } ?>

<tr align="center">
    <td><pscript style="font-size:40px;"><?php if($_GET['eti']=='1'){ echo $item_marca;}?></pscript></td>
</tr>
<tr align="left">
    <td><span style="font-size:<?php echo $sizedescri; ?>px; padding-left:5px;">
	<?php echo $descri;?>
	</span></td>
</tr>
<tr align="left">
    <td><cbean13 style="font-size:50px; padding:0px; margin:-10px;"><?php echo $bc_ean13;?></cbean13></td>
</tr>
<tr align="center">
    <td>
    	<div><span style="font-size:12px;font-weight:bolder;"><?php echo substr(mysql_result($item_res,0,'item_codigo'),0,6).' /'.mysql_result($item_res,0,'tlla_descri');?></span></div>
        <div><b><?php if($xpvp1>0){ echo 'P.V.P.  $'.number_format($xpvp1,2);}?></b></div>
        <div><b><?php if($xlote==1){ echo 'LOTE :'.$_GET['lote'];}?></b></div>
    </td>
</tr>
</table>
</td>

<?php if ($c==1) { ?>
<td width ="10px"></td>	
<?php } ?>
	
<?php } ?>
</tr>
</table>



</div>
</div>

</body>
</html>
<?php	
}
?>