1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-29 15:01:04 +02:00

First week fixes

This commit is contained in:
Yohann D'ANELLO
2020-05-05 01:06:57 +02:00
parent a064cc1817
commit 132481fda0
22 changed files with 541 additions and 59 deletions

View File

@ -30,8 +30,12 @@ class NewTournament {
public $time_inscription;
public $date_solutions;
public $time_solutions;
public $date_syntheses;
public $time_syntheses;
public $date_syntheses;
public $time_syntheses;
public $date_solutions_2;
public $time_solutions_2;
public $date_syntheses_2;
public $time_syntheses_2;
public $description;
public $final;
public $tournament;
@ -72,7 +76,9 @@ class NewTournament {
ensure(dateWellFormed($this->date_end), "La date de fin n'est pas valide.");
ensure(dateWellFormed($this->date_inscription . " " . $this->time_inscription), "La date de clôture des inscriptions n'est pas valide.");
ensure(dateWellFormed($this->date_solutions . " " . $this->time_solutions), "La date limite de remise des solutions n'est pas valide.");
ensure(dateWellFormed($this->date_syntheses . " " . $this->time_syntheses), "La date limite de remise des notes de synthèse n'est pas valide.");
ensure(dateWellFormed($this->date_syntheses . " " . $this->time_syntheses), "La date limite de remise des notes de synthèse pour le tour 1 n'est pas valide.");
ensure(dateWellFormed($this->date_solutions_2 . " " . $this->time_solutions_2), "La date limite de visibilité des solutions du tour 2 n'est pas valide.");
ensure(dateWellFormed($this->date_syntheses . " " . $this->time_syntheses), "La date limite de remise des notes de synthèse pour le tour 2 n'est pas valide.");
$this->final = $this->final ? 1 : 0;
@ -84,10 +90,13 @@ class NewTournament {
global $DB, $YEAR;
$req = $DB->prepare("INSERT INTO `tournaments` (`name`, `size`, `place`, `price`, `description`,
`date_start`, `date_end`, `date_inscription`, `date_solutions`, `date_syntheses`, `final`, `year`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
`date_start`, `date_end`, `date_inscription`, `date_solutions`, `date_syntheses`,
`date_solutions_2`, `date_syntheses_2`, `final`, `year`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
$req->execute([$this->name, $this->size, $this->place, $this->price, $this->description, $this->date_start, $this->date_end,
"$this->date_inscription $this->time_inscription", "$this->date_solutions $this->time_solutions", "$this->date_syntheses $this->time_syntheses", $this->final ? 1 : 0, $YEAR]);
"$this->date_inscription $this->time_inscription", "$this->date_solutions $this->time_solutions",
"$this->date_syntheses $this->time_syntheses", "$this->date_solutions_2 $this->time_solutions_2",
"$this->date_syntheses_2 $this->time_syntheses_2", $this->final ? 1 : 0, $YEAR]);
$this->tournament = Tournament::fromName($this->name);