<?php
require_once ("../../config/Cado.php");
require_once ("cHistorial.php");
$oHistorial = new cHistorial();

require_once("../formatos/formato.php");


$dts=$oHistorial->mostrar_filtro(fecha_mysql($_POST['txt_fil_his_fec1']),fecha_mysql($_POST['txt_fil_his_fec2']),$_POST['txt_fil_docnum'],$_POST['hdd_fil_usu_id']);
$num_rows= mysqli_num_rows($dts);


?>

<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;">
	
				<div class="table-responsive">	
						<?php 
//echo '---- '.mostrar_ip().' -- ';
?>	
        <table id="tabla_historial" class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th nowrap>FECHA REGISTRO</th>
                        <th>MODULO</th>
                        <th>USUARIO</th>
                        <th>DETALLE</th>
                        <th>ID</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <?php
                if($num_rows>0){
                    ?>
                    <tbody>
                        <?php
                            while($dt1 = mysqli_fetch_array($dts)){	
                        ?>
                                <tr class="even" >
                                    <td nowrap ><span style="font-size:14px; font-weight: bold;" ><?php echo $dt1['tb_historial_reg']?></span></td>
                                    <td nowrap ><?php echo $dt1['tb_modulo_nom']?></td>
                                    <td nowrap align="left"><span style="font-size:11px; font-weight: bold;" ><?php echo $dt1['tb_usuario_nom']?></span></td>
                                    <td nowrap align="left"><?php echo $dt1['tb_historial_det']?></td>
                                    <td align="center"><?php echo $dt1['tb_historial_id']?></td>
                                   
                                   
                                    <td nowrap align="center">
										<span title="Eliminar" class="btn btn-sm  btn-primary " onClick="eliminar_Historial('<?php echo $dt1['tb_historial_id']?>')" ><i class="fa fa-trash"></i></span>
								   </td>
                                </tr>
                                
                                      
                                      
                <?php
                                           
				mysqli_free_result($dts1);
				}
	
				?>
</tbody>
<?php }?>
</table>
			
				</div>
			</div>
		</div>
	</div>
	</div>
	</div>
</section>
<script type="text/javascript">
    $(function() { 
        $("#tabla_historial").DataTable( {
          "columnDefs": [
          { "orderable": false, "targets": [2] }
          ],
          "searching": true,
          "order": [[ 5, "desc" ]]
      });
    });
</script>