1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-26 17:27:58 +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

@ -78,12 +78,24 @@ class MyTeam
public function updateTeam()
{
global $URL_BASE;
global $URL_BASE, $DB;
$this->team->setName($this->name);
$this->team->setTrigram($this->trigram);
$this->team->setTournamentId($this->tournament_id);
$DB->prepare("UPDATE `documents` SET `tournament` = ? WHERE `team` = ?;")->execute([$this->tournament_id, $this->team->getId()]);
$DB->prepare("UPDATE `solutions` SET `tournament` = ? WHERE `team` = ?;")->execute([$this->tournament_id, $this->team->getId()]);
$DB->prepare("UPDATE `syntheses` SET `tournament` = ? WHERE `team` = ?;")->execute([$this->tournament_id, $this->team->getId()]);
foreach ($this->team->getParticipants() as $user) {
if ($user != null)
$DB->prepare("UPDATE `payments` SET `tournament` = ? WHERE `user` = ?;")->execute([$this->tournament_id, $user]);
}
foreach ($this->team->getEncadrants() as $user) {
if ($user != null)
$DB->prepare("UPDATE `payments` SET `tournament` = ? WHERE `user` = ?;")->execute([$this->tournament_id, $user]);
}
$_SESSION["tournament"] = $this->tournament;
header("Location: $URL_BASE/mon-equipe");