SMMP/view/users.php

114 lines
3.1 KiB
PHP
Raw Normal View History

<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
?>
<!-- [1] Gestion du sous-menu de gauche -->
<nav class='sub-menu-side'>
<span data-sublink='view'>
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Tout afficher</span>
</span>
<span data-sublink='create' >
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span>Creation</span>
</span>
<span data-sublink='remove' >
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span>Suppression</span>
</span>
<span data-sublink='edit' >
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span>Modification</span>
</span>
<span data-sublink='filter' >
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span>Filtrer</span>
</span>
<span data-sublink='search' >
2016-02-09 14:04:22 +00:00
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>
</nav>
<?php
$post = array();
foreach($_POST as $k=>$v)
array_push($post, $k);
$sublink = $post[0];
/* PAGE DES STATISTIQUES
*
*/
// if( $sublink == 'view' ){
// On recupere tous les utilisateurs
debug();
2016-02-05 08:18:01 +00:00
2016-02-11 15:00:41 +00:00
$request = new \manager\ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
2016-02-05 08:18:01 +00:00
$answer = $request->dispatch(); // On recupere la reponse
2016-02-08 20:46:11 +00:00
echo "<section data-sublink='view' class='list'>";
// echo 'Liste des utilisateurs: <br>';
2016-02-05 08:18:01 +00:00
// si erreur, on affiche l'explicitation
if( $answer->error != \manager\ManagerError::Success )
var_dump( \manager\ManagerError::explicit($answer->error) );
2016-02-05 08:18:01 +00:00
// Si aucune erreur, on affiche les resultats
else{
foreach( $answer->get('users') as $user){
echo "<article class='inline-box'>";
2016-02-05 09:51:38 +00:00
// Prenom Nom
echo "<span class='title'>".$user['username']." <span>(".$user['firstname']." ".$user['lastname'].")</span></span>";
2016-02-05 09:51:38 +00:00
// Code RFID
echo "<span class='code'>";
2016-02-09 14:04:22 +00:00
echo \manager\ResourceDispatcher::getResource('f/svg/card/st/container');
2016-02-05 09:51:38 +00:00
echo "<span>";
echo $user['code'];
echo "</span>";
echo"</span>";
// Adresse email
echo "<span class='mail'>";
2016-02-09 14:04:22 +00:00
echo \manager\ResourceDispatcher::getResource('f/svg/mail/st/container');
echo "<span>";
echo $user['mail'];
echo "</span>";
echo"</span>";
// Groupes de la machine
echo "<span class='groups'>";
echo \manager\ResourceDispatcher::getResource('f/svg/group/st/container');
echo "<span>a</span>";
echo "<span>a</span>";
echo"</span>";
2016-02-05 09:51:38 +00:00
echo "</article>";
}
var_dump( $answer->get('users') );
2016-02-05 08:18:01 +00:00
}
echo '</section>';
// }