<?php require 'inc/includes.php'; 

    
$nbr = $DB->query("SELECT count(*) as nbr FROM users");
$perpage = 4;
$nbr_pages = ceil($nbr[0]->nbr/$perpage );

if(isset($_GET['page'])){
	$page = intval($_GET['page']);
	if($page > $nbr_pages){
		$page = $nbr_pages;
	}
}else{
	$page =1;
}

$premierPage = ($page-1) *$perpage;

$users= $DB->query("SELECT id,username,email,avatar FROM users ORDER BY created_at ASC LIMIT ".$premierPage.",".$perpage."");

  require 'inc/header.php'; ?>

<section>
<article>

<h2>Liste Des Clients</h2>
 <p></p>
 
 <div class="container-fluid">
                    
<div class="card card-primary card-outline">
    
    <!-- /.card-header -->
<div class="card-body">
    <div id="reports_table_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
		<div class="row">
		
		<!-- Le bouton de gauche sans titre -->
	    <div class="col-sm-4">
			<div class="dt-buttons btn-group flex-wrap">
				<a href="createuser.php"> 
					<button class="btn btn-primary btn-sm float-right" tabindex="0" aria-controls="reports_table" type="button" title="">Créer </button>
				</a>	
			</div>
       </div>
	  
		<!-- Fin du bouton de gauche sans titre -->
	  
	   <!-- Les boutons du centre avec le titre -->
<div class="col-sm-4">
			<div class="dt-buttons btn-group flex-wrap">
				<a href="createuser.php"> 
					<button class="btn btn-primary btn-sm float-right" tabindex="0" aria-controls="reports_table" type="button" title="">Exporter </button>
				</a>	
			</div>
	
			<div class="dt-buttons btn-group flex-wrap">
				<a href="createuser.php"> 
					<button class="btn btn-primary btn-sm float-right" tabindex="0" aria-controls="reports_table" type="button" title="">Importer </button>
				</a>	
			</div>
			
			<span ><!--  faire une fonction javascript -->
				<a href="createuser.php">  Actualiser</a>	
			</span>
	
	<!-- FIN Les boutons du centre avec le titre -->
 </div>
 
<div class="col-sm-4">
	<div id="reports_table_filter" class="dataTables_filter"><label><input type="search" class="form-control form-control-sm" placeholder="Rechercher" aria-controls="reports_table"></label>
	
	</div></div>
	
	
</div>

<div class="row">
	<div class="col-sm-12">
	
	<!-- 	DEBUT TITRES TABLEAU -->		
 
		<table id="reports_table" class="table table-striped table-hover table-bordered dataTable no-footer" role="grid" aria-describedby="reports_table_info" style="width: 100%;" width="100%"> 
			<thead>
				<tr role="row"><th class="sorting_disabled" rowspan="1" colspan="1" style="width: 14px;" width="10px">Rôle sociale</th>
				<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 184px;">Téléphone</th>
				<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 300px;">Email</th>
				<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 300px;">Enregistrer le</th>
				<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 242px;">Actions</th>
			</thead>
			
			
		<!-- 	FIN TITRES TABLEAU -->		
		
		<!-- 	DEBUT COLONNE 1 -->		

		<tbody>
              <tr role="row" class="odd"><td>Unité de parasitologie</td>
			  <td>023323236</td><td>receptionist@lab.com</td>
			  <td>08/10/2020</td>
			  
			  <td><a href="editprofil.php" class="btn btn-primary btn-sm"> 
			     <i class="fa fa-edit"></i> 
					</a><form method="GET" action="admin/users/9" class="d-inline">
					<button type="submit" class="btn btn-danger btn-sm delete_user">
						<input type="hidden" name="_method" value="delete">
							<i class="fa fa-trash"></i>
					</button>  </form>
			    </td>
				</tr>
		</tbody>
		
		<!-- 	FIN COLONNE 1 -->
		
		<!-- 	DEBUT COLONNE 2 -->		

		<tbody>
              <tr role="row" class="odd"><td>UEMOA</td>
			  <td>01212525</td>
			  <td>uemoa@pasteur.ci</td>
			  <td>31/01/2018</td>
			  
			  <td><a href="editprofil.php" class="btn btn-primary btn-sm"> 
			     <i class="fa fa-edit"></i> 
					</a><form method="GET" action="admin/users/9" class="d-inline">
					<button type="submit" class="btn btn-danger btn-sm delete_user">
						<input type="hidden" name="_method" value="delete">
							<i class="fa fa-trash"></i>
					</button>  </form>
			    </td>
				</tr>
		</tbody>
		
		<!-- 	FIN COLONNE 2 -->
		
		<!-- 	DEBUT COLONNE 3 -->		

		<tbody>
              <tr role="row" class="odd"><td>kone patrick</td>
			  <td>78284389</td><td>konepatrick2014@gmail.com</td>
			  <td>08/10/2020</td>
			  
			  <td><a href="editprofil.php" class="btn btn-primary btn-sm"> 
			     <i class="fa fa-edit"></i> 
					</a><form method="GET" action="admin/users/9" class="d-inline">
					<button type="submit" class="btn btn-danger btn-sm delete_user">
						<input type="hidden" name="_method" value="delete">
							<i class="fa fa-trash"></i>
					</button>  </form>
			    </td>
				</tr>
		</tbody>
		
		<!-- 	FIN COLONNE 3 -->
<!-- 	DEBUT COLONNE 3 -->		

		<tbody>
              <tr role="row" class="odd"><td>Aliman adobi </td>
			  <td>78284389</td><td>alimanadobi@gmail.com</td>
			  <td>08/10/2020</td>
			  
			  <td><a href="editprofil.php" class="btn btn-primary btn-sm"> 
			     <i class="fa fa-edit"></i> 
					</a><form method="GET" action="admin/users/9" class="d-inline">
					<button type="submit" class="btn btn-danger btn-sm delete_user">
						<input type="hidden" name="_method" value="delete">
							<i class="fa fa-trash"></i>
					</button>  </form>
			    </td>
				</tr>
		</tbody>
		
		<!-- 	FIN COLONNE 3 -->


         </table>
		  
		  

</div>
 
 <!-- 		  Zone page  -->		 

 
 </div>
 <div class="row><div class="col-sm-8"><div class="dataTables_paginate paging_simple_numbers" id="reports_table_paginate"><ul class="pagination"><li class="paginate_button page-item previous disabled" id="reports_table_previous"><a href="#" aria-controls="reports_table" data-dt-idx="0" tabindex="0" class="page-link">Précédent</a></li><li class="paginate_button page-item active"><a href="#" aria-controls="reports_table" data-dt-idx="1" tabindex="0" class="page-link">1</a></li><li class="paginate_button page-item "><a href="#" aria-controls="reports_table" data-dt-idx="2" tabindex="0" class="page-link">2</a></li><li class="paginate_button page-item "><a href="#" aria-controls="reports_table" data-dt-idx="3" tabindex="0" class="page-link">3</a></li><li class="paginate_button page-item "><a href="#" aria-controls="reports_table" data-dt-idx="4" tabindex="0" class="page-link">4</a></li><li class="paginate_button page-item "><a href="#" aria-controls="reports_table" data-dt-idx="5" tabindex="0" class="page-link">5</a></li><li class="paginate_button page-item "><a href="#" aria-controls="reports_table" data-dt-idx="6" tabindex="0" class="page-link">6</a></li><li class="paginate_button page-item next" id="reports_table_next"><a href="#" aria-controls="reports_table" data-dt-idx="7" tabindex="0" class="page-link">Suivant</a></li></ul></div></div></div></div>
       </div>
    <!-- /.card-body -->
  </div>

          <input type="hidden" id="system_currency" value="USD">
        </div>
 
<!-- LES INPUTS HORIZONTAL -->
</article>
</section>

  <!-- jQuery -->
<script src="https://extremelab.tech/plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="https://extremelab.tech/plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Bootstrap 4 -->
<script src="https://extremelab.tech/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- ChartJS -->
<script src="https://extremelab.tech/plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="https://extremelab.tech/plugins/sparklines/sparkline.js"></script>
<!-- jQuery Knob Chart -->
<script src="https://extremelab.tech/plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="https://extremelab.tech/plugins/moment/moment.min.js"></script>
<script src="https://extremelab.tech/plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="https://extremelab.tech/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="https://extremelab.tech/plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="https://extremelab.tech/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="https://extremelab.tech/dist/js/adminlte.js"></script>
<!-- DataTables -->
<script src="https://extremelab.tech/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-fixedheader/js/dataTables.fixedHeader.min.js" type="text/javascript"></script>
<script src="https://extremelab.tech/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="https://extremelab.tech/plugins/jszip/jszip.min.js"></script>
<script src="https://extremelab.tech/plugins/pdfmake/pdfmake.min.js"></script>
<script src="https://extremelab.tech/plugins/pdfmake/vfs_fonts.js"></script>
<script src="https://extremelab.tech/plugins/datatables-buttons/js/buttons.php5.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="https://extremelab.tech/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<!-- Toastr-->
<script src="https://extremelab.tech/js/toastr.min.js"></script>
<!-- Validate -->
<script src="https://extremelab.tech/plugins/jquery-validation/jquery.validate.min.js"></script>
<script src="https://extremelab.tech/plugins/print/jQuery.print.min.js"></script>
<script src="https://extremelab.tech/js/jquery.classyqr.min.js"></script>
<script src="https://extremelab.tech/js/select2.js"></script>
<script src="https://extremelab.tech/plugins/sweet-alert/sweetalert.min.js"></script>
<!-- Scripts Translation -->

<!-- Main dashboard -->
  <script src="https://extremelab.tech/js/admin/main.js"></script>
<!-- Flash messages -->
<script>
    </script>

    <!-- Switch -->
  <script src="https://extremelab.tech/plugins/swtich-netliva/js/netliva_switch.js"></script>
  <script src="https://extremelab.tech/js/admin/dashboard.js"></script>
  
  <script src="//code.tidio.co/wm6kjlncgktzimpuaad5qetmtv9h1cui.js" async></script>

</body>
</html>