<?php include('../cfg/res.php');?>
<div align="center" style="width:1000px;">
<table width="100%" border="1"  cellpadding="2" cellspacing="0" style="font-size:12px; border-collapse:collapse;">
<tr style="border-bottom:solid 2px #000000;">
		<th align="center">Cat</th>
        <th align="center">Pag</th>
		<th align="center">Cod</th>
		<th align="center">PVP</th>
        <th align="center" width="50">U</th>
		<th align="center" width="50">4</th>
		<th align="center" width="50">6</th>
		<th align="center" width="50">8</th>
		<th align="center" width="50">10</th>
		<th align="center" width="50">12</th>
		<th align="center" width="50">XS</th>
		<th align="center" width="50">S</th>
		<th align="center" width="50">M</th>
		<th align="center" width="50">L</th>
		<th align="center" width="50">XL</th>
        
</tr>
<?php
$sql_nctlg='SELECT item_nctlg
from invhoja
GROUP BY item_nctlg
ORDER BY item_nctlg desc LIMIT 2';
//echo $sql_nctlg
$acumxr=1;
$result_nctlg=mysql_query($sql_nctlg,$link_vcrx);
while($row_nctlg=mysql_fetch_assoc($result_nctlg))
{
	$sql_item='select 
	left(item_codigo,6)as codigo,
	item_pctlg,
	item_modelo,
	ROUND(item_pvp1, 2),
	item_puni
	from invhoja 
	where item_nctlg="'.$row_nctlg['item_nctlg'].'"
	group by left(item_codigo,6) order by item_pctlg asc';
	$result_item=mysql_query($sql_item,$link_vcrx);
	
	while($row_item=mysql_fetch_row($result_item))
	{
	?>
	<tr style=" <?php if($acumxr==3){echo 'border-bottom:dotted   2px #000000;';$acumxr=0;}else{$acumxr++;}?>">
    	<td><?php echo $row_nctlg['item_nctlg'];?></td>
        <td><?php echo $row_item[1];?></td>	
        <td><?php echo $row_item[2];?></td>
        <td align="right"><?php echo $row_item[3];?></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        
 	</tr>    
	<?php		
	}
}
?>
</table>
</div>