<?php 
 include('../_cfg/config.php');
 include('php_gene1.php');
 include('php_session.php');
?>
<?php $xitem=trim($_POST['item']); ?>
<?php //$xdocu=$_POST['docu']; ?>

<resultado>
  
<?php $valor0=1/100; ?>  
<?php $xsaldo=0; ?>
  
  <?php 
   
      $dltag='dl_lote';
      $tabla='lote';
      $xdocu2='IB';
   
  ?>

<?php
      $sql_docu ='select * ';
      $sql_docu.='from '.$tabla.'12 ';
      $sql_docu.='where item like "'.$xitem.'%" ';
      $sql_docu.=' and docu like "'.$xdocu2.'%"';
//       $sql_docu.=' and asub like "%0000"';
      $sql_docu.=' and status!="O" and status!="X" ';
      $sql_docu.='order by fecha desc ';
//       $sql_docu.='limit 5';
   
   
   
      $sql_docu ='select * ';
      $sql_docu.='from lote0 ';
      $sql_docu.='where lote_status not in ("O","X","I") ';
      if(!empty($xitem))
      {
         $sql_docu.='and lote_codigo in (select distinct lote from inve12 where docu like "IB%" and item like "'.$xitem.'%" and status!="O") ';
      }
//       $sql_docu.=' and status!="O" and status!="X" ';
//       $sql_docu.='order by fecha desc ';
//       $sql_docu.='limit 5';
   
   
      $res_docu=mysql_query($sql_docu,$link_vcrx);
   
?>  
  
  

  
  
<?php
      echo '<'.$dltag.'>'; 
      while($aso_docu=mysql_fetch_assoc($res_docu))
      {

         {
//           $xnumero=$aso_docu['numero'];
//           $xasub0 =substr($aso_docu['asub'],0,4);
//           $xasubdes =$aso_docu['asub_descri'];
            
//           $xconcepto =$aso_docu['concepto'];
//           $xconcepto =str_replace($xasub0,'',$xconcepto);
//           $xconcepto =str_replace($xasubdes,'',$xconcepto);
//           if(empty($xconcepto)){$xconcepto=$xasubdes;}
          

          $xvalue =$aso_docu['lote_codigo'];
//           $xvalue.=' -'.$xasub0;
//           $xvalue.=' -'.$xasubdes;
            
//           $xoption ='';
// //           $xoption.=.'-'.$aso_docu['numero'];
// //           $xoption.=' -'.$aso_docu['fecha'];
// //           $xoption.=' -'.$xasub0;
//           $xoption.=' -'.$xconcepto;
//           $xoption=str_replace('--','-',$xoption);
//           $xoption=str_replace('--','-',$xoption);
          $xoption =$aso_docu['lote_descri'];
          
//           $xvalue.=$xoption;
//           $xvalue=$xoption;
            
          $option ='';
          $option.='<option value="'.$xvalue.'">';
          $option.=$xoption;
          $option.='</option>';
          echo $option;
        }
      }
    
      echo '</'.$dltag.'>'; 
    
?>    
    
<!--   </datalist> -->
<!--   </dl_cxpa> -->

</resultado>


