<?php
require_once ("../../config/Cado.php");
require_once ("cIgv.php");
$oIgv = new cIgv();

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

$dts=$oIgv->mostrarTodos();
$num_rows= mysqli_num_rows($dts);
mysqli_free_result($dts);
?>
<style type="text/css">
.div_muestra{
width:10px;
height:10px;	
}
</style>

<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">
		
        <table id="tabla_Igv" class="table table-bordered table-striped">
                <thead>
                    <tr>
						<th>&nbsp;</th>
                        <th>MES / AÑO</th>
                        <th>MONTO %</th>  
                        <th>ID</th> 
                    </tr>
                </thead>
                <?php
                if($num_rows>0){
                    ?>
                    <tbody>
                        <?php
                        $dts1=$oIgv->mostrarTodos();
                        $num_rows1= mysqli_num_rows($dts1);
                        if($num_rows1>0){
                            while($dt1 = mysqli_fetch_array($dts1)){
                                ?>
                                <tr class="even">
									<td nowrap align="center">
										<span class="btn btn-sm btn-primary" onClick="igv_form('editar','<?php echo $dt1['tb_igv_id']?>')" ><i class="fas fa-edit"></i></span>
										<span class="btn btn-sm btn-danger" onClick="eliminar_igv('<?php echo $dt1['tb_igv_id']?>')" ><i class="fas fa-trash"></i></span>
									</td>
                                    <td><strong style="font-size:15px;" ><?php echo nombre_mes($dt1['tb_igv_mes']).' / '.$dt1['tb_igv_anio']?></strong></td>
                                    <td><strong style="font-size:15px;" title="<?php echo $dt1['tb_igv_id']?>"><?php echo $dt1['tb_igv_dat']?></strong></td>
                                    <td align="center"><?php echo $dt1['tb_igv_id']?></td>
                                </tr>
	<?php 
    }
    mysqli_free_result($dts1);
    }
    ?>
</tbody>
<?php }?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

<script type="text/javascript">
    $(function() { 	  
	  
	   $('#tabla_Igv').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>