<?php 
 include('../_cfg/config.php');
 include('php_gene1.php');
 include('php_session.php');
?>
<?php $xenti=$_POST['enti']; ?>
<?php $xplan=$_POST['plan']; ?>
<?php $xplan=fillzero($xplan*1); ?>

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

<?php
      $sql_docu ='select * ';
      $sql_docu.='from '.$tabla.'12 ';
      $sql_docu.='where docu like "'.$xdocu2.'%"  ';
      $sql_docu.=' and enti like "'.substr($xenti,0,10).'%" ';
      if($xplan*1>0)
      {$sql_docu.=' and numero = "'.$xplan.'" ';}
      $sql_docu.=' and asub not like "%0000"';
      $sql_docu.=' and status!="O" and status!="X" ';
      $sql_docu.='order by fecha desc, asub ';
//       $sql_docu.='limit 5';
      $res_docu=msql_query($sql_docu,$link_vcrx);
   
   
//       echo '<msgalert>';
//    echo $sql_docu;
//    echo msql_error();
//       echo '</msgalert>';
   
?>  
<?php
      echo '<'.$dltag.'>'; 
      while($aso_docu=msql_fetch_assoc($res_docu))
      {
         {
          $xvalue =$aso_docu['asub'];
          
          $xoption =$aso_docu['asub'];
//           $xoption.=' /'.$aso_docu['fecha'];
          $xoption.=' -'.$aso_docu['asub_descri'];
          
//           $xvalue=$xoption;
          
          $option ='';
          $option.='<option value="'.$xvalue.'">';
          $option.=$xoption;
          $option.='</option>';
          echo $option;
        }
      }
    
      echo '</'.$dltag.'>'; 
    
?>    
    
<!--   </datalist> -->
<!--   </dl_cxpa> -->

</resultado>


