<?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>
		<a href="projet.php"> 
			<button class="btn btn-primary btn-sm float-right" tabindex="0" aria-controls="reports_table" type="button" title="Projet">Projet </button>
		</a>
<h2>Liste des clients (patients)</h2>

 <p> Enregistrer toutes les informations necessaires</p>
 
 <div class="container-fluid">
                    
<div class="card card-primary card-outline">
    
    <!-- /.card-header -->
<div class="card-body">
		<div class="row">
		
		<div class="col-lg-12 table-responsive">
		    <div id="reports_table_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">





<div class="row">
<div class="col-sm-4">
<div class="dataTables_length" id="reports_table_length">
	<a href="createuser.php"> 
					<button class="btn btn-primary btn-sm " tabindex="0" aria-controls="reports_table" type="button" title="">Créer </button>
				</a>
	</div>
</div>


	<div>
		<div class="dt-buttons btn-group flex-wrap"> 
				<a href="createuser.php"> 
						<button class="btn btn-primary btn-sm " tabindex="0" aria-controls="reports_table" type="button" title="">Exporter </button>
				</a>	
				<a href="createuser.php"> 
						<button class="btn btn-primary btn-sm" tabindex="0" aria-controls="reports_table" type="button" title="">Importer </button>
				</a>	
				<a href="createuser.php"> 
						<button class="btn btn-second btn-sm " tabindex="0" aria-controls="reports_table" type="button" > Actualiser</button> 
				</a>	
		</div>
	</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>

<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"> 
			<thead>
				<tr role="row"><th class="sorting_disabled" rowspan="1" colspan="1" style="width: 14px;" width="10px">Raison 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>01023323236</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>0101212525</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>0778284389</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 4 -->		

		<tbody>
              <tr role="row" class="odd"><td>kone aymeric bernard </td>
			  <td>78284389</td><td>konebernard2014@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 4 -->


         </table>
		  
		  

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

 
 </div>
 
   <div class="card-footer2">
		 
            <div class="col-lg-12">
				  <a href=""><button type="submit" class="btn btn-second" style="border: 1px solid #adb0bb8f;border-radius: 1.25rem;"> Précédent </button></a>
                  <a href=""><button type="submit" class="btn btn-second" style="border: 1px solid #adb0bb8f;border-radius: 1.25rem;"> Suivant</button></a>
            </div>
        </div>
 
 </div></div>
       </div>
    <!-- /.card-body -->
  </div>

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