Affichage "Tous les groupes"

This commit is contained in:
xdrm-brackets 2015-10-23 13:08:33 +02:00
parent 471a077662
commit ddc56667b7
14 changed files with 89 additions and 50 deletions

View File

@ -23,6 +23,12 @@
/* STYLE "BASIC" DES TABLEAUX */
table.basic{
/* position */
float: left;
margin: 1em;
/* border */
border-radius: 5px;
border-spacing: 0;

0
css/font.css Normal file → Executable file
View File

View File

@ -287,6 +287,7 @@ body{
/* quand on a la souris sur le bouton */
#AUTH input[type=button]:focus,
#AUTH input[type=button]:hover{
background-color: #3dcc70;
color: #fff;

View File

@ -1,4 +1,8 @@
<?php require('manager/security.php'); session_init();
<?php define('__ROOT__', dirname(__FILE__) );
require_once __ROOT__.'/manager/security.php';
$LOGIN_postAreSet = isset($_POST['username']) && isset($_POST['password']); // variables POST existent
$LOGIN_postStrings = $LOGIN_postAreSet && is_string($_POST['username']) && is_string($_POST['password']); // sont toutes 2 des strings

3
manager/groups.php Normal file → Executable file
View File

@ -1,5 +1,6 @@
<?php require('manager/security.php'); session_init();
<?php require_once __ROOT__.'/manager/security.php';
/***********************************************************
* *
* MANAGER DES UTILISATEURS *

View File

@ -1,5 +1,4 @@
<?php
<?php
/***********************************************************
* *
@ -68,6 +67,13 @@
$_SESSION['username'] = null; // on les initialise à NULL
$_SESSION['permissions'] = null;
}
}session_init();
function debug(){
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
}
@ -75,5 +81,4 @@
?>

View File

@ -1,4 +1,6 @@
<?php require('../manager/security.php'); session_init();
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/security.php'; session_init();
// debug();
/****************************************
* *
@ -12,40 +14,60 @@
* [4] Répartir les élèves (admin)
*
*****************************************/
?>
<section name='all' title='tous les groupes'>
<section name='allgroup' title='tous les groupes'>
<?php if( $_SESSION['username'] != null ){ // si connecté
// on lit la liste d'utilisateurs
$userlistFile = file_get_contents('../src/userlistSample.json');
$userlist = JSON_decode($userlistFile);
include __ROOT__.'/manager/groups.php';
$request = new stdClass();
$answer = new stdClass();
$request->level_1 = 'grouplist';
groups_switch_level_1($request, $answer);
foreach($answer->grouplist as $group){ // pour chaque groupe
if( count($group->userlist) > 0 ){ // s'il y a des utilisateurs
echo "<table class='basic'>";
echo '<thead>';
echo '<tr>';
echo '<th colspan=5>Groupe '.$group->nom.'</th>';
echo '</tr><tr>';
echo '<th>Pseudo</th>';
echo '<th>Prénom</th>';
echo '<th>Nom</th>';
echo '<th>email</th>';
echo '<th>droits</th>';
echo '</tr>';
echo '</thead>';
echo "<table class='basic'>";
// TITRES
echo '<thead><tr>';
foreach($userlist[0] as $key=>$value)
echo '<th>'.$key.'</th>';
echo '</tr></thead>';
echo '<tbody>';
// pour chaque utilisateur
foreach($group->userlist as $user){
echo '<tr>';
foreach($user as $key=>$value)
echo '<td>'.$value.'</td>';
echo '</tr>';
}
echo '</tbody>';
// CONTENU
echo '<tbody>';
foreach($userlist as $eleve){
echo '<tr>';
echo '</table>';
foreach($eleve as $value)
echo '<td>'.$value.'</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
}
} ?>
</section>

0
src/close.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
src/header/logout.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
src/header/logout@hover.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
src/menu/userdata/visitor.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
src/userlistSample.json Normal file → Executable file
View File

44
test.php Normal file → Executable file
View File

@ -1,4 +1,4 @@
<?php
<?php define('__ROOT__', dirname(__FILE__) );
/*** CRÉATION D'UTILISATEUR ***/
@ -9,10 +9,10 @@
// $answer = new stdClass();
// $request->level_1 = 'create';
// $request->username = 'mrd1609a';
// $request->prenom = 'adrien';
// $request->nom = 'ligou marques';
// $request->email = 'adrien.marques-ligou@etu.iut-tlse3.fr';
// $request->username = 'fvg1856a';
// $request->prenom = 'guillaume';
// $request->nom = 'fauvet';
// $request->email = 'guillaume.fauvet@etu.iut-tlse3.fr';
// $request->password = ' Test_Password _';
// $request->droits = 'student';
@ -70,15 +70,15 @@
/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/
// require('manager/groups.php');
// require __ROOT__.'/manager/groups.php';
// $request = new stdClass();
// $answer = new stdClass();
// $request->level_1 = 'add';
// $request->utilisateur = 'mrd1609a'; // utilisateur.username
// $request->groupe = 'E'; // groupe.nom
// $request->utilisateur = 'fvg1856a'; // utilisateur.username
// $request->groupe = 'A'; // groupe.nom
// groups_switch_level_1($request, $answer);
@ -134,25 +134,25 @@
/*** AFFICHER LES MEMBRES DE TOUS LES GROUPES ***/
require('manager/groups.php');
// require('manager/groups.php');
$request = new stdClass();
$answer = new stdClass();
// $request = new stdClass();
// $answer = new stdClass();
$request->level_1 = 'grouplist';
// $request->level_1 = 'grouplist';
groups_switch_level_1($request, $answer);
// groups_switch_level_1($request, $answer);
var_dump( $answer );
echo '<br><br><br><br>';
// var_dump( $answer );
// echo '<br><br><br><br>';
foreach($answer->grouplist as $group)
foreach($group as $userlist)
foreach($userlist as $user)
foreach($user as $key=>$value)
echo $key.' = '.$value.'<br>';
// foreach($answer->grouplist as $group)
// foreach($group as $userlist)
// foreach($userlist as $user)
// foreach($user as $key=>$value)
// echo $key.' = '.$value.'<br>';
echo "<br><br><br><br><br><br><br>It works !";
// echo "<br><br><br><br><br><br><br>It works !";

0
xdoc/Cahier Des Charges Fonctionnel.pdf Normal file → Executable file
View File