2016-02-03 22:22:18 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
2016-02-13 17:47:20 +00:00
|
|
|
use \manager\ModuleRequest;
|
|
|
|
use \manager\ManagerError;
|
2016-07-21 13:35:00 +00:00
|
|
|
use \manager\Database;
|
2016-02-18 14:49:06 +00:00
|
|
|
use \manager\Repo;
|
2016-02-03 22:22:18 +00:00
|
|
|
?>
|
|
|
|
|
2016-02-01 22:09:35 +00:00
|
|
|
<!-- [1] Gestion du sous-menu de gauche -->
|
|
|
|
|
2016-02-02 22:29:30 +00:00
|
|
|
<nav class='sub-menu-side'>
|
2016-02-18 14:49:06 +00:00
|
|
|
<span data-sublink='view'>
|
2016-07-08 15:04:41 +00:00
|
|
|
<span class='svg'><?php echo file_get_contents( __ROOT__.'/src/static/sub-menu-side/view.svg' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Tout afficher</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='filter' >
|
2016-07-08 15:04:41 +00:00
|
|
|
<span class='svg'><?php echo file_get_contents( __ROOT__.'/src/static/sub-menu-side/filter.svg' ); ?></span>
|
2016-07-21 10:23:18 +00:00
|
|
|
<span>Détails</span>
|
2016-02-03 07:45:42 +00:00
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='remove' >
|
2016-07-21 10:23:18 +00:00
|
|
|
<span class='svg'><?php echo file_get_contents( __ROOT__.'/src/static/sub-menu-side/archive.svg' ); ?></span>
|
|
|
|
<span>Archiver</span>
|
2016-02-03 07:45:42 +00:00
|
|
|
</span>
|
2016-02-02 10:09:48 +00:00
|
|
|
</nav>
|
|
|
|
|
2016-02-03 10:30:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-18 14:49:06 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2016-07-04 13:45:29 +00:00
|
|
|
$post = [];
|
2016-02-18 14:49:06 +00:00
|
|
|
foreach($_POST as $k=>$v)
|
|
|
|
array_push($post, $k);
|
|
|
|
|
|
|
|
$sublink = $post[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [1] VIEW -> Liste des utilisateurs
|
|
|
|
=========================================================*/
|
|
|
|
$getusers = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
|
|
|
|
$nbusers = count( $getusers->dispatch()->get('users') ); // On recupere la reponse
|
|
|
|
|
|
|
|
$getmachines = new ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault'
|
|
|
|
$nbmachines = count( $getmachines->dispatch()->get('machines') ); // On recupere la reponse
|
|
|
|
|
|
|
|
echo "<section data-sublink='view' class='list'>";
|
|
|
|
|
|
|
|
// Barre de recherche
|
|
|
|
echo "<input type='text' class='searchbar' placeholder='Recherche'>";
|
|
|
|
|
|
|
|
|
2016-07-21 13:35:00 +00:00
|
|
|
/* (1) On récupère les données
|
|
|
|
---------------------------------------------------------*/
|
|
|
|
$selReq = Database::getPDO()->query("select count(distinct id_user) as users, max(timestamp) as last from history group by id_machine");
|
|
|
|
$selected = Database::delNumeric( $selReq->fetchAll() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($selected as $m=>$mac){
|
|
|
|
|
|
|
|
echo "<article class='inline-box'>"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-18 14:49:06 +00:00
|
|
|
echo '</section>';
|