1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-26 05:17:39 +02:00

Amélioration du code de la page "Tournoi"

This commit is contained in:
galaxyoyo
2019-09-10 01:34:41 +02:00
parent cca62a99d0
commit bf83e6534d
4 changed files with 125 additions and 85 deletions

View File

@ -67,8 +67,8 @@ class NewTournament {
ensure(preg_match("#[0-9]*#", $this->price), "Le tarif pour les participants n'est pas un entier valide.");
$this->price = intval($this->price);
ensure($this->size >= 0, "Le TFJM² ne va pas payer les élèves pour venir.");
ensure($this->size <= 50, "Soyons raisonnable sur le prix.");
ensure($this->price >= 0, "Le TFJM² ne va pas payer les élèves pour venir.");
ensure($this->price <= 50, "Soyons raisonnable sur le prix.");
ensure(dateWellFormed($this->date_start), "La date de début n'est pas valide.");
ensure(dateWellFormed($this->date_end), "La date de fin n'est pas valide.");
@ -95,8 +95,7 @@ class NewTournament {
/** @var User $organizer */
foreach ($this->organizers as $organizer) {
$req = $DB->prepare("INSERT INTO `organizers`(`organizer`, `tournament`) VALUES(?, ?);");
$req->execute([$organizer->getId(), $this->tournament->getId()]);
$this->tournament->addOrganizer($organizer);
Mailer::sendAddOrganizerForTournamentMail($organizer, $this->tournament);
}
}