Corrections mineures
This commit is contained in:
parent
2b1bb79efb
commit
6bb27034ce
|
@ -3,7 +3,6 @@
|
||||||
require_once "server_files/config.php";
|
require_once "server_files/config.php";
|
||||||
|
|
||||||
require_once "server_files/classes/Document.php";
|
require_once "server_files/classes/Document.php";
|
||||||
require_once "server_files/classes/DocumentType.php";
|
|
||||||
require_once "server_files/classes/Phase.php";
|
require_once "server_files/classes/Phase.php";
|
||||||
require_once "server_files/classes/Question.php";
|
require_once "server_files/classes/Question.php";
|
||||||
require_once "server_files/classes/Reason.php";
|
require_once "server_files/classes/Reason.php";
|
||||||
|
|
|
@ -6,7 +6,6 @@ class Document
|
||||||
private $user_id;
|
private $user_id;
|
||||||
private $team_id;
|
private $team_id;
|
||||||
private $problem;
|
private $problem;
|
||||||
private $type;
|
|
||||||
private $uploaded_at;
|
private $uploaded_at;
|
||||||
private $version;
|
private $version;
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ class Document
|
||||||
$this->user_id = $data["user"];
|
$this->user_id = $data["user"];
|
||||||
$this->team_id = $data["team"];
|
$this->team_id = $data["team"];
|
||||||
$this->problem = $data["problem"];
|
$this->problem = $data["problem"];
|
||||||
$this->type = DocumentType::fromName($data["type"]);
|
|
||||||
$this->uploaded_at = $data["uploaded_at"];
|
$this->uploaded_at = $data["uploaded_at"];
|
||||||
$this->version = isset($data["version"]) ? $data["version"] : 1;
|
$this->version = isset($data["version"]) ? $data["version"] : 1;
|
||||||
}
|
}
|
||||||
|
@ -63,11 +61,6 @@ class Document
|
||||||
return $this->problem;
|
return $this->problem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType()
|
|
||||||
{
|
|
||||||
return $this->type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getUploadedAt()
|
public function getUploadedAt()
|
||||||
{
|
{
|
||||||
return $this->uploaded_at;
|
return $this->uploaded_at;
|
||||||
|
@ -86,7 +79,7 @@ class Document
|
||||||
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
|
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
|
||||||
. "INNER JOIN (SELECT `user`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `user`) `t2` "
|
. "INNER JOIN (SELECT `user`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `user`) `t2` "
|
||||||
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`problem` = `t2`.`problem` "
|
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`problem` = `t2`.`problem` "
|
||||||
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . " ORDER BY `t1`.`type`;");
|
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . ";");
|
||||||
|
|
||||||
$docs = [];
|
$docs = [];
|
||||||
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
class DocumentType
|
|
||||||
{
|
|
||||||
const PHOTO_CONSENT = 0;
|
|
||||||
|
|
||||||
public static function getTranslatedName($type) {
|
|
||||||
switch ($type) {
|
|
||||||
default:
|
|
||||||
return "Autorisation de droit à l'image";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getName($type) {
|
|
||||||
switch ($type) {
|
|
||||||
default:
|
|
||||||
return "PHOTO_CONSENT";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function fromName($name) {
|
|
||||||
switch ($name) {
|
|
||||||
default:
|
|
||||||
return self::PHOTO_CONSENT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -121,7 +121,7 @@ function printDocuments($documents)
|
||||||
$user = User::fromId($document->getUserId());
|
$user = User::fromId($document->getUserId());
|
||||||
$surname = $user->getSurname();
|
$surname = $user->getSurname();
|
||||||
$first_name = $user->getFirstName();
|
$first_name = $user->getFirstName();
|
||||||
$name = DocumentType::getTranslatedName($document->getType());
|
$name = "Autorisation de droit à l'image";
|
||||||
$version = $document->getVersion();
|
$version = $document->getVersion();
|
||||||
echo "$name de $first_name $surname (version $version) : <a href=\"/file/$file_id\"><strong>Télécharger</strong></a><br />\n";
|
echo "$name de $first_name $surname (version $version) : <a href=\"/file/$file_id\"><strong>Télécharger</strong></a><br />\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
Nom de l'équipe : <?= $team->getName() ?><br/>
|
Nom de l'équipe : <?= $team->getName() ?><br/>
|
||||||
Trigramme : <?= $team->getTrigram() ?><br/>
|
Trigramme : <?= $team->getTrigram() ?><br/>
|
||||||
Problème : <a href="/problem/<?= $team->getProblem() ?>"><?= $team->getProblem() ?></a><br/>
|
Problème : <a href="/probleme/<?= $team->getProblem() ?>"><?= $team->getProblem() ?></a><br/>
|
||||||
<?php
|
<?php
|
||||||
if ($team->getEncadrantId() !== null) {
|
if ($team->getEncadrantId() !== null) {
|
||||||
$encadrant = User::fromId($team->getEncadrantId());
|
$encadrant = User::fromId($team->getEncadrantId());
|
||||||
|
|
|
@ -1,35 +1,44 @@
|
||||||
<?php require_once "header.php" ?>
|
<?php require_once "header.php" ?>
|
||||||
|
|
||||||
<div class="mt-4 mb-4">
|
<div class="mt-4 mb-4">
|
||||||
<h1 class="display-4"><?= $user->getFirstName() . " " . $user->getSurname() ?></h1>
|
<h1 class="display-4"><?= $user->getFirstName() . " " . $user->getSurname() ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<strong>Équipe :</strong> <?= $team === null ? "Pas d'équipe" : "<a href=\"/equipe/" . $team->getTrigram() . "\">"
|
<strong>Équipe
|
||||||
. $team->getName() . " (" . $team->getTrigram() . ")</a>" ?>
|
:</strong> <?= $team === null ? "Pas d'équipe" : "<a href=\"/equipe/" . $team->getTrigram() . "\">"
|
||||||
|
. $team->getName() . " (" . $team->getTrigram() . ")</a>" ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
|
<?php if ($user->getRole() == Role::PARTICIPANT) { ?>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<strong>Lycée :</strong> <?= $user->getSchool() ?><br />
|
<strong>Lycée :</strong> <?= $user->getSchool() ?><br/>
|
||||||
<strong>Classe :</strong> <?= SchoolClass::getTranslatedName($user->getClass()) ?>
|
<strong>Classe :</strong> <?= SchoolClass::getTranslatedName($user->getClass()) ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } elseif ($user->getDescription() != "") { ?>
|
<?php } elseif ($user->getDescription() != "") { ?>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<strong>Description :</strong> <?= $user->getDescription() ?>
|
<strong>Description :</strong> <?= $user->getDescription() ?>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php } ?>
|
||||||
|
|
||||||
echo "<hr />";
|
<div class="alert alert-info">
|
||||||
|
<strong>Adresse e-mail :</strong> <a href="mailto:<?= $user->getEmail() ?>"><?= $user->getEmail() ?></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
<div class="alert alert-info">
|
||||||
|
<strong>Autorise Animath à envoyer des mails :</strong> <?= $user->doReceiveAnimathMails() ? "oui" : "non" ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<?php if ($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCADRANT) { ?>
|
||||||
<div class="mt-4 mb-4">
|
<div class="mt-4 mb-4">
|
||||||
<h1 class="display-5">Autorisation de droit à l'image :</h1>
|
<h1 class="display-5">Autorisation de droit à l'image :</h1>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
printDocuments($documents);
|
printDocuments($documents);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once "footer.php";
|
require_once "footer.php";
|
Loading…
Reference in New Issue