diff --git a/server_files/classes/Team.php b/server_files/classes/Team.php index 53e29a1..3a7447c 100644 --- a/server_files/classes/Team.php +++ b/server_files/classes/Team.php @@ -5,12 +5,11 @@ class Team private $id; private $name; private $trigram; - private $tournament; - private $encadrants; + private $problem; + private $encadrant; private $participants; private $inscription_date; private $validation_status; - private $final_selection; private $access_code; private $year; @@ -66,12 +65,11 @@ class Team $this->id = $data["id"]; $this->name = $data["name"]; $this->trigram = $data["trigram"]; - $this->tournament = $data["tournament"]; - $this->encadrants = [$data["encadrant_1"], $data["encadrant_2"]]; + $this->problem = $data["problem"]; + $this->encadrant = $data["encadrant"]; $this->participants = [$data["participant_1"], $data["participant_2"], $data["participant_3"], $data["participant_4"], $data["participant_5"], $data["participant_6"]]; $this->inscription_date = $data["inscription_date"]; $this->validation_status = ValidationStatus::fromName($data["validation_status"]); - $this->final_selection = $data["final_selection"] == true; $this->access_code = $data["access_code"]; $this->year = $data["year"]; } @@ -105,29 +103,29 @@ class Team $DB->prepare("UPDATE `teams` SET `trigram` = ? WHERE `id` = ?;")->execute([$trigram, $this->id]); } - public function getTournamentId() + public function getProblem() { - return $this->tournament; + return $this->problem; } - public function setTournamentId($tournament) + public function setProblem($problem) { global $DB; - $this->tournament = $tournament; - $DB->prepare("UPDATE `teams` SET `tournament` = ? WHERE `id` = ?;")->execute([$tournament, $this->id]); + $this->problem = $problem; + $DB->prepare("UPDATE `teams` SET `problem` = ? WHERE `id` = ?;")->execute([$problem, $this->id]); } - public function getEncadrants() + public function getEncadrantId() { - return $this->encadrants; + return $this->encadrant; } - public function setEncadrant($i, $encadrant) + public function setEncadrant($encadrant) { global $DB; - $this->encadrants[$i - 1] = $encadrant; + $this->encadrant = $encadrant; /** @noinspection SqlResolve */ - $DB->prepare("UPDATE `teams` SET `encadrant_$i` = ? WHERE `id` = ?;")->execute([$encadrant, $this->id]); + $DB->prepare("UPDATE `teams` SET `encadrant` = ? WHERE `id` = ?;")->execute([$encadrant, $this->id]); } public function getParticipants() @@ -161,18 +159,6 @@ class Team $DB->prepare("UPDATE `teams` SET `validation_status` = ? WHERE `id` = ?;")->execute([ValidationStatus::getName($status), $this->id]); } - public function isSelectedForFinal() - { - return $this->final_selection; - } - - public function selectForFinal($selected) - { - global $DB; - $this->final_selection = $selected; - $DB->prepare("UPDATE `teams` SET `final_selection` = ? WHERE `id` = ?;")->execute([$selected, $this->id]); - } - public function getAccessCode() { return $this->access_code; diff --git a/server_files/classes/User.php b/server_files/classes/User.php index cd1fd8d..442f309 100644 --- a/server_files/classes/User.php +++ b/server_files/classes/User.php @@ -7,18 +7,8 @@ class User private $pwd_hash; public $surname; public $first_name; - public $birth_date; - public $gender; - public $address; - public $postal_code; - public $city; - public $country; - public $phone_number; public $school; public $class; - public $responsible_name; - public $responsible_phone; - public $responsible_email; public $description; private $role; private $team_id; @@ -66,18 +56,8 @@ class User $this->pwd_hash = $data["pwd_hash"]; $this->surname = $data["surname"]; $this->first_name = $data["first_name"]; - $this->birth_date = $data["birth_date"]; - $this->gender = $data["gender"]; - $this->address = $data["address"]; - $this->postal_code = $data["postal_code"]; - $this->city = $data["city"]; - $this->country = $data["country"]; - $this->phone_number = $data["phone_number"]; $this->school = $data["school"]; $this->class = SchoolClass::fromName($data["class"]); - $this->responsible_name = $data["responsible_name"]; - $this->responsible_phone = $data["responsible_phone"]; - $this->responsible_email = $data["responsible_email"]; $this->description = $data["description"]; $this->role = Role::fromName($data["role"]); $this->team_id = $data["team_id"]; @@ -145,90 +125,6 @@ class User $DB->prepare("UPDATE `users` SET `first_name` = ? WHERE `id` = ?;")->execute([$first_name, $this->getId()]); } - public function getBirthDate() - { - return $this->birth_date; - } - - public function setBirthDate($birth_date) - { - global $DB; - $this->birth_date = $birth_date; - $DB->prepare("UPDATE `users` SET `birth_date` = ? WHERE `id` = ?;")->execute([$birth_date, $this->getId()]); - } - - public function getGender() - { - return $this->gender; - } - - public function setGender($gender) - { - global $DB; - $this->gender = $gender; - $DB->prepare("UPDATE `users` SET `gender` = ? WHERE `id` = ?;")->execute([$gender, $this->getId()]); - } - - public function getAddress() - { - return $this->address; - } - - public function setAddress($address) - { - global $DB; - $this->address = $address; - $DB->prepare("UPDATE `users` SET `address` = ? WHERE `id` = ?;")->execute([$address, $this->getId()]); - } - - public function getPostalCode() - { - return $this->postal_code; - } - - public function setPostalCode($postal_code) - { - global $DB; - $this->postal_code = $postal_code; - $DB->prepare("UPDATE `users` SET `postal_code` = ? WHERE `id` = ?;")->execute([$postal_code, $this->getId()]); - } - - public function getCity() - { - return $this->city; - } - - public function setCity($city) - { - global $DB; - $this->city = $city; - $DB->prepare("UPDATE `users` SET `city` = ? WHERE `id` = ?;")->execute([$city, $this->getId()]); - } - - public function getCountry() - { - return $this->country; - } - - public function setCountry($country) - { - global $DB; - $this->country = $country; - $DB->prepare("UPDATE `users` SET `country` = ? WHERE `id` = ?;")->execute([$country, $this->getId()]); - } - - public function getPhoneNumber() - { - return $this->phone_number; - } - - public function setPhoneNumber($phone_number) - { - global $DB; - $this->phone_number = $phone_number; - $DB->prepare("UPDATE `users` SET `phone_number` = ? WHERE `id` = ?;")->execute([$phone_number, $this->getId()]); - } - public function getSchool() { return $this->school; @@ -253,42 +149,6 @@ class User $DB->prepare("UPDATE `users` SET `class` = ? WHERE `id` = ?;")->execute([SchoolClass::getName($class), $this->getId()]); } - public function getResponsibleName() - { - return $this->responsible_name; - } - - public function setResponsibleName($responsible_name) - { - global $DB; - $this->responsible_name = $responsible_name; - $DB->prepare("UPDATE `users` SET `responsible_name` = ? WHERE `id` = ?;")->execute([$responsible_name, $this->getId()]); - } - - public function getResponsiblePhone() - { - return $this->responsible_phone; - } - - public function setResponsiblePhone($responsible_phone) - { - global $DB; - $this->responsible_phone = $responsible_phone; - $DB->prepare("UPDATE `users` SET `responsible_phone` = ? WHERE `id` = ?;")->execute([$responsible_phone, $this->getId()]); - } - - public function getResponsibleEmail() - { - return $this->responsible_email; - } - - public function setResponsibleEmail($responsible_email) - { - global $DB; - $this->responsible_email = $responsible_email; - $DB->prepare("UPDATE `users` SET `responsible_email` = ? WHERE `id` = ?;")->execute([$responsible_email, $this->getId()]); - } - public function getDescription() { return $this->description; diff --git a/server_files/controllers/ajouter_equipe.php b/server_files/controllers/ajouter_equipe.php index 6043bcd..0d0ebcc 100644 --- a/server_files/controllers/ajouter_equipe.php +++ b/server_files/controllers/ajouter_equipe.php @@ -3,8 +3,6 @@ if (!isset($_SESSION["role"]) || ($_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT)) require_once "server_files/403.php"; -$tournaments_response = $DB->query("SELECT `id`, `name` FROM `tournaments` WHERE `date_inscription` > CURRENT_DATE AND `year` = '$YEAR';"); - $has_error = false; $error_message = null; @@ -23,8 +21,7 @@ if (isset($_POST["submitted"])) { class NewTeam { public $name; public $trigram; - public $tournament_id; - public $tournament; + public $problem; public $access_code; public function __construct($data) @@ -39,8 +36,7 @@ class NewTeam { ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme entré n'est pas valide."); ensure(!teamExists($this->name), "Une équipe existe déjà avec ce nom."); ensure(!trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme."); - $this->tournament = Tournament::fromId($this->tournament_id); - ensure($this->tournament != null, "Le tournoi spécifié n'existe pas."); + ensure(preg_match("#[1-4]#", $this->problem), "Le problème choisi n'a pas été reconnu."); } public function register() { @@ -48,15 +44,15 @@ class NewTeam { $this->access_code = genRandomPhrase(6); - $req = $DB->prepare("INSERT INTO `teams` (`name`, `trigram`, `tournament`, `encadrant_1`, `participant_1`, `validation_status`, `access_code`, `year`) + $req = $DB->prepare("INSERT INTO `teams` (`name`, `trigram`, `problem`, `encadrant`, `participant_1`, `validation_status`, `access_code`, `year`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"); - $req->execute([$this->name, $this->trigram, $this->tournament_id, $_SESSION["role"] == Role::ENCADRANT ? $_SESSION["user_id"] : NULL, - $_SESSION["role"] == Role::PARTICIPANT ? $_SESSION["user_id"] : NULL, ValidationStatus::NOT_READY, $this->access_code, $YEAR]); + $req->execute([$this->name, $this->trigram, $this->problem, $_SESSION["role"] == Role::ENCADRANT ? $_SESSION["user_id"] : NULL, + $_SESSION["role"] == Role::PARTICIPANT ? $_SESSION["user_id"] : NULL, ValidationStatus::getName(ValidationStatus::NOT_READY), $this->access_code, $YEAR]); $_SESSION["team"] = Team::fromTrigram($this->trigram); $_SESSION["user"]->setTeamId($_SESSION["team"]->getId()); - Mailer::sendAddTeamMail($_SESSION["user"], $_SESSION["team"], $this->tournament); + Mailer::sendAddTeamMail($_SESSION["user"], $_SESSION["team"], $this->problem); } } diff --git a/server_files/controllers/equipe.php b/server_files/controllers/equipe.php index 14d1b13..f86e107 100644 --- a/server_files/controllers/equipe.php +++ b/server_files/controllers/equipe.php @@ -6,7 +6,6 @@ if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ORGANIZER && $_SE $trigram = htmlspecialchars($_GET["trigram"]); $team = Team::fromTrigram($trigram); -$tournament = Tournament::fromId($team->getTournamentId()); if ($team === null) require_once "server_files/404.php"; @@ -15,29 +14,10 @@ if (isset($_POST["validate"])) { $team->setValidationStatus(ValidationStatus::VALIDATED); } -if (isset($_POST["select"])) { - $team->selectForFinal(true); - $team->setValidationStatus(ValidationStatus::NOT_READY); - $sols = $tournament->getAllSolutions($team->getId()); - /** @var Solution $sol */ - foreach ($sols as $sol) { - $old_id = $sol->getFileId(); - do - $id = genRandomPhrase(64); - while (file_exists("$LOCAL_PATH/files/$id")); - - copy("$LOCAL_PATH/files/$old_id", "$LOCAL_PATH/files/$id"); - - $req = $DB->prepare("INSERT INTO `solutions`(`file_id`, `team`, `tournament`, `problem`) VALUES (?, ?, ?, ?);"); - $req->execute([$id, $team->getId(), $FINAL->getId(), $sol->getFileId()]); - } -} - if (isset($_POST["download_zip"])) { $final = isset($_POST["final"]); - $tournament_dest = $final ? $FINAL : $tournament; - $file_name = getZipFile(DocumentType::PARENTAL_CONSENT, $tournament_dest->getId(), $team->getId()); + $file_name = getZipFile(DocumentType::PARENTAL_CONSENT, $tournament->getId(), $team->getId()); header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=\"Documents de l'équipe " . $team->getTrigram() . ".zip\""); @@ -51,7 +31,4 @@ if (isset($_POST["download_zip"])) { $documents = $tournament->getAllDocuments($team->getId()); $documents_final = null; -if ($team->isSelectedForFinal()) - $documents_final = $FINAL->getAllDocuments($team->getId()); - require_once "server_files/views/equipe.php"; diff --git a/server_files/controllers/informations.php b/server_files/controllers/informations.php index 9b076e2..5076403 100644 --- a/server_files/controllers/informations.php +++ b/server_files/controllers/informations.php @@ -15,12 +15,9 @@ if ($user === null) require_once "server_files/404.php"; $team = Team::fromId($user->getTeamId()); -$tournaments = $user->getOrganizedTournaments(); if ($team != null) { - $documents = $user->getAllDocuments($team->getTournamentId()); - if ($team->isSelectedForFinal()) - $documents_final = $user->getAllDocuments($FINAL->getId()); + //$documents = $user->getAllDocuments($team->getTournamentId()); } require_once "server_files/views/informations.php"; diff --git a/server_files/controllers/inscription.php b/server_files/controllers/inscription.php index 3f1462a..c4b3ac9 100644 --- a/server_files/controllers/inscription.php +++ b/server_files/controllers/inscription.php @@ -20,19 +20,10 @@ class NewUser public $email; public $first_name; public $surname; - public $birth_date; - public $gender; - public $address = ""; - public $postal_code; - public $city = ""; - public $country; - public $phone_number; public $role; public $school; public $class; - public $responsible_name; - public $responsible_phone; - public $responsible_email; + public $description; public $confirm_email_token; private $password; @@ -46,8 +37,6 @@ class NewUser public function makeVerifications() { - global $YEAR; - ensure(filter_var($this->email, FILTER_VALIDATE_EMAIL), "L'adresse e-mail entrée est invalide."); $this->email = strtolower($this->email); ensure(!userExists($this->email), "Un compte existe déjà avec cette adresse e-mail."); @@ -55,23 +44,10 @@ class NewUser ensure($this->password == $this->confirm_password, "Les deux mots de passe sont différents."); ensure($this->surname != "", "Le nom de famille est obligatoire."); ensure($this->first_name != "", "Le prénom est obligatoire."); - ensure(dateWellFormed($this->birth_date), "La date de naissance est invalide."); - ensure($this->birth_date < $YEAR . "-01-01", "Vous devez être né."); - ensure($this->gender == "M" || $this->gender == "F", "Le sexe indiqué est invalide."); - ensure(preg_match("#^[0-9]{4}[0-9]?$#", $this->postal_code) && intval($this->postal_code) >= 01000 && intval($this->postal_code) <= 95999, "Le code postal est invalide."); - if ($this->country == "") - $this->country = "France"; - ensure(strlen($this->phone_number) >= 10, "Le numéro de téléphone est invalide."); $this->role = Role::fromName(strtoupper($this->role)); - if ($this->role == Role::PARTICIPANT) { + if ($this->role == Role::PARTICIPANT) $this->class = SchoolClass::fromName(strtoupper($this->class)); - if ($this->birth_date > strval($YEAR - 18) . "04-01") { - ensure($this->responsible_name != "", "Veuillez spécifier un responsable légal."); - ensure(strlen($this->responsible_phone) >= 10, "Veuillez rentrer le numéro de téléphone de votre responsable légal."); - ensure(filter_var($this->responsible_email, FILTER_VALIDATE_EMAIL), "Veuillez spécifier un responsable légal."); - } - } $this->confirm_email_token = genRandomPhrase(64); } @@ -80,11 +56,10 @@ class NewUser { global $DB, $YEAR; - $req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `confirm_email`, `surname`, `first_name`, `birth_date`, `gender`, - `address`, `postal_code`, `city`, `country`, `phone_number`, `school`, `class`, `role`, `description`, `year`) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); - $req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->confirm_email_token, $this->surname, $this->first_name, $this->birth_date, $this->gender, $this->address, - $this->postal_code, $this->city, $this->country, $this->phone_number, $this->school, SchoolClass::getName($this->class), Role::getName($this->role), $this->description, $YEAR]); + $req = $DB->prepare("INSERT INTO `users`(`email`, `pwd_hash`, `confirm_email`, `surname`, `first_name`, `school`, `class`, `role`, `description`, `year`) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); + $req->execute([$this->email, password_hash($this->password, PASSWORD_BCRYPT), $this->confirm_email_token, $this->surname, $this->first_name, + $this->school, SchoolClass::getName($this->class), Role::getName($this->role), $this->description, $YEAR]); Mailer::sendRegisterMail($this); } diff --git a/server_files/controllers/mon_compte.php b/server_files/controllers/mon_compte.php index b4f799b..aee24ca 100644 --- a/server_files/controllers/mon_compte.php +++ b/server_files/controllers/mon_compte.php @@ -38,18 +38,8 @@ class MyAccount public $email; public $surname; public $first_name; - public $birth_date; - public $gender; - public $address; - public $postal_code; - public $city; - public $country; - public $phone_number; public $school; public $class; - public $responsible_name; - public $responsible_phone; - public $responsible_email; public $description; private $user; @@ -60,8 +50,7 @@ class MyAccount $this->user = $_SESSION["user"]; - $keys = ["email", "surname", "first_name", "birth_date", "gender", "address", "postal_code", "city", "country", "phone_number", - "school", "class", "responsible_name", "responsible_phone", "responsible_email", "description"]; + $keys = ["email", "surname", "first_name", "school", "class", "description"]; if ($this->user->getRole() == Role::PARTICIPANT) $this->class = SchoolClass::fromName($this->class); @@ -72,42 +61,17 @@ class MyAccount public function makeVerifications() { - global $YEAR; - ensure(filter_var($this->email, FILTER_VALIDATE_EMAIL), "L'adresse e-mail entrée est invalide."); $this->email = strtolower($this->email); ensure($this->email == $this->user->getEmail() || !userExists($this->email), "Un compte existe déjà avec cette adresse e-mail."); - ensure(dateWellFormed($this->birth_date), "La date de naissance est invalide."); - ensure($this->birth_date < $YEAR . "-01-01", "Vous devez être né."); - ensure($this->gender == "M" || $this->gender == "F", "Le sexe indiqué est invalide."); - ensure(preg_match("#^[0-9]{4}[0-9]?$#", $this->postal_code) && intval($this->postal_code) >= 01000 && intval($this->postal_code) <= 95999, "Le code postal est invalide."); - ensure(strlen($this->phone_number) >= 10, "Le numéro de téléphone est invalide."); - - if ($this->user->getRole() == Role::PARTICIPANT) { - if ($this->birth_date > strval($YEAR - 18) . "04-01") { - ensure($this->responsible_name != "", "Veuillez spécifier un responsable légal."); - ensure(strlen($this->responsible_phone) >= 10, "Veuillez rentrer le numéro de téléphone de votre responsable légal."); - ensure(filter_var($this->responsible_email, FILTER_VALIDATE_EMAIL), "Veuillez spécifier un responsable légal."); - } - } } public function updateAccount() { $this->user->setSurname($this->surname); $this->user->setFirstName($this->first_name); - $this->user->setBirthDate($this->birth_date); - $this->user->setGender($this->gender); - $this->user->setAddress($this->address); - $this->user->setPostalCode($this->postal_code); - $this->user->setCity($this->city); - $this->user->setCountry($this->country); - $this->user->setPhoneNumber($this->phone_number); $this->user->setSchool($this->school); $this->user->setClass($this->class); - $this->user->setResponsibleName($this->responsible_name); - $this->user->setResponsiblePhone($this->responsible_phone); - $this->user->setResponsibleEmail($this->responsible_email); $this->user->setDescription($this->description); if ($this->email != $this->user->getEmail()) { diff --git a/server_files/controllers/mon_equipe.php b/server_files/controllers/mon_equipe.php index bb14051..4f4d2e9 100644 --- a/server_files/controllers/mon_equipe.php +++ b/server_files/controllers/mon_equipe.php @@ -5,8 +5,6 @@ if (isset($_POST["leave_team"])) { exit(); } -$tournaments = Tournament::getAllTournaments(false, true); - $has_error = false; $error_message = null; @@ -49,10 +47,7 @@ if (isset($_SESSION["user_id"]) && isset($_SESSION["team"]) && $_SESSION["team"] $user = $_SESSION["user"]; $team = $_SESSION["team"]; - $tournament = Tournament::fromId($team->getTournamentId()); - $documents = $user->getAllDocuments($team->getTournamentId()); - if ($team->isSelectedForFinal()) - $documents_final = $user->getAllDocuments($FINAL->getId()); + //$documents = $user->getAllDocuments($team->getTournamentId()); } else require_once "server_files/403.php"; diff --git a/server_files/model.php b/server_files/model.php index d66687d..c8240c4 100644 --- a/server_files/model.php +++ b/server_files/model.php @@ -1,7 +1,5 @@ getRole(); - if ($user->getTeamId() !== null) { - $team = $_SESSION["team"] = Team::fromId($user->getTeamId()); - $_SESSION["tournament"] = Tournament::fromId($team->getTournamentId()); - } + if ($user->getTeamId() !== null) + $_SESSION["team"] = Team::fromId($user->getTeamId()); if (isset($_GET["be-admin"])) { quitTeam(); diff --git a/server_files/services/mail.php b/server_files/services/mail.php index d67e0ff..b11169a 100644 --- a/server_files/services/mail.php +++ b/server_files/services/mail.php @@ -75,7 +75,7 @@ class Mailer self::sendMail($user->getEmail(), "Mot de passe changé – Correspondances des Jeunes Mathématicien·ne·s", $content); } - public static function sendAddTeamMail(User $user, Team $team, Tournament $tournament) + public static function sendAddTeamMail(User $user, Team $team, $problem) { global $YEAR; @@ -84,7 +84,7 @@ class Mailer $content = preg_replace("#{SURNAME}#", $user->getSurname(), $content); $content = preg_replace("#{TEAM_NAME}#", $team->getName(), $content); $content = preg_replace("#{TRIGRAM}#", $team->getTrigram(), $content); - $content = preg_replace("#{TOURNAMENT_NAME}#", $tournament->getName(), $content); + $content = preg_replace("#{PROBLEM}#", $problem, $content); $content = preg_replace("#{ACCESS_CODE}#", $team->getAccessCode(), $content); self::sendMail($user->getEmail(), "Ajout d'une équipe Correspondances des Jeunes Mathématicien·ne·s $YEAR", $content); diff --git a/server_files/services/mail_templates/add_team.html b/server_files/services/mail_templates/add_team.html index 6dc291c..3d472a1 100644 --- a/server_files/services/mail_templates/add_team.html +++ b/server_files/services/mail_templates/add_team.html @@ -7,7 +7,7 @@ Bonjour {FIRST_NAME} {SURNAME},

-Vous venez de créer l'équipe « {TEAM_NAME} » ({TRIGRAM}) pour les Correspondances des Jeunes Mathématicien·ne·s de {TOURNAMENT_NAME} et nous vous en remercions.
+Vous venez de créer l'équipe « {TEAM_NAME} » ({TRIGRAM}) pour les Correspondances des Jeunes Mathématicien·ne·s pour le problème {PROBLEM} et nous vous en remercions.
Afin de permettre aux autres membres de votre équipe de vous rejoindre, veuillez leur transmettre le code d'accès : {ACCESS_CODE}

diff --git a/server_files/views/ajouter_equipe.php b/server_files/views/ajouter_equipe.php index bee55b2..bd8a22a 100644 --- a/server_files/views/ajouter_equipe.php +++ b/server_files/views/ajouter_equipe.php @@ -31,14 +31,13 @@ if (isset($new_team) && !$has_error) { ?> - + - fetch()) !== FALSE) { - echo "\n"; - } + for ($i = 1; $i <= 4; ++$i) + echo ""; ?> diff --git a/server_files/views/equipe.php b/server_files/views/equipe.php index af1315c..58ec380 100644 --- a/server_files/views/equipe.php +++ b/server_files/views/equipe.php @@ -4,14 +4,12 @@ Nom de l'équipe : getName() ?>
Trigramme : getTrigram() ?>
- Tournoi : getName() ?>">getName() ?>
+ Problème : getProblem() ?>">getProblem() ?>
getEncadrants()[$i - 1] == NULL) - continue; - $encadrant = User::fromId($team->getEncadrants()[$i - 1]); +if ($team->getEncadrantId() !== null) { + $encadrant = User::fromId($team->getEncadrantId()); $id = $encadrant->getId(); - echo "Encadrant $i : getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "
"; + echo "Encadrant : getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "
"; } for ($i = 1; $i <= 6; ++$i) { if ($team->getParticipants()[$i - 1] == NULL) @@ -20,10 +18,6 @@ for ($i = 1; $i <= 6; ++$i) { $id = $participant->getId(); echo "Participant $i : getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "
"; } -if ($team->isSelectedForFinal()) { - $final_name = $FINAL->getName(); - echo "Équipe sélectionnée pour la finale nationale."; -} ?>
diff --git a/server_files/views/header.php b/server_files/views/header.php index acdbf32..92c8343 100644 --- a/server_files/views/header.php +++ b/server_files/views/header.php @@ -25,7 +25,7 @@