<script src="https://cdn.datatables.net/buttons/1.6.1/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.flash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.print.min.js"></script>
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        Gestionar Clientes
                    </h1>
                       <ol class="breadcrumb">
                        <li><a href="<?=base_index();?>"><i class="fa fa-dashboard"></i> Inicio</a></li>
                        <li><a href="<?=base_index();?>clientes">Clientes</a></li>
                        <li class="active">Listado Clientes</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                  <h3 class="box-title">Lista Clientes</h3>
                                  <?php
       foreach ($db->fetch_all("sys_menu") as $isi) {
                      if ($path_url==$isi->url) {
                          if ($role_act["insert_act"]=="Y") {
                    ?>
          <a href="<?=base_index();?>clientes/tambah" class="btn btn-primary btn-flat col-lg-offset-9 col-md-offset-8 col-sm-offset-6 col-xs-offset-6"><i class="fa fa-plus"></i> Nuevo</a>
                          <?php
                          } 
                       } 
}
?> 
                                </div><!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="dtb_manual" class="table table-bordered table-striped">
                                   <thead>
                                     <tr>
                           <th style="width:25px" align="center">No</th>
                          <th>Nombres</th>
													<th>Apellidos</th>
													<th>Fecha Nacimiento</th>
													<th>Dirección</th>
													<th>Teléfono</th>
													<th>Celular</th>
													<th>Email</th>
													
                          <th>Acción</th>
                         
                        </tr>
                                      </thead>
                                        <tbody>
                                         <?php 
      $dtb=$db->fetch_custom("SELECT clientes.idclientes, clientes.ciudad_idciudad, clientes.identificacion, clientes.nombres, clientes.apellidos, clientes.direccion, clientes.tel, clientes.cel, clientes.email, clientes.fechana FROM clientes ");
      $i=1;
      foreach ($dtb as $isi) {
        ?><tr id="line_<?=$isi->idclientes;?>">
        <td align="center"><?=$i;?></td><td><?=$isi->nombres;?></td>
<td><?=$isi->apellidos;?></td>
<td><?=$isi->fechana;?></td>
<td><?=$isi->direccion;?></td>
<td><?=$isi->tel;?></td>
<td><?=$isi->cel;?></td>
<td><?=$isi->email;?></td>

        <td>
        <a href="<?=base_index();?>clientes/detail/<?=$isi->idclientes;?>" class="btn btn-success btn-flat"><i class="fa fa-eye"></i></a> 
        <?=($role_act["up_act"]=="Y")?'<a href="'.base_index().'clientes/edit/'.$isi->idclientes.'" class="btn btn-primary btn-flat"><i class="fa fa-pencil"></i></a>':"";?>  
        <?=($role_act["del_act"]=="Y")?'<button class="btn btn-danger hapus btn-flat" data-uri="'.base_admin().'modul/clientes/clientes_action.php" data-id="'.$isi->idclientes.'"><i class="fa fa-trash-o"></i></button>':"";?>
        </td>
        </tr>
        <?php
        $i++;
      }
      ?>
                                        </tbody>
                                    </table>
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
                        </div>
                    </div>
        <?php
       /*foreach ($db->fetch_all("sys_menu") as $isi) {
                      if ($path_url==$isi->url) {
                          if ($role_act["insert_act"]=="Y") {
                    ?>
          <a href="<?=base_index();?>clientes/tambah" class="btn btn-primary btn-flat"><i class="fa fa-plus"></i> Nuevo</a>
                          <?php
                          } 
                       } 
}*/
?>  
                </section><!-- /.content -->
<script>
$(document).ready(function() {
    $('#dtb_manual').DataTable( {
        dom: 'Blfrtip',
        buttons: [
            {
                extend: 'excelHtml5',
                autoFilter: true,
                text:'<i class="fa fa-file-excel-o"></i> Excel',
                title: 'clientes'
            },
            {
                extend: 'pdfHtml5',
                text:'<i class="fa fa-file-pdf-o"></i> PDF',
                title: 'clientes'
            }
        ]
    } );
} );
</script>       
