<?php
function vrcajas1d($grupo,$idnum,$fini,$ffin)
{
	if(isset($_POST['fini']) && !empty($_POST['fini']))
	{$fini=$_POST['fini'];}
	else
	{$fini=date('2000-01-01');}
	
	if(isset($_POST['ffin']) && !empty($_POST['ffin']))
	{$ffin=$_POST['ffin'];}
	else
	{$ffin=date('Y-m-d');}

	
	
	require('../cfg/res.php');
	mysql_query("SET NAMES 'utf8'");

	include('php_gene1.php');


?>


<?php
	$sql_caja0 ='select * from caja0 where caja_codigo= "'.$idnum.'"' ;
    $res_caja0=mysql_query($sql_caja0,$link_vcrx);
// 	echo '<b>'.mysql_result($res_caja0,0,'caja_descri').'</b>';
	
	$sql_caja ='select * from caja11 where caja like "'.$idnum.'%" and fecha>="'.$fini.'" and fecha<="'.$ffin.'" order by fecha desc, idnum1' ;
	//$sql_caja ='select * from caja12 where caja="'.$idnum.'" and fecha<="'.$ffin.'" order by fecha desc, idnum1' ;
// 	echo $sql_caja; 
        $res_caja=mysql_query($sql_caja,$link_vcrx);

?>

<div style="overflow-y:scroll; height:250px; font-size:12px;">
<!-- <table>
<tr>
</tr>	
</table>	 -->
<?php $pcaption='CTA.BANC.';$ptabla='caja'; $pcodigo=$idnum; include ('vrsaycod.php');	?>

<table id="tabla_cajas1"  border="0" width="100%" cellpadding="2" cellspacing="0" style="border-collapse:collapse">

<tr align="center" valign="top" style="background: #F7F7F7; border-top:solid 1px#000;border-bottom:solid 1px#000">


	<th width ="4%"></th>
	<th>DOCU</th>
	<th>NUMERO</th>
	<th>FECHA</th>
	<th>DEBITOS</th>
	<th>CREDITOS</th>
	<th>.</th>
	<th>CSUB</th>
	<th>CONCEPTO /DETALLE</th>
	<th>ENTIDAD</th>
	<th>ST</th>
</tr>
<?php 
$filax=0; 

while($r_caja=mysql_fetch_assoc($res_caja))
{ ?>

	
<tr valign="top" style=" <?php if($filax!=3){$filax++;}else{echo 'border-bottom:dotted 1px #000000;'; $filax=0;}?> ">
<td>
<a href="../lib/celectop1.php?docu=<?php echo $r_caja['docu']; ?>&idnum=<?php echo $r_caja['idnum1']; ?>&formato=1" target="_blank">
	<img src="../img/print2.png" width="20"  title="Documento : <?php echo $r_caja['docu'];?>-<?php echo $r_caja['numero'];?>"  /></a>
<a href="../lib/celectop1.php?docu=<?php echo $r_caja['docu']; ?>&idnum=<?php echo $r_caja['idnum1']; ?>&formato=2" target="_blank">
	<img src="../img/print2.png" width="20"  title="Diario : <?php echo $r_caja['docu'];?>-<?php echo $r_caja['numero'];?>"  /></a>
	</td>
  <td align="center"><?php echo $r_caja['docu']; ?></td>
  <td align="center"><?php echo '<span title="'.$r_caja['ptonumero'].'">'.$r_caja['numero']; ?></td>
  <td align="center"><?php echo $r_caja['fechadmy']; ?></td>
  <td align="right"><?php if($r_caja['tingreso']!=0){echo number_format($r_caja['tingreso'],2);} ?></td>
  <td align="right"><?php if($r_caja['tegreso']!=0){echo '<i>'.number_format($r_caja['tegreso'],2);} ?></td>
  <th></th>
  <td align="center"><?php echo $r_caja['csub']; ?></td>
  <td align="left"><?php echo $r_caja['concepto'].' /'.$r_caja['detalle']; ?></td>
  <td align="left"><?php echo $r_caja['enti_descri']; ?></td>
  <td align="center"><?php echo $r_caja['status']; ?></td>


</tr>

<?php }?>

</table>
<hr/>

<div>

<?php }?>