Affichage "Tous les groupes"
|
@ -23,6 +23,12 @@
|
||||||
|
|
||||||
/* STYLE "BASIC" DES TABLEAUX */
|
/* STYLE "BASIC" DES TABLEAUX */
|
||||||
table.basic{
|
table.basic{
|
||||||
|
/* position */
|
||||||
|
float: left;
|
||||||
|
margin: 1em;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* border */
|
/* border */
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
|
|
@ -287,6 +287,7 @@ body{
|
||||||
|
|
||||||
|
|
||||||
/* quand on a la souris sur le bouton */
|
/* quand on a la souris sur le bouton */
|
||||||
|
#AUTH input[type=button]:focus,
|
||||||
#AUTH input[type=button]:hover{
|
#AUTH input[type=button]:hover{
|
||||||
background-color: #3dcc70;
|
background-color: #3dcc70;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
|
@ -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_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
|
$LOGIN_postStrings = $LOGIN_postAreSet && is_string($_POST['username']) && is_string($_POST['password']); // sont toutes 2 des strings
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php require('manager/security.php'); session_init();
|
<?php require_once __ROOT__.'/manager/security.php';
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
* *
|
* *
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
* *
|
* *
|
||||||
* MANAGER DE SECURITE GENERALE ET SPECIFIQUE *
|
* MANAGER DE SECURITE GENERALE ET SPECIFIQUE *
|
||||||
|
@ -68,6 +67,13 @@
|
||||||
$_SESSION['username'] = null; // on les initialise à NULL
|
$_SESSION['username'] = null; // on les initialise à NULL
|
||||||
$_SESSION['permissions'] = 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 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -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();
|
||||||
|
|
||||||
/****************************************
|
/****************************************
|
||||||
* *
|
* *
|
||||||
|
@ -15,38 +17,58 @@
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section name='all' title='tous les groupes'>
|
|
||||||
|
|
||||||
|
<section name='allgroup' title='tous les groupes'>
|
||||||
<?php if( $_SESSION['username'] != null ){ // si connecté
|
<?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 "<table class='basic'>";
|
||||||
|
|
||||||
// TITRES
|
echo '<thead>';
|
||||||
echo '<thead><tr>';
|
|
||||||
foreach($userlist[0] as $key=>$value)
|
|
||||||
echo '<th>'.$key.'</th>';
|
|
||||||
echo '</tr></thead>';
|
|
||||||
|
|
||||||
|
|
||||||
// CONTENU
|
|
||||||
echo '<tbody>';
|
|
||||||
foreach($userlist as $eleve){
|
|
||||||
echo '<tr>';
|
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>';
|
||||||
|
|
||||||
foreach($eleve as $value)
|
|
||||||
|
|
||||||
|
echo '<tbody>';
|
||||||
|
// pour chaque utilisateur
|
||||||
|
foreach($group->userlist as $user){
|
||||||
|
echo '<tr>';
|
||||||
|
foreach($user as $key=>$value)
|
||||||
echo '<td>'.$value.'</td>';
|
echo '<td>'.$value.'</td>';
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</tbody>';
|
echo '</tbody>';
|
||||||
|
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} ?>
|
} ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php define('__ROOT__', dirname(__FILE__) );
|
||||||
|
|
||||||
|
|
||||||
/*** CRÉATION D'UTILISATEUR ***/
|
/*** CRÉATION D'UTILISATEUR ***/
|
||||||
|
@ -9,10 +9,10 @@
|
||||||
// $answer = new stdClass();
|
// $answer = new stdClass();
|
||||||
|
|
||||||
// $request->level_1 = 'create';
|
// $request->level_1 = 'create';
|
||||||
// $request->username = 'mrd1609a';
|
// $request->username = 'fvg1856a';
|
||||||
// $request->prenom = 'adrien';
|
// $request->prenom = 'guillaume';
|
||||||
// $request->nom = 'ligou marques';
|
// $request->nom = 'fauvet';
|
||||||
// $request->email = 'adrien.marques-ligou@etu.iut-tlse3.fr';
|
// $request->email = 'guillaume.fauvet@etu.iut-tlse3.fr';
|
||||||
// $request->password = ' Test_Password _';
|
// $request->password = ' Test_Password _';
|
||||||
// $request->droits = 'student';
|
// $request->droits = 'student';
|
||||||
|
|
||||||
|
@ -71,14 +71,14 @@
|
||||||
|
|
||||||
/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/
|
/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/
|
||||||
|
|
||||||
// require('manager/groups.php');
|
// require __ROOT__.'/manager/groups.php';
|
||||||
|
|
||||||
// $request = new stdClass();
|
// $request = new stdClass();
|
||||||
// $answer = new stdClass();
|
// $answer = new stdClass();
|
||||||
|
|
||||||
// $request->level_1 = 'add';
|
// $request->level_1 = 'add';
|
||||||
// $request->utilisateur = 'mrd1609a'; // utilisateur.username
|
// $request->utilisateur = 'fvg1856a'; // utilisateur.username
|
||||||
// $request->groupe = 'E'; // groupe.nom
|
// $request->groupe = 'A'; // groupe.nom
|
||||||
|
|
||||||
|
|
||||||
// groups_switch_level_1($request, $answer);
|
// groups_switch_level_1($request, $answer);
|
||||||
|
@ -134,25 +134,25 @@
|
||||||
|
|
||||||
/*** AFFICHER LES MEMBRES DE TOUS LES GROUPES ***/
|
/*** AFFICHER LES MEMBRES DE TOUS LES GROUPES ***/
|
||||||
|
|
||||||
require('manager/groups.php');
|
// require('manager/groups.php');
|
||||||
|
|
||||||
$request = new stdClass();
|
// $request = new stdClass();
|
||||||
$answer = 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 );
|
// var_dump( $answer );
|
||||||
echo '<br><br><br><br>';
|
// echo '<br><br><br><br>';
|
||||||
|
|
||||||
foreach($answer->grouplist as $group)
|
// foreach($answer->grouplist as $group)
|
||||||
foreach($group as $userlist)
|
// foreach($group as $userlist)
|
||||||
foreach($userlist as $user)
|
// foreach($userlist as $user)
|
||||||
foreach($user as $key=>$value)
|
// foreach($user as $key=>$value)
|
||||||
echo $key.' = '.$value.'<br>';
|
// echo $key.' = '.$value.'<br>';
|
||||||
|
|
||||||
echo "<br><br><br><br><br><br><br>It works !";
|
// echo "<br><br><br><br><br><br><br>It works !";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|