mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 05:40:32 +02:00
3 encadrants max par équipe
This commit is contained in:
@ -47,11 +47,12 @@ function quitTeam($user_id = -1)
|
||||
if ($role == Role::ADMIN || $role == Role::ORGANIZER)
|
||||
return;
|
||||
|
||||
for ($i = 1; $i <= ($role == Role::ENCADRANT ? 2 : 6); ++$i)
|
||||
for ($i = 1; $i <= ($role == Role::ENCADRANT ? 3 : 6); ++$i)
|
||||
/** @noinspection SqlResolve */
|
||||
$DB->exec("UPDATE `teams` SET `" . strtolower(Role::getName($role)) . "_$i` = NULL WHERE `" . strtolower(Role::getName($role)) . "_$i` = $user_id;");
|
||||
$user->setTeamId(null);
|
||||
$DB->exec("UPDATE `teams` SET `encadrant_1` = `encadrant_2`, `encadrant_2` = NULL WHERE `encadrant_1` IS NULL;");
|
||||
$DB->exec("UPDATE `teams` SET `encadrant_2` = `encadrant_3`, `encadrant_3` = NULL WHERE `encadrant_2` IS NULL;");
|
||||
for ($i = 1; $i <= 5; ++$i) {
|
||||
/** @noinspection SqlResolve */
|
||||
$DB->exec("UPDATE `teams` SET `participant_$i` = `participant_" . strval($i + 1) . "`, `participant_" . strval($i + 1) . "` = NULL WHERE `participant_$i` IS NULL;");
|
||||
|
Reference in New Issue
Block a user