mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-01 00:01:26 +02:00
Changement confinement
This commit is contained in:
@ -68,6 +68,24 @@ if (isset($_POST["download_zip"])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_POST["select_tournament"])) {
|
||||
$new_tournament = Tournament::fromId($_POST["select_tournament"]);
|
||||
ensure($new_tournament != null, "Le tournoi indiqué n'existe pas.");
|
||||
$team->setTournamentId($new_tournament->getId());
|
||||
$DB->prepare("UPDATE `documents` SET `tournament` = ? WHERE `team` = ?;")->execute([$tournament->getId(), $team->getId()]);
|
||||
$DB->prepare("UPDATE `solutions` SET `tournament` = ? WHERE `team` = ?;")->execute([$tournament->getId(), $team->getId()]);
|
||||
$DB->prepare("UPDATE `syntheses` SET `tournament` = ? WHERE `team` = ?;")->execute([$tournament->getId(), $team->getId()]);
|
||||
foreach ($team->getParticipants() as $user) {
|
||||
if ($user != null)
|
||||
$DB->prepare("UPDATE `payments` SET `tournament` = ? WHERE `user` = ?;")->execute([$tournament->getId(), $user]);
|
||||
}
|
||||
foreach ($team->getEncadrants() as $user) {
|
||||
if ($user != null)
|
||||
$DB->prepare("UPDATE `payments` SET `tournament` = ? WHERE `user` = ?;")->execute([$tournament->getId(), $user]);
|
||||
}
|
||||
$tournament = $new_tournament;
|
||||
}
|
||||
|
||||
class EditTeam
|
||||
{
|
||||
public $name;
|
||||
|
Reference in New Issue
Block a user