<?php
require('../cfg/res.php');
$prov_sql='select *from prov1 where atrznume="'.$_POST['idx'].'"';
$prov_res=mysql_query($prov_sql,$link_vcrx);
if(mysql_num_rows($prov_res)==0){die('No se encontro Registro!');}
$atrznume='';
$claveacc='';
$docu='';
$ptoe='';
$numero='';
$enti='';
$fecha='';
$idnum1='';

$atrznume=$_POST['idx'];
$claveacc=mysql_result($prov_res,0,'claveacc');
$docu=mysql_result($prov_res,0,'docu');
$ptoe=mysql_result($prov_res,0,'ptoe');
$numero=mysql_result($prov_res,0,'numero');
$enti=mysql_result($prov_res,0,'enti');
$fecha=mysql_result($prov_res,0,'fecha');
$idnum1=mysql_result($prov_res,0,'idnum1');

echo '<input type="hidden" id="hdd_atrznume" value="'.$atrznume.'" >';
echo '<input type="hidden" id="hdd_claveacc" value="'.$claveacc.'" >';
echo '<input type="hidden" id="hdd_docu" value="'.$docu.'" >';
echo '<input type="hidden" id="hdd_ptoe" value="'.$ptoe.'" >';
echo '<input type="hidden" id="hdd_numero" value="'.$numero.'" >';
echo '<input type="hidden" id="hdd_enti" value="'.$enti.'" >';
echo '<input type="hidden" id="hdd_fecha" value="'.$fecha.'" >';
echo '<input type="hidden" id="hdd_idnum1" value="'.$idnum1.'" >';

$prov_sql='select *from prov2 where idnum2="'.$idnum1.'"';
$prov_res=mysql_query($prov_sql,$link_vcrx);
?>
<table width="100%">
<tr>
	<th>ITEM1</th>
    <th></th>
    <th>ITEM2</th>
    <th>DESCRI</th>
    <th>CANT</th>
    <th>PUNI</th>
    <th>DCTO</th>
    <th>ICE</th>
    <th>IVA</th>
    <th>CTAS</th>
    <th></th>
    <th></th>
</tr>
<?php while($prov_r=mysql_fetch_assoc($prov_res)){?>
<tr>
	<td><input type="text" id="item1_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['item'];?>" onkeypress="asig_cod(this.id,event);" class="item1_" ></td>
    <td><span id="item1_<?php echo $prov_r['iddet'];?>_descri" style="display:none;"  ></span></td>
    <td><input type="text" id="item2_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['item2'];?>" class="item2_"></td>
    <td><span><?php echo $prov_r['detalle'];?></span></td>
    <td><input type="text" id="cant_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['cant'];?>" class="cant_" ></td>
    <td><input type="text" id="puni_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['puni'];?>" class="puni_" ></td>
    <td><input type="text" id="dcto_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['dcto'];?>" class="dcto_" ></td>
    <td><input type="text" id="ice_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['ice'];?>"  class="ice_" ></td>
    <td><input type="text" id="iva_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['iva'];?>"  class="iva_" ></td>
    <td><input type="text" id="ctas_<?php echo $prov_r['iddet'];?>" value="<?php echo $prov_r['ctas'];?>" onkeypress="asig_cue(this.id,event);" ></td>
    <td><span id="ctas_<?php echo $prov_r['iddet'];?>_descri" style="display:none;"  ></span></td>
    <td><input type="button" value="Guardar" onclick="_guarda('<?php echo $prov_r['idnum2'];?>','<?php echo $prov_r['iddet'];?>');" /></td>
</tr>


<?php }?>
</table>












