mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-24 15:40:27 +02:00
Affichage de tous les profils existants
This commit is contained in:
@ -67,11 +67,28 @@ class User
|
||||
return $admins;
|
||||
}
|
||||
|
||||
public static function getAllUsers()
|
||||
{
|
||||
global $DB, $YEAR;
|
||||
$orphans = [];
|
||||
$req = $DB->query("SELECT * FROM `users` WHERE `role` != 'ADMIN' AND `year` = $YEAR ORDER BY `role`, `inscription_date`;");
|
||||
|
||||
while (($data = $req->fetch()) !== false) {
|
||||
$orphan = new User();
|
||||
$orphan->fill($data);
|
||||
$orphans[] = $orphan;
|
||||
}
|
||||
|
||||
return $orphans;
|
||||
}
|
||||
|
||||
public static function getOrphanUsers()
|
||||
{
|
||||
global $DB, $YEAR;
|
||||
$orphans = [];
|
||||
$req = $DB->query("SELECT * FROM `users` WHERE `role` != 'ADMIN' AND `team_id` IS NULL AND `year` = $YEAR ORDER BY `role`, `inscription_date`;");
|
||||
$req = $DB->query("SELECT * FROM `users` WHERE `role` != 'ADMIN' AND `team_id` IS NULL "
|
||||
. "AND NOT EXISTS (SELECT 1 FROM `teams` WHERE `encadrant` = `users`.`id`) "
|
||||
. "AND `year` = $YEAR ORDER BY `role`, `inscription_date`;");
|
||||
|
||||
while (($data = $req->fetch()) !== false) {
|
||||
$orphan = new User();
|
||||
|
Reference in New Issue
Block a user