mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-05 02:06:52 +00:00
Adaptation de la plateforme aux besoins des correspondances (en cours)
This commit is contained in:
parent
e908ad1923
commit
07e7b94f5c
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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()) {
|
||||
|
@ -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";
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
$FINAL = Tournament::getFinalTournament();
|
||||
|
||||
function loadUserValues()
|
||||
{
|
||||
$_SESSION["user"] = $_SESSION["team"] = $_SESSION["tournament"] = null;
|
||||
@ -14,10 +12,8 @@ function loadUserValues()
|
||||
$user = $_SESSION["user"] = User::fromId($_SESSION["user_id"]);
|
||||
$_SESSION["role"] = $user->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();
|
||||
|
@ -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);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<body>
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br />
|
||||
<br />
|
||||
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.<br />
|
||||
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.<br />
|
||||
Afin de permettre aux autres membres de votre équipe de vous rejoindre, veuillez leur transmettre le code d'accès :
|
||||
{ACCESS_CODE}<br/>
|
||||
<br />
|
||||
|
@ -31,14 +31,13 @@ if (isset($new_team) && !$has_error) { ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="tournament_id">Tournoi :</label>
|
||||
<label for="problem">Problème :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="tournament_id" name="tournament_id">
|
||||
<select style="width: 100%;" id="problem" name="problem">
|
||||
<?php
|
||||
while (($data = $tournaments_response->fetch()) !== FALSE) {
|
||||
echo "<option value=\"" . $data["id"] . "\">" . $data["name"] . "</option>\n";
|
||||
}
|
||||
for ($i = 1; $i <= 4; ++$i)
|
||||
echo "<option value='$i'>$i</option>";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
|
@ -4,14 +4,12 @@
|
||||
|
||||
Nom de l'équipe : <?= $team->getName() ?><br/>
|
||||
Trigramme : <?= $team->getTrigram() ?><br/>
|
||||
Tournoi : <a href="<?= $URL_BASE . "/tournoi/" . $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
|
||||
Problème : <a href="<?= $URL_BASE . "/problem/" . $team->getProblem() ?>"><?= $team->getProblem() ?></a><br/>
|
||||
<?php
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if ($team->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 : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
||||
echo "Encadrant : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
||||
}
|
||||
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 : <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
|
||||
}
|
||||
if ($team->isSelectedForFinal()) {
|
||||
$final_name = $FINAL->getName();
|
||||
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong>";
|
||||
}
|
||||
?>
|
||||
|
||||
<hr/>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<ul id="menu">
|
||||
<li id="menu-logo"><img src="<?= $URL_BASE ?>/logo.png" alt="Logo Corres2Math"></li>
|
||||
<li><a href="<?= $URL_BASE ?>/">Accueil</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/tournois">Liste des tournois</a></li>
|
||||
<!-- <li><a href="<?= $URL_BASE ?>/tournois">Liste des tournois</a></li> -->
|
||||
<?php if (!isset($_SESSION["user_id"])) { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/connexion">Connexion</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/inscription">Inscription</a></li>
|
||||
@ -39,8 +39,8 @@
|
||||
<li><a href="<?= $URL_BASE ?>/mon_equipe">Mon équipe</a></li>
|
||||
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED || true) { ?>
|
||||
<li><a href="https://paypal.me/galaxyoyo42">Paiement</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/solutions">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses">Notes de synthèse</a></li>
|
||||
<!--<li><a href="<?= $URL_BASE ?>/solutions">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses">Notes de synthèse</a></li> -->
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
@ -49,8 +49,8 @@
|
||||
<li><a href="<?= $URL_BASE ?>/ajouter_organisateur">Ajouter un organisateur</a></li>
|
||||
<?php } ?>
|
||||
<?php if ($_SESSION["role"] == Role::ADMIN || $_SESSION["role"] == Role::ORGANIZER) { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/solutions_orga">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses_orga">Notes de synthèse</a></li>
|
||||
<!-- <li><a href="<?= $URL_BASE ?>/solutions_orga">Solutions</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/syntheses_orga">Notes de synthèse</a></li> -->
|
||||
<?php } ?>
|
||||
<li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li>
|
||||
<hr />
|
||||
|
@ -5,40 +5,21 @@
|
||||
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
||||
Équipe : <?= $team === null ? "Pas d'équipe" : "<a href=\"$URL_BASE/equipe/" . $team->getTrigram() . "\">" . $team->getName() . " (" . $team->getTrigram() . ")</a>" ?><br />
|
||||
<?php } ?>
|
||||
Date de naissance : <?= formatDate($user->getBirthDate()) ?><br />
|
||||
Sexe : <?= $user->getGender() == "M" ? "Masculin" : "Féminin" ?><br />
|
||||
Adresse : <?= $user->getAddress() . ", " . $user->getPostalCode() . " " . $user->getCity() . ($user->getCountry() == "France" ? "" : ", " . $user->getCountry()) ?><br />
|
||||
Adresse e-mail : <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a><br />
|
||||
Numéro de téléphone : <?= $user->getPhoneNumber() ?><br />
|
||||
|
||||
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
|
||||
Lycée : <?= $user->getSchool() ?><br />
|
||||
Classe : <?php SchoolClass::getTranslatedName($user->getClass()) ?><br />
|
||||
Nom du responsable légal : <?= $user->getResponsibleName() ?><br />
|
||||
Numéro de téléphone du responsable légal : <?= $user->getResponsiblePhone() ?><br />
|
||||
Adresse e-mail du responsable légal : <a href="mailto:<?= $user->getResponsibleEmail() ?>"><?= $user->getResponsibleEmail() ?></a>
|
||||
Classe : <?= SchoolClass::getTranslatedName($user->getClass()) ?><br />
|
||||
<?php } elseif ($user->getDescription() != "") { ?>
|
||||
Description : <?= $user->getDescription() ?><br />
|
||||
<?php }
|
||||
|
||||
echo "<hr />";
|
||||
|
||||
if ($user->getRole() == Role::ADMIN || $user->getRole() == Role::ORGANIZER) {
|
||||
foreach ($tournaments as $tournament) {
|
||||
echo "Organise le tournoi <a href=\"$URL_BASE/tournoi/" . $tournament->getName(). "\">" . $tournament->getName() . "</a><br />";
|
||||
}
|
||||
}
|
||||
elseif ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
||||
if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
||||
<h2>Autorisations</h2>
|
||||
<?php
|
||||
printDocuments($documents);
|
||||
|
||||
if ($team->isSelectedForFinal()) { ?>
|
||||
<hr />
|
||||
<h2>Autorisations pour la finale</h2>
|
||||
<?php
|
||||
printDocuments($documents_final);
|
||||
}
|
||||
// TODO Add documents
|
||||
# printDocuments($documents);
|
||||
}
|
||||
|
||||
require_once "footer.php";
|
@ -42,46 +42,6 @@ if (isset($user) && !$has_error) {
|
||||
<td><input style="width: 100%;" type="text" id="first_name" name="first_name"
|
||||
value="<?php if (isset($user)) echo $user->first_name ?>" required/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="birth_date">Date de naissance :</label></td>
|
||||
<td><input style="width: 100%;" type="date" id="birth_date" name="birth_date"
|
||||
value="<?php if (isset($user)) echo $user->birth_date ?>" required/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="gender">Sexe :</label></td>
|
||||
<td><input type="radio" id="male" name="gender" value="M"
|
||||
required <?= isset($_POST["gender"]) && $_POST["gender"] == "M" ? "checked" : "" ?> /><label
|
||||
for="male">Homme</label>
|
||||
<input type="radio" id="female" name="gender" value="F"
|
||||
required <?= isset($_POST["gender"]) && $_POST["gender"] == "F" ? "checked" : "" ?> /><label
|
||||
for="female">Femme</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="address">Adresse :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="address" name="address"
|
||||
value="<?php if (isset($user)) echo $user->address ?>"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="postal_code">Code postal :</label></td>
|
||||
<td><input style="width: 100%;" type="number" id="postal_code" name="postal_code"
|
||||
value="<?php if (isset($user)) echo $user->postal_code ?>" min="1000"
|
||||
max="95999" required/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="city">Ville :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="city" name="city"
|
||||
value="<?php if (isset($user)) echo $user->city ?>"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="country">Pays :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="country" name="country"
|
||||
value="<?= isset($user) ? $user->country : "France" ?>" required/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="phone_number">Numéro de téléphone :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="phone_number" name="phone_number"
|
||||
value="<?php if (isset($user)) echo $user->phone_number ?>"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="role">Rôle :</label></td>
|
||||
<td><select style="width: 100%;" id="role" name="role" onchange="selectRole()">
|
||||
@ -102,26 +62,6 @@ if (isset($user) && !$has_error) {
|
||||
<option value="seconde"><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_name_label" for="responsible_name">Nom du responsable légal :</label></td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_name" name="responsible_name"
|
||||
value="<?php if (isset($user)) echo $user->responsible_name ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_phone_label" for="responsible_phone">Téléphone du responsable légal :</label>
|
||||
</td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_phone" name="responsible_phone"
|
||||
value="<?php if (isset($user)) echo $user->responsible_phone ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="responsible_email_label" for="responsible_email">Email du responsable légal :</label>
|
||||
</td>
|
||||
<td><input style="width: 100%;" type="text" id="responsible_email" name="responsible_email"
|
||||
value="<?php if (isset($user)) echo $user->responsible_email ?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="description_label" for="description">Description :</label></td>
|
||||
<td><textarea style="width: 100%;" id="description"
|
||||
@ -140,30 +80,16 @@ if (isset($user) && !$has_error) {
|
||||
case "participant":
|
||||
document.getElementById("school_label").style.display = "block";
|
||||
document.getElementById("school").style.display = "block";
|
||||
document.getElementById("school").require = "true";
|
||||
document.getElementById("class_label").style.display = "block";
|
||||
document.getElementById("class").style.display = "block";
|
||||
document.getElementById("responsible_name_label").style.display = "block";
|
||||
document.getElementById("responsible_name").style.display = "block";
|
||||
document.getElementById("responsible_phone_label").style.display = "block";
|
||||
document.getElementById("responsible_phone").style.display = "block";
|
||||
document.getElementById("responsible_email_label").style.display = "block";
|
||||
document.getElementById("responsible_email").style.display = "block";
|
||||
document.getElementById("description_label").style.display = "none";
|
||||
document.getElementById("description").style.display = "none";
|
||||
break;
|
||||
case "encadrant":
|
||||
document.getElementById("school_label").style.display = "none";
|
||||
document.getElementById("school").style.display = "none";
|
||||
document.getElementById("school").require = "false";
|
||||
document.getElementById("class_label").style.display = "none";
|
||||
document.getElementById("class").style.display = "none";
|
||||
document.getElementById("responsible_name_label").style.display = "none";
|
||||
document.getElementById("responsible_name").style.display = "none";
|
||||
document.getElementById("responsible_phone_label").style.display = "none";
|
||||
document.getElementById("responsible_phone").style.display = "none";
|
||||
document.getElementById("responsible_email_label").style.display = "none";
|
||||
document.getElementById("responsible_email").style.display = "none";
|
||||
document.getElementById("description_label").style.display = "block";
|
||||
document.getElementById("description").style.display = "block";
|
||||
break;
|
||||
|
@ -38,53 +38,6 @@ elseif (isset($my_account) || isset($new_password)) {
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="firstname" name="firstname"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="birth_date">Date de naissance :</label></td>
|
||||
<td><?= formatDate($user->getBirthDate()) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="date" id="birth_date" name="birth_date"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="gender">Sexe :</label></td>
|
||||
<td><input type="radio" id="male" name="gender" value="M" <?php if ($user->getGender() == "M") echo "checked" ?> /><label for="male">Homme</label>
|
||||
<input type="radio" id="female" name="gender" value="F" <?php if ($user->getGender() == "F") echo "checked" ?> /><label for="female">Femme</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="address">Adresse :</label></td>
|
||||
<td><?= $user->getAddress() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="address" name="address"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="postal_code">Code postal :</label></td>
|
||||
<td><?= $user->getPostalCode() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="number" id="postal_code" name="postal_code" min="1000" max="95999"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="city">Ville :</label></td>
|
||||
<td><?= $user->getCity() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="city" name="city"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="country">Pays :</label></td>
|
||||
<td><?= $user->getCountry() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="country" name="country"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="phone_number">Numéro de téléphone :</label></td>
|
||||
<td><?= $user->getPhoneNumber() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input style="width: 100%" type="text" id="phone_number" name="phone_number"/></td>
|
||||
</tr>
|
||||
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
|
||||
<tr>
|
||||
<td><label for="school">Établissement dans lequel l'élève étudie :</label></td>
|
||||
@ -101,45 +54,6 @@ elseif (isset($my_account) || isset($new_password)) {
|
||||
<option value="seconde" <?php if ($user->getClass() == SchoolClass::SECONDE) echo "selected" ?>><?= SchoolClass::getTranslatedName(SchoolClass::SECONDE) ?></option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="responsible_name">Nom du responsable légal :</label>
|
||||
</td>
|
||||
<td>
|
||||
<?= $user->getResponsibleName() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%;" type="text" id="responsible_name" name="responsible_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="responsible_phone">Téléphone du responsable légal :</label>
|
||||
</td>
|
||||
<td>
|
||||
<?= $user->getResponsiblePhone() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%" type="text" id="responsible_phone" name="responsible_phone" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="responsible_email">Email du responsable légal :</label>
|
||||
</td>
|
||||
<td>
|
||||
<?= $user->getResponsibleEmail() ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input style="width: 100%" type="email" id="responsible_email" name="responsible_email" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td><label for="description">Description :</label></td>
|
||||
|
@ -11,14 +11,12 @@ elseif (isset($send_document))
|
||||
|
||||
Nom de l'équipe : <?= $team->getName() ?><br/>
|
||||
Trigramme : <?= $team->getTrigram() ?><br/>
|
||||
Tournoi : <a href="<?= $tournament->getName() ?>"><?= $tournament->getName() ?></a><br/>
|
||||
Problème : <a href=""><?= $team->getProblem() ?></a><br/>
|
||||
<?php
|
||||
for ($i = 1; $i <= 2; ++$i) {
|
||||
if ($team->getEncadrants()[$i] == NULL)
|
||||
continue;
|
||||
$encadrant = User::fromId($team->getEncadrants()[$i - 1]);
|
||||
if ($team->getEncadrantId() !== null) {
|
||||
$encadrant = User::fromId($team->getEncadrantId());
|
||||
$id = $encadrant->getId();
|
||||
echo "Encadrant $i : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
||||
echo "Encadrant : <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
||||
}
|
||||
for ($i = 1; $i <= 6; ++$i) {
|
||||
if ($team->getParticipants()[$i - 1] == NULL)
|
||||
@ -29,10 +27,6 @@ for ($i = 1; $i <= 6; ++$i) {
|
||||
}
|
||||
?>
|
||||
Code d'accès : <strong><?= $team->getAccessCode() ?></strong><br/>
|
||||
<?php if ($team->isSelectedForFinal()) {
|
||||
$final_name = $FINAL->getName();
|
||||
echo "<strong>Équipe sélectionnée pour la <a href=\"$URL_BASE/tournoi/$final_name\">finale nationale</a>.</strong><br />";
|
||||
} ?>
|
||||
|
||||
<?php if (isset($_GET["modifier"])) { ?>
|
||||
|
||||
@ -59,13 +53,13 @@ for ($i = 1; $i <= 6; ++$i) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="tournament">Tournoi :</label>
|
||||
<label for="problem">Problème :</label>
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="tournament" name="tournament_id">
|
||||
<select style="width: 100%;" id="problem" name="problem">
|
||||
<?php
|
||||
foreach ($tournaments as $tournament)
|
||||
echo "<option value=\"" . $tournament->getId() . "\">" . $tournament->getName() . "</option>\n";
|
||||
for ($i = 1; $i <= 4; ++$i)
|
||||
echo "<option value=\"$i\"" . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>\n";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
@ -88,14 +82,8 @@ for ($i = 1; $i <= 6; ++$i) {
|
||||
<hr/>
|
||||
<h2>Mes autorisations</h2>
|
||||
<?php
|
||||
printDocuments($documents);
|
||||
|
||||
if ($team->isSelectedForFinal()) { ?>
|
||||
<hr/>
|
||||
<h2>Mes autorisations pour la finale</h2>
|
||||
<?php
|
||||
printDocuments($documents_final);
|
||||
}
|
||||
// TODO Add documents
|
||||
//printDocuments($documents);
|
||||
|
||||
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
||||
<hr />
|
||||
@ -109,11 +97,7 @@ for ($i = 1; $i <= 6; ++$i) {
|
||||
</td>
|
||||
<td>
|
||||
<select style="width: 100%;" id="type" name="type">
|
||||
<?php if ($_SESSION["user"]->getBirthDate() > strval($YEAR - 18) . substr($tournament->getStartDate(), 4)) { ?>
|
||||
<option value="parental_consent">Autorisation parentale</option>
|
||||
<?php } ?>
|
||||
<option value="photo_consent">Autorisation de droit à l'image</option>
|
||||
<option value="sanitary_plug">Fiche sanitaire</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@ -144,8 +128,9 @@ for ($i = 1; $i <= 6; ++$i) {
|
||||
</form>
|
||||
</td>
|
||||
<?php
|
||||
$can_validate = canValidate($team, $tournament);
|
||||
if ($can_validate) { ?>
|
||||
// TODO check end of inscription
|
||||
#$can_validate = canValidate($team, $tournament);
|
||||
if (true) { ?>
|
||||
<td style="width: 50%;">
|
||||
<form method="post">
|
||||
<input style="width: 100%;" type="submit" name="request_validation"
|
||||
|
Loading…
Reference in New Issue
Block a user