<?php
$load = new load;
?>
<!-- Main Content -->
<div class="main-content">
	<section class="section">
		<ul class="breadcrumb breadcrumb-style ">
            <li class="breadcrumb-item">
              <h4 class="page-title m-b-0">Tableau de bord</h4>
            </li>
            <li class="breadcrumb-item">
              <a href="<?=siteUrl?>">
                <i data-feather="home"></i></a>
            </li>
            <li class="breadcrumb-item active">Tableau de bord</li>
		</ul>
		<div class="row">
			<div class="col-lg-6 col-sm-4">
				<div class="card">
					<div class="card-statistic-5">
						<div class="info-box7-block">
							<div class="row ">
								<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<h6 class="m-b-20 text-center">Nombre Total de Player</h6>
									<h4 class="text-center">
										<span>
											<?=$load->CountTable('tbl_widget');?></span>
									</h4>
								</div>
							</div>
						<div id="cardChart1"/></div>
					</div>
				</div>
			</div>
		</div>
		<div class="col-lg-6 col-sm-4">
			<div class="card">
				<div class="card-statistic-5">
					<div class="info-box7-block">
						<div class="row ">
							<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
								<h6 class="m-b-20 text-center">Nombre Total d'utilisateurs</h6>
								<h4 class="text-center">
									<span>
										<?=$load->CountTable('users');?></span>
								</h4>
							</div>
						</div>
						<div id="cardChart1"/></div>
					</div>
				</div>
			</div>
		</div>
	   <div class="row">
			<div class="col-12">
				<div class="qz-sec-title">
					<h5>Utilisateurs récemment ajoutés</h5>
				</div>
					<table class="table table-striped" role="grid" aria-describedby="category-table_info">
						<thead>
							<tr role="row">
								<th>#</th>
								<th>Nom</th>
								<th>Nom d'utilisateurs</th>
								<th>Ajouté le</th>
								<!--th>Status</th-->
								<th>Action</th>
							</tr>
						</thead>
						<tbody>
																				
							<?php
							$data = $load->GetUserAll();
							$i=1;
							foreach($data as $val):
							?>
							<tr role="row" class="odd">
								<td tabindex="0" class="sorting_1"><?=$i?></td>
								<td><?=$val['name']?></td>
								<td><?=$val['username']?></td>
								<td><?=date("j M y", strtotime($val['create_at']))?></td>
							<!--td><span class="<?=$val['status'] =="1" ? "text-success" : "text-danger" ;?>"><?=$val['status'] =="1" ? "Active" : "Inactive" ;?></span></td-->
					   
							<td>
								<ul class="d-flex list-unstyled">
									<a href="edit_user/<?=$val['id']?>" data-toggle="tooltip" title="Change Password" ><li class="qz-edit"><i data-feather="settings"></i></li></a>
													
									<!--a href="javascript:void(0);" onclick="upstatus('<?=$val['id']?>','user','<?=siteUrl?>')" data-toggle="tooltip" title="<?=$val['status'] =="1" ? "Dectivate" : "Activate" ;?>">
									<li class="ml-2" style="color:<?=$val['status'] =="1" ? "#27C24C" : "#FC9C2C" ;?>"><i data-feather="check-circle"></i></li>
									</a-->
									<a href="javascript:void(0);" data-toggle="tooltip" title="Delete" onclick="del('<?=$val['id']?>','user','<?=siteUrl;?>')">
									<li class="ml-2 qz-close"><i data-feather="delete"></i></li></a>
								</ul>
							</td>
								
							</tr>
							<?php
							$i++;
							endforeach;
							?>
							
							<tr class="qz-table-footer">
								<td colspan="2"><a href="<?=siteUrl?>add_user"><button class="btn btn-info px-3">Ajouter un ouveau utilisateur</button></a></td>
								<td></td>
								<td colspan="4"><h5><a href="<?=siteUrl?>user_list" class="text-info">Tout voir</a></h5></td>
							</tr>
						</tbody>
					</table>
			</div>
		</div>
	</section>
</div>


