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;
|
|
|
|
use \manager\ResourceDispatcher;
|
2016-02-14 12:55:06 +00:00
|
|
|
use \manager\Repo;
|
2016-02-03 22:22:18 +00:00
|
|
|
?>
|
|
|
|
|
2016-02-02 13:03:22 +00:00
|
|
|
<!-- [1] Gestion du sous-menu de gauche -->
|
|
|
|
|
2016-02-02 22:29:30 +00:00
|
|
|
<nav class='sub-menu-side'>
|
2016-02-05 09:26:10 +00:00
|
|
|
<span data-sublink='view'>
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Tout afficher</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='create' >
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Creation</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='remove' >
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Suppression</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='edit' >
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Modification</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='filter' >
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Filtrer</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span data-sublink='search' >
|
2016-02-13 17:47:20 +00:00
|
|
|
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
|
2016-02-03 07:45:42 +00:00
|
|
|
<span>Recherche</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-02 13:03:22 +00:00
|
|
|
</nav>
|
|
|
|
|
2016-02-03 10:30:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 22:45:03 +00:00
|
|
|
<?php
|
2016-02-03 10:30:46 +00:00
|
|
|
|
2016-02-04 22:45:03 +00:00
|
|
|
$post = array();
|
|
|
|
foreach($_POST as $k=>$v)
|
|
|
|
array_push($post, $k);
|
2016-02-03 10:30:46 +00:00
|
|
|
|
2016-02-04 22:45:03 +00:00
|
|
|
$sublink = $post[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-14 19:37:41 +00:00
|
|
|
/* [1] VIEW -> Liste des utilisateurs
|
|
|
|
=========================================================*/
|
|
|
|
$request = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
|
|
|
|
$answer = $request->dispatch(); // On recupere la reponse
|
2016-02-05 08:18:01 +00:00
|
|
|
|
2016-02-14 19:37:41 +00:00
|
|
|
echo "<section data-sublink='view' class='list'>";
|
|
|
|
// echo 'Liste des utilisateurs: <br>';
|
|
|
|
|
|
|
|
// si erreur, on affiche l'explicitation
|
|
|
|
if( $answer->error != ManagerError::Success )
|
|
|
|
var_dump( ManagerError::explicit($answer->error) );
|
|
|
|
|
|
|
|
// Si aucune erreur, on affiche les resultats
|
|
|
|
else{
|
|
|
|
foreach( $answer->get('users') as $user){
|
|
|
|
$clusters = new Repo('user/getClusters', array($user['id_user']));
|
|
|
|
$clusters = $clusters->answer();
|
|
|
|
|
|
|
|
echo "<article class='inline-box'>";
|
|
|
|
// Prenom Nom
|
|
|
|
echo "<span class='title'>".$user['username']." <span>(".$user['firstname']." ".$user['lastname'].")</span></span>";
|
|
|
|
|
|
|
|
// Code RFID
|
|
|
|
echo "<span class='code'>";
|
|
|
|
echo ResourceDispatcher::getResource('f/svg/card/st/container');
|
|
|
|
|
|
|
|
echo "<span>";
|
|
|
|
echo $user['code'];
|
|
|
|
echo "</span>";
|
|
|
|
echo"</span>";
|
|
|
|
|
|
|
|
// Adresse email
|
|
|
|
echo "<span class='mail'>";
|
|
|
|
echo ResourceDispatcher::getResource('f/svg/mail/st/container');
|
|
|
|
|
|
|
|
echo "<a href='mailto:".$user['mail']."'><span>";
|
|
|
|
echo $user['mail'];
|
|
|
|
echo "</span></a>";
|
|
|
|
echo"</span>";
|
|
|
|
|
|
|
|
// Groupes de la machine
|
|
|
|
echo "<span class='groups'>";
|
|
|
|
echo ResourceDispatcher::getResource('f/svg/group/st/container');
|
|
|
|
|
|
|
|
if( $clusters != false )
|
|
|
|
foreach($clusters as $cluster)
|
|
|
|
echo "<span>".$cluster['name']."</span>";
|
|
|
|
echo"</span>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "</article>";
|
2016-02-05 09:26:10 +00:00
|
|
|
}
|
2016-02-14 19:37:41 +00:00
|
|
|
var_dump( $answer->get('users') );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</section>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [2] Creation d'utilisateur
|
|
|
|
=========================================================*/
|
|
|
|
$request = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
|
|
|
|
$answer = $request->dispatch(); // On recupere la reponse
|
|
|
|
|
|
|
|
echo "<section data-sublink='create'>";
|
2016-02-05 09:26:10 +00:00
|
|
|
|
2016-02-14 19:37:41 +00:00
|
|
|
echo "<form>";
|
|
|
|
echo "<input id='create_code' type='text' placeholder='Code'><br>";
|
|
|
|
echo "<input id='create_username' type='text' placeholder='Username'><br>";
|
|
|
|
echo "<input id='create_firstname' type='text' placeholder='Firstname'><br>";
|
|
|
|
echo "<input id='create_lastname' type='text' placeholder='Lastname'><br>";
|
|
|
|
echo "<input id='create_mail' type='text' placeholder='Mail'><br>";
|
2016-02-14 20:22:07 +00:00
|
|
|
echo "<input id='create_password' type='password' placeholder='Password'><br>";
|
|
|
|
echo "<input id='create_status' type='text' placeholder='Status'><br>";
|
2016-02-14 19:37:41 +00:00
|
|
|
echo "<button id='create_submit'>Créer</button>";
|
|
|
|
echo "</form>";
|
2016-02-04 22:45:03 +00:00
|
|
|
|
2016-02-14 19:37:41 +00:00
|
|
|
echo '</section>';
|