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 13:16:47 +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-10 07:54:23 +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-02 22:56:48 +00:00
|
|
|
<span>Tout afficher</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-03 08:00:06 +00:00
|
|
|
<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-02 22:56:48 +00:00
|
|
|
<span>Creation</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-03 08:00:06 +00:00
|
|
|
<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-02 22:56:48 +00:00
|
|
|
<span>Suppression</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-03 08:00:06 +00:00
|
|
|
<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-02 22:56:48 +00:00
|
|
|
<span>Modification</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-03 08:00:06 +00:00
|
|
|
<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-02 22:56:48 +00:00
|
|
|
<span>Filtrer</span>
|
|
|
|
</span>
|
|
|
|
|
2016-02-02 13:03:22 +00:00
|
|
|
</nav>
|
|
|
|
|
2016-02-03 10:30:46 +00:00
|
|
|
|
|
|
|
|
2016-02-10 07:54:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$post = array();
|
|
|
|
foreach($_POST as $k=>$v)
|
|
|
|
array_push($post, $k);
|
|
|
|
|
|
|
|
$sublink = $post[0];
|
|
|
|
|
|
|
|
|
2016-02-15 09:22:47 +00:00
|
|
|
/* [1] Affichage des machines
|
|
|
|
=========================================================*/
|
2016-02-15 21:37:44 +00:00
|
|
|
$request = new ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault'
|
2016-02-10 07:54:23 +00:00
|
|
|
$answer = $request->dispatch(); // On recupere la reponse
|
|
|
|
|
|
|
|
echo "<section data-sublink='view' class='list'>";
|
|
|
|
// echo 'Liste des utilisateurs: <br>';
|
|
|
|
|
|
|
|
// si erreur, on affiche l'explicitation
|
2016-02-15 21:36:39 +00:00
|
|
|
if( $answer->error != ManagerError::Success ){
|
|
|
|
// var_dump( ManagerError::explicit($answer->error) );
|
|
|
|
|
|
|
|
echo "<span class='error'>Une erreur est survenue, veuilez contacter le webmaster si cette erreur persiste.</span>";
|
|
|
|
}
|
2016-02-10 07:54:23 +00:00
|
|
|
|
|
|
|
// Si aucune erreur, on affiche les resultats
|
|
|
|
else{
|
2016-02-15 21:26:34 +00:00
|
|
|
|
|
|
|
// Barre de recherche
|
|
|
|
echo "<input type='text' class='searchbar' placeholder='Recherche'>";
|
|
|
|
|
|
|
|
// Liste des machines
|
2016-02-10 07:54:23 +00:00
|
|
|
foreach( $answer->get('machines') as $machine){
|
2016-02-14 13:16:47 +00:00
|
|
|
$clusters = new Repo('machine/getClusters', array($machine['id_machine']));
|
|
|
|
$clusters = $clusters->answer();
|
|
|
|
|
2016-02-16 21:10:36 +00:00
|
|
|
echo "<article class='inline-box' id='".$machine['id_machine']."'>";
|
2016-02-15 21:01:00 +00:00
|
|
|
// Nom de la machine
|
2016-02-14 20:58:49 +00:00
|
|
|
echo "<span class='title'>#".$machine['name']."</span>";
|
2016-02-10 07:54:23 +00:00
|
|
|
|
2016-02-15 21:01:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Icone vers la modification
|
|
|
|
echo "<span class='link_edit' data-machine='".$machine['id_machine']."'>";
|
|
|
|
echo ResourceDispatcher::getResource('f/svg/edit/st/sub-menu-side');
|
|
|
|
echo "</span>";
|
|
|
|
|
|
|
|
// Icone vers la suppression
|
|
|
|
echo "<span class='link_remove' data-machine='".$machine['id_machine']."'>";
|
|
|
|
echo ResourceDispatcher::getResource('f/svg/remove/st/sub-menu-side');
|
|
|
|
echo "</span>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-10 07:54:23 +00:00
|
|
|
// Code RFID
|
|
|
|
echo "<span class='code'>";
|
2016-02-13 17:47:20 +00:00
|
|
|
echo ResourceDispatcher::getResource('f/svg/card/st/container');
|
2016-02-10 07:54:23 +00:00
|
|
|
|
|
|
|
echo "<span>";
|
|
|
|
echo $machine['code'];
|
|
|
|
echo "</span>";
|
|
|
|
echo"</span>";
|
|
|
|
|
2016-02-11 09:34:26 +00:00
|
|
|
// Groupes de la machine
|
|
|
|
echo "<span class='groups'>";
|
2016-02-13 17:47:20 +00:00
|
|
|
echo ResourceDispatcher::getResource('f/svg/group/st/container');
|
2016-02-11 09:34:26 +00:00
|
|
|
|
2016-02-14 13:16:47 +00:00
|
|
|
if( $clusters != false )
|
|
|
|
foreach($clusters as $cluster)
|
|
|
|
echo "<span>".$cluster['name']."</span>";
|
2016-02-11 09:34:26 +00:00
|
|
|
echo"</span>";
|
|
|
|
|
|
|
|
|
2016-02-10 07:54:23 +00:00
|
|
|
echo "</article>";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</section>';
|
2016-02-14 20:58:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [2] Creation de machine
|
|
|
|
=========================================================*/
|
|
|
|
echo "<section data-sublink='create'>";
|
|
|
|
|
2016-02-15 09:22:47 +00:00
|
|
|
echo "<form class='valid'>";
|
|
|
|
echo "<input id='create_code' type='text' placeholder='Code'><br>";
|
|
|
|
echo "<input id='create_name' type='text' placeholder='Name'><br>";
|
|
|
|
echo "<button id='create_submit'>Créer</button>";
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
echo '</section>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [3] Suppression de machine
|
|
|
|
=========================================================*/
|
|
|
|
echo "<section data-sublink='remove'>";
|
|
|
|
|
|
|
|
echo "<form class='invalid'>";
|
2016-02-15 21:08:49 +00:00
|
|
|
echo "<input id='remove_code' type='text' placeholder='Code'><br>";
|
2016-02-15 11:27:01 +00:00
|
|
|
echo "<hr class='OR' />";
|
2016-02-15 21:08:49 +00:00
|
|
|
echo "<input id='remove_name' type='text' placeholder='Name'><br>";
|
|
|
|
echo "<button id='remove_submit'>Supprimer</button>";
|
2016-02-15 09:22:47 +00:00
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
echo '</section>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* [4] Modification de machine
|
|
|
|
=========================================================*/
|
|
|
|
echo "<section data-sublink='edit'>";
|
|
|
|
|
|
|
|
echo "<form class='neutral'>";
|
2016-02-16 13:36:23 +00:00
|
|
|
echo "<input id='edit_search_keyword' type='text' class='search' placeholder='Recherche...'><br>";
|
|
|
|
echo "<input id='edit_search_id' type='hidden' value=''><br>";
|
|
|
|
echo "<button id='edit_search_submit' class='search'>Trouver</button><br><br><br>";
|
|
|
|
|
2016-02-15 11:27:01 +00:00
|
|
|
echo "<input id='edit_code' type='text' placeholder='Code'><br>";
|
|
|
|
echo "<input id='edit_name' type='text' placeholder='Name'><br>";
|
2016-02-16 21:59:01 +00:00
|
|
|
echo "<button id='edit_submit' disabled>Modifier</button>";
|
2016-02-14 20:58:49 +00:00
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
echo '</section>';
|