<?php
require_once ("../../config/Cado.php");
require_once ("cProveedor.php");
$oProveedor = new cProveedor();
//echo $_POST['hdd_fil_pro_id'].'--'.$_POST['txt_fil_pro'];
$dts1=$oProveedor->filtrar($_POST['hdd_fil_pro_id'],$_POST['txt_fil_pro']);
$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;">
	
	<div class="table-responsive">
				
          <table id="tabla_proveedor2" class="table table-bordered table-striped">
             <thead>
                <tr>
				   <th>&nbsp;</th>
                  <th>ALIAS</th>               
                  <th>PROVEEDOR</th>               
                  <th>RUC/DNI</th>
                  <th>DIRECCION</th>
                  <!--<th>CONTACTO</th>-->
                  <th>TELEFONO</th>
                  <th>EMAIL</th>
                  <th align="center">ID</th>
               
              </tr>
          </thead>
          <?php
          if($num_rows>=1){
            ?>  
            <tbody>
        <?php
        while($dt1 = mysqli_fetch_array($dts1)){?>
        <tr>
		<td align="center" nowrap="nowrap">
       
	<button class="btn btn-sm btn-primary" onClick="proveedor_form('editar','<?php echo $dt1['tb_proveedor_id']?>')" ><i class="fas fa-edit"></i></button>
	<button class="btn btn-sm btn-danger" onClick="eliminar_proveedor('<?php echo $dt1['tb_proveedor_id']?>')" ><i class="fas fa-trash"></i></button>
	<button class="btn btn-sm btn-success" onClick="proveedorCuentas_form('<?php echo $dt1['tb_proveedor_id']?>')" ><i class="fas fa-credit-card"></i></button>
		
		</td>
		
          <td><?php echo $dt1['tb_proveedor_alias']?></td>                            
          <td nowrap ><?php echo $dt1['tb_proveedor_nom']?></td>                            
          <td><?php echo $dt1['tb_proveedor_doc']?></td>
          <td nowrap ><?php echo $dt1['tb_proveedor_dir']?></td>
          <!--<td><?php echo $dt1['tb_proveedor_con']?></td>-->                     
          <td><?php echo $dt1['tb_proveedor_tel']?></td>
          <td><?php echo $dt1['tb_proveedor_ema']?></td>
          <td align="center" nowrap="nowrap"><?php echo $dt1['tb_proveedor_id']?></td>
          
    </tr>
    <?php
}
mysqli_free_result($dts1);
?>
</tbody>
            <?php }?>
        </table>
    </div>
</div>
</div>
</div>
</div>
</div>
</section>
<script type="text/javascript">
  $(function() {  
  
	
	  $('#tabla_proveedor2').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>