1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-03 08:42:47 +02:00

Export des données

This commit is contained in:
Yohann
2019-10-18 22:23:00 +02:00
parent d989b1bf1a
commit 54fc6fd395
7 changed files with 264 additions and 56 deletions

View File

@ -0,0 +1,42 @@
<?php
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ADMIN)
require_once "server_files/403.php";
if (isset($_POST["export_user_data"])) {
$file_name = exportUserData();
header("Content-Type: text/csv");
header("Content-Disposition: inline; filename=\"Données utilisateurs.csv\"");
header("Content-Length: " . strval(filesize($file_name)));
readfile($file_name);
exit();
}
if (isset($_POST["export_team_data"])) {
$file_name = exportTeamData();
header("Content-Type: text/csv");
header("Content-Disposition: inline; filename=\"Données équipes.csv\"");
header("Content-Length: " . strval(filesize($file_name)));
readfile($file_name);
exit();
}
if (isset($_POST["export_problems_data"])) {
$file_name = exportProblemsData();
header("Content-Type: text/csv");
header("Content-Disposition: inline; filename=\"Données problèmes.csv\"");
header("Content-Length: " . strval(filesize($file_name)));
readfile($file_name);
exit();
}
require_once "server_files/views/exporter_donnees.php";