<?php include('../cfg/res.php');?>
<div style="">
<table width="90%" border="0" id="tabla_pedido" cellpadding="5" cellspacing="5" style="border-collapse:collapse;" >
<?php

$filax=1;

$sql_item='select 
left(item_codigo,6)as codigo,
ROUND(item_pvp1, 2) as pvpx,
invcarr.*
from invcarr 
group by left(item_codigo,6) order by item_pctlg';
$result_item=mysql_query($sql_item,$link_vcrx);
while($row_item=mysql_fetch_assoc($result_item))
{
	if (file_exists("../ctlg/".$row_item['item_modelo'].".png")==1)
	{
?>

	<tr valign="middle" style=" font: Arial, Helvetica, sans-serif;">
	<td width="7%" align="center"><img src="../ctlg/<?php echo $row_item['item_modelo'];?>.png" width="200" /></td>
    <td width="27%" align="left">
    <div><?php echo 'cod.'. $row_item['item_modelo'];?></div>
    <div><?php echo $row_item['item_descrim'];?></div>
	<div><?php echo '$'. $row_item['pvpx'];?></div>
	
	<?php
	$sql_talla='select item_codigo,item_codigov,RIGHT(item_codigo,2) as talla from invcarr where item_codigo like "'.$row_item['codigo'].'%"
	 order by talla asc ';
	//echo $sql_talla;
	$res_talla=mysql_query($sql_talla,$link_vcrx);
	while($row_talla=mysql_fetch_assoc($res_talla))
	{
		if(mb_stristr('00.90.91.92.93.94.04.06.08.10.12' ,$row_talla['talla']))
		{
	?>	
 		<input type="image"  src="http://vcrxol.com/_img/<?php echo $row_talla['talla'];?>.png" name="<?php echo $row_item['codigo'];?>" title="Agregar al Carrito - <?php echo $row_talla['item_codigov'];?>" id="<?php echo $row_talla['item_codigo'];?>" onclick="add_car(this.id);" class="btn_img" />
   <?php 
		}
	}
?> 
 </td>
 </tr>


<tr>
<td><hr></td>
<td></td>
</tr>

<?php
	}
}
?>

</table>
</div>
<?php if($_GET['opt']=='hped'){ require('../../_lib/valdatenti.php'); $valdatentix=new valdatenti('../cfg/res.php',$_SESSION['user_vcrx_id']);}?>
<script type="text/javascript">
function add_car(id)
{
	var errorx;
if(confirm("¿Agregar al Carrito?")) 
{
	
		$.ajax({
		cache:false,
		url:'../lib/vrshopcar1.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{ite:id}, 
    	beforeSend: function(jqXHR, textStatus)
		{
			document.getElementById(id).style.cursor='wait';
			document.body.style.cursor='wait';
  /*  	  
		  document.getElementById('frm_reg_error').innerHTML='procesando.....';
	      
	      
		  document.getElementById('reg_btn').style.background='#C1FFFF';
	      document.getElementById('reg_btn').disabled=true;
*/		  
                
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			errorx=dato;
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
    	    	
			document.getElementById(id).style.cursor='pointer';
			document.body.style.cursor='auto';
			}           
		},
		timeout:30000
	});
}
console.log(errorx);
	
}
</script>