2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ORGANIZER && $_SESSION["role"] != Role::ADMIN)
|
|
|
|
require_once "server_files/403.php";
|
|
|
|
|
|
|
|
$trigram = htmlspecialchars($_GET["trigram"]);
|
|
|
|
|
|
|
|
$team = Team::fromTrigram($trigram);
|
|
|
|
|
|
|
|
if ($team === null)
|
|
|
|
require_once "server_files/404.php";
|
|
|
|
|
|
|
|
if (isset($_POST["validate"])) {
|
|
|
|
$team->setValidationStatus(ValidationStatus::VALIDATED);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_POST["download_zip"])) {
|
|
|
|
$final = isset($_POST["final"]);
|
|
|
|
|
2019-09-10 23:17:05 +00:00
|
|
|
$file_name = getZipFile(DocumentType::PARENTAL_CONSENT, $tournament->getId(), $team->getId());
|
2019-09-09 23:48:52 +00:00
|
|
|
|
|
|
|
header("Content-Type: application/zip");
|
|
|
|
header("Content-Disposition: attachment; filename=\"Documents de l'équipe " . $team->getTrigram() . ".zip\"");
|
|
|
|
header("Content-Length: " . strval(filesize($file_name)));
|
|
|
|
|
|
|
|
readfile($file_name);
|
|
|
|
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$documents = $tournament->getAllDocuments($team->getId());
|
|
|
|
$documents_final = null;
|
|
|
|
|
|
|
|
require_once "server_files/views/equipe.php";
|