<?php session_start();
require('../cfg/cfg.php');
require('../cfg/res.php');
?>
<table width="98%" border="0" cellpadding="4" cellspacing="0" style="border-collapse:collapse;" >
	<tr align="center">
    	<td>lsub</td>
		<td>codigo</td>
        <td width="80"></td>
		<td>descri</td>
        <td>mrca</td>
        <td>mdlo</td>
        <td>codigov</td>
        <td>numart</td>
        <td>ean13</td>
        <td>pcp1</td>
        <td>pvp1</td>
        <td>disp</td>
    </tr>



<?php
mysql_query('update item0 set item_status="-" where item_status is null',$link_vcrx);
	
$ilist_sql='select *from item00 where item_status!="X" ';

if( isset($_POST['lsub']) &&  !empty($_POST['lsub'])) 
{
	$ilist_sql.=' and item_lsub like"'.$_POST['lsub'].'%"';
}

if( isset($_POST['codigo']) &&  !empty($_POST['codigo'])) 
{
	$ilist_sql.=' and item_codigo like"'.$_POST['codigo'].'%"';
}


if(isset($_POST['descri']) &&  !empty($_POST['descri'])) 
{
	$ilist_sql.=' and item_descri like "'.$_POST['descri'].'%"';
}

if( isset($_POST['mrca']) &&  !empty($_POST['mrca']) )
{
	$ilist_sql.=' and item_mrca like "'.$_POST['mrca'].'%"';
}

if(isset($_POST['mdlo']) &&  !empty($_POST['mdlo'])) 
{
	$ilist_sql.=' and item_mdlo like "'.$_POST['mdlo'].'%"';
}

if(isset($_POST['codigov']) &&  !empty($_POST['codigov']) )
{
	$ilist_sql.=' and item_codigov like "'.$_POST['codigov'].'%"';
}



$ilist_sql.=' order by item_lsub,item_codigo ';


// echo $ilist_sql;
$ilist_res=mysql_query($ilist_sql,$link_vcrx);
$linea=1;




while($ilist_r=mysql_fetch_assoc($ilist_res)){?>
	<tr valign="top" <?php if($linea==3){echo 'style="border-bottom:#000 1px dotted;"';$linea=1;}else{$linea++;} ?>>
    	<td><?php echo $ilist_r['lsub_descri'];?></td>
        <td>
        <?php echo $ilist_r['item_codigo'];?>
        </td>

<?php
//if (mb_stristr('gnya.gmny',$_SESSION['user_vcrx_empr']))
//{
?>
<?php
//}
?>
        <td>
        <a href="fitem.php?idx=<?php echo $ilist_r['item_codigo'];?>"  target="_blank"><img src="http://vcrxol.com/_img/print2.png" width="20"/></a>
		
        <input type="image"  src="http://vcrxol.com/_img/barcode.png" width="20"  title="Imprimir ETQ <?php echo $ilist_r['item_codigo'];?>" onclick="abriretiqueta(<?php echo $ilist_r['item_codigo'];?>);" />
        
        
	    </td>
        <td><?php echo $ilist_r['item_descri'];?></td>
        <td><?php echo $ilist_r['item_mrca'];?></td>
        <td><?php echo $ilist_r['item_mdlo'];?></td>
        <td><?php echo $ilist_r['item_codigov'];?></td>
        <td><?php echo $ilist_r['item_numpart'];?></td>
        <td><?php echo $ilist_r['item_ean13'];?></td>
        <td align="right"><?php echo $ilist_r['item_pcp1'];?></td>
        <td align="right"><?php echo $ilist_r['item_pvp1'];?></td>
        <td align="right"><?php echo $ilist_r['item_codigo'];?></td>
    </tr>

<?php }
mysql_close($link_vcrx);
unset($ilist_r);
unset($ilist_res);
unset($ilist_sql);
unset($_POST['crit']);
unset($_POST['ordena']);

?>
</table>