1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 15:37:27 +02:00

Améliorations du code

This commit is contained in:
Yohann
2019-09-08 01:35:05 +02:00
committed by galaxyoyo
parent 3cc66ef783
commit a25ec69ae9
23 changed files with 558 additions and 457 deletions

View File

@ -119,4 +119,18 @@ function tournamentExists($name) {
$req = $DB->prepare("SELECT `id` FROM `tournaments` WHERE `name` = ? AND `year` = '$YEAR';");
$req->execute([$name]);
return $req->fetch();
}
function printDocuments($documents) {
global $URL_BASE;
foreach ($documents as $document) {
$file_id = $document->getFileId();
$user = User::fromId($document->getUserId());
$surname = $user->getSurname();
$first_name = $user->getFirstName();
$name = DocumentType::getTranslatedName($document->getType());
$version = $document->getVersion();
echo "$name de $first_name $surname (version $version) : <a href=\"$URL_BASE/file/$file_id\">Télécharger</a><br />";
}
}