<?php
// ini_set("display_errors",1);
session_start();
require_once ("../../config/Cado.php");
require_once ("../cajagestion/cCajagestion.php");
$oCajagestion = new cCajagestion();
require_once("../formatos/formato.php");
$fecha1 = $_POST['txt_fil_cajges_fec1']; 
$fecha2 = $_POST['txt_fil_cajges_fec2']; 

$dts1=$oCajagestion->mostrar_filtro(fecha_mysql($fecha1),fecha_mysql($fecha2),$_SESSION['usuario_id']);	
			
$num_rows= mysqli_num_rows($dts1);
?>
<section class="content">
	<div class="container-fluid">
	<div class="row">
	    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		    <div class="card">
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding:5px;">
	
	
	
	<a title="VER DESCARGAR Y/O IMPRIMIR PDF" data-toggle="tooltip" data-placement="top"  
href="../../files/cajagestion/cajagestion_impcpe_doc.php?fec1=<?php echo fecha_mysql($fecha1); ?>&fec2=<?php echo fecha_mysql($fecha2); ?>
&usu_id=<?php echo $_SESSION['usuario_id']; ?>" target="_blank" class="btn btn-sm" 
style="background-color:#3B71CA;color:#fff;" title="DESCARGAR E IMPRIMIR PDF"><i class="fas fa-file-pdf"></i> DESCARGAR E IMPRIMIR </a>		 
				
	
	
					<div class="table-responsive">
	
          <table id="tabla_ingreso" class="table table-bordered table-striped">
           <thead>
        <tr>
		
          <th nowrap title="Fecha">FECHA</th>
          <th nowrap title="Fecha">TIPO</th>
          <th>EFECTIVO</th>
          <th>TRASFERENCIA/DEPOSITO</th>
          <th>YAPE</th>
          <th>PLIN</th>
          <th align="right">USUARIO</th>
         
          </tr>
        </thead> 
      <tbody>
<?php
while($dt1 = mysqli_fetch_array($dts1)){
	
	$tip = "";
	
	if($dt1["tb_cajagestion_tip"]==1){
		$tip = "APERTURA CAJA";
	}ELSE if($dt1["tb_cajagestion_tip"]==2){
		$tip = "CIERRE CAJA";
	}
	
	
  
?>
        <tr>
		<td align="center" class="d-none" nowrap="nowrap">
            <button class="btn btn-info" style="padding:2px 5px;margin:0px 2px" onClick="ingreso_form('editar','<?php echo $dt1['tb_ingreso_id']?>')"><i class="fa fa-edit"></i></button>
             <button  class="btn btn-danger" style="padding:2px 5px;margin:0px 2px" onClick="ingreso_eliminar('<?php echo $dt1['tb_ingreso_id']?>')"><i class="fa fa-trash"></i></button> 
        </td>
		
          <td nowrap="nowrap"><?php echo mostrarFecha($dt1['tb_cajagestion_fec'])?></td>
          
          <td nowrap ><?php echo $tip; ?></td>
          <td nowrap ><?php echo formato_money($dt1['tb_cajagestion_efe']); ?></td>
          <td nowrap ><?php echo formato_money($dt1['tb_cajagestion_deptra']); ?></td>
          <td nowrap ><?php echo formato_money($dt1['tb_cajagestion_yap']); ?></td>
          <td nowrap ><?php echo formato_money($dt1['tb_cajagestion_pli']); ?></td>
          <td align="center" nowrap="nowrap"><?php echo $dt1['tb_usuario_nom']?></td>
          

          </tr>
<?php
}
mysqli_free_result($dts1);
?>
    </tbody>
   
        </table>
      </div>
    </div>
    </div>
  </div>
</div>
</div>
</section>
<script type="text/javascript">
  $(function() {  
  
	 $('#tabla_ingreso').DataTable({
 
        "language": {
                "lengthMenu": "Mostrar _MENU_ registros",
                "zeroRecords": "No se encontraron resultados",
                "info": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
                "infoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
                "infoFiltered": "(filtrado de un total de _MAX_ registros)",
                "sSearch": "Buscar:",
                "oPaginate": {
                    "sFirst": "Primero",
                    "sLast":"Último",
                    "sNext":"Siguiente",
                    "sPrevious": "Anterior"
			     },
			     "sProcessing":"Procesando...",
            }
    });  
	
	
  }); 
</script>  