1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 16:57:26 +02:00

Minor fixes

This commit is contained in:
Yohann D'ANELLO
2020-02-21 23:26:47 +01:00
parent 88dcb68aa8
commit 45426e6835
7 changed files with 14 additions and 7 deletions

View File

@ -2,6 +2,7 @@
class Role
{
const OBSERVER = -1;
const PARTICIPANT = 0;
const ENCADRANT = 1;
const ORGANIZER = 2;
@ -9,6 +10,8 @@ class Role
public static function getTranslatedName($role) {
switch ($role) {
case self::OBSERVER:
return "Observateur";
case self::ENCADRANT:
return "Encadrant";
case self::ORGANIZER:
@ -22,6 +25,8 @@ class Role
public static function getName($role) {
switch ($role) {
case self::OBSERVER:
return "OBSERVER";
case self::ENCADRANT:
return "ENCADRANT";
case self::ORGANIZER:
@ -35,6 +40,8 @@ class Role
public static function fromName($name) {
switch ($name) {
case "OBSERVER":
return self::OBSERVER;
case "ENCADRANT":
return self::ENCADRANT;
case "ORGANIZER":

View File

@ -90,7 +90,7 @@ class User
{
global $DB, $YEAR;
$admins = [];
$req = $DB->query("SELECT * FROM `users` WHERE `role` = 'ORGANIZER' OR `role` = 'ADMIN' AND `year` = $YEAR ORDER BY `role`, `surname`, `first_name`;");
$req = $DB->query("SELECT * FROM `users` WHERE `role` = 'ORGANIZER' OR `role` = 'ADMIN' AND `year` = $YEAR ORDER BY `role` DESC, `surname`, `first_name`;");
while (($data = $req->fetch()) !== false) {
$admin = new User();