1
0
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:
Yohann D'ANELLO
2020-04-13 03:41:15 +02:00
parent a86bc3f124
commit 50aec3c105
13 changed files with 104 additions and 25 deletions

View File

@ -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;