<?php

session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
$com = "A";
include("DF30000.inc");
include("DF80000.php");
include("DFJSISCI.inc");
require_once("DFJQUERY.inc");
$sql=mysqli_query($con ,"SELECT descripcion FROM frecomp order by nparte1 desc limit 1");
$row=mysqli_fetch_array($sql);
?>
<?php
 $qry=mysqli_query($con ,"select * from farticulos where t7='".$row['descripcion']."'"); 
$row=array(); 
while($r=mysqli_fetch_assoc($qry)){ 
	$row[]=array($r['np_desc1'],$r['nparte1'],$r['pais'],$r['t3'],$r['cos_prom']);  } ?> 
	 <select name="art" id="art" onfocus="javascript:recargar2();" onChange="document.getElementById('txtunid').value=this.options[this.selectedIndex].getAttribute('medidad');
  document.getElementById('txtclav').value=this.options[this.selectedIndex].getAttribute('claved');  document.getElementById('txtprom').value=this.options[this.selectedIndex].getAttribute('promedio');document.getElementById('txtpre').value=this.options[this.selectedIndex].getAttribute('precio');">
  <option  value="0">---Selecciona---</option> 
<?php
 foreach($row as $v){  
if($_POST['art'] == $v[0]){ ?>
<option medidad="<?php
 echo $v[2] ?>" claved="<?php
 echo $v[1] ?>" precio="<?php
 echo $v[3] ?>" promedio="<?php
 echo $v[4] ?>" value="<?php
 echo $v[0] ?>"><?php
 echo $v[0] ?></option> 
			
 <?php
		}else{ ?>
<option medidad="<?php
 echo $v[2] ?>" claved="<?php
 echo $v[1] ?>" precio="<?php
 echo $v[3] ?>" promedio="<?php
 echo $v[4] ?>" value="<?php
 echo $v[0] ?>"><?php
 echo $v[0] ?></option> 
		 <?php
 }  ?>
    
<?php
 }?> 
  </select> 
  