<?php session_start();
require('../cfg/res.php');
require('../../_lib/vrdocu0.php');
require('../../_lib/vrcajaefec.php');

$doc=new vrdocu0('../cfg/res.php',$_POST['docu']);
//$tabla= $doc->tabla;
$gene1_sql='select * from '.$doc->tabla.'1 where numero > 0 ';

if(!empty($_POST['nini']) && !empty($_POST['nfin']))
{
	$gene1_sql.=' and ( numero > ='.$_POST['nini'].' and numero <= '.$_POST['nfin'].' ) ';
}
if(!empty($_POST['fini']) && !empty($_POST['ffin']))
{
	$gene1_sql.=' and ( fecha >= "'.$_POST['fini'].'" and fecha <= "'.$_POST['ffin'].'" ) ';
}
$gene1_res=mysql_query($gene1_sql,$link_vcrx);

if(mysql_num_rows($gene1_res)==0)
{
	die('No se encontraron resultados');
}

while($gene1_r=mysql_fetch_assoc($gene1_res))
{
	$inve=new vrcajaefec($gene1_r['docu'],$gene1_r['idnum1']);
	//echo $doc->tabla.'-'.$gene1_r['idnum1'];
}
?>