plateforme-tfjm2/server_files/controllers/syntheses_orga.php

22 lines
796 B
PHP
Raw Normal View History

<?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"];
2019-09-07 23:35:05 +00:00
$tournament = Tournament::fromId($id);
2019-09-09 10:15:48 +00:00
$file_name = getZipFile(DocumentType::SYNTHESIS, $id);
header("Content-Type: application/zip");
2019-09-07 23:35:05 +00:00
header("Content-Disposition: attachment; filename=\"Notes de syntèses du tournoi de " . $tournament->getName() . ".zip\"");
2019-09-09 10:15:48 +00:00
header("Content-Length: " . filesize($file_name));
2019-09-09 10:15:48 +00:00
readfile($file_name);
exit();
}
2019-09-07 23:35:05 +00:00
$user = $_SESSION["user"];
$tournaments = $_SESSION["role"] == Role::ADMIN ? Tournament::getAllTournaments() : $user->getOrganizedTournaments();
2019-08-21 20:56:46 +00:00
2019-09-07 23:35:05 +00:00
require_once "server_files/views/syntheses_orga.php";