1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-27 10:53:09 +00:00
plateforme-tfjm2/server_files/controllers/syntheses_orga.php
2019-09-09 12:15:48 +02:00

22 lines
796 B
PHP

<?php if (!isset($_SESSION["role"]) || $_SESSION["role"] != Role::ADMIN && $_SESSION["role"] != Role::ORGANIZER)
require_once "server_files/403.php";
if (isset($_POST["download_zip"])) {
$id = $_POST["tournament"];
$tournament = Tournament::fromId($id);
$file_name = getZipFile(DocumentType::SYNTHESIS, $id);
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"Notes de syntèses du tournoi de " . $tournament->getName() . ".zip\"");
header("Content-Length: " . filesize($file_name));
readfile($file_name);
exit();
}
$user = $_SESSION["user"];
$tournaments = $_SESSION["role"] == Role::ADMIN ? Tournament::getAllTournaments() : $user->getOrganizedTournaments();
require_once "server_files/views/syntheses_orga.php";