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

<resultado>
  
<?php $valor0=1/100; ?>  
<?php $xsaldo=0; ?>
  
  <?php 
   
      $dltag='dl_plan';
      $tabla='plan';
      $xdocu2='PLA1';
   
  ?>

<?php
      $sql_docu ='select * ';
      $sql_docu.='from '.$tabla.'12 ';
      $sql_docu.='where enti like "'.substr($xenti,0,10).'%" ';
      $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';
      $res_docu=msql_query($sql_docu,$link_vcrx);
   
?>  
  
  

  
  
<?php
      echo '<'.$dltag.'>'; 
      while($aso_docu=msql_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 =$xnumero;
          $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);
          
//           $xvalue.=$xoption;
//           $xvalue=$xoption;
            
          $option ='';
          $option.='<option value="'.$xvalue.'">';
          $option.=$xoption;
          $option.='</option>';
          echo $option;
        }
      }
    
      echo '</'.$dltag.'>'; 
    
?>    
    
<!--   </datalist> -->
<!--   </dl_cxpa> -->

</resultado>


