1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-24 15:40:27 +02:00

Page comptes orphelins & menu déroulant

This commit is contained in:
galaxyoyo
2019-09-28 01:14:08 +02:00
parent 7ad974c304
commit 81bb33cc8e
6 changed files with 113 additions and 16 deletions

View File

@ -64,6 +64,21 @@ class User
return $admins;
}
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`;");
while (($data = $req->fetch()) !== false) {
$orphan = new User();
$orphan->fill($data);
$orphans[] = $orphan;
}
return $orphans;
}
private function fill($data)
{