2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
require_once "header.php";
|
|
|
|
?>
|
|
|
|
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="mt-4 mb-4">
|
|
|
|
<h1 class="display-4">Mon équipe</h1>
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-24 22:43:26 +00:00
|
|
|
<?php if (!$has_error && isset($send_document)) { ?>
|
|
|
|
<div class="alert alert-success">
|
|
|
|
Le fichier a été correctement envoyé !
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
2019-09-12 16:47:57 +00:00
|
|
|
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="alert alert-info">
|
|
|
|
<strong>Nom de l'équipe :</strong> <?= $team->getName() ?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<strong>Trigramme :</strong> <?= $team->getTrigram() ?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<strong>Problème :</strong> <a href="/probleme/<?= $team->getProblem() ?>"><?= $team->getProblem() ?></a>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<?php
|
|
|
|
if ($team->getEncadrantId() !== null) {
|
|
|
|
$encadrant = User::fromId($team->getEncadrantId());
|
|
|
|
$id = $encadrant->getId();
|
2019-09-24 22:57:41 +00:00
|
|
|
if ($_SESSION["role"] == Role::ADMIN)
|
|
|
|
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName()
|
|
|
|
. " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
|
|
|
|
else
|
|
|
|
echo "<strong>Encadrant :</strong> " . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "<br />";
|
2019-09-24 22:43:26 +00:00
|
|
|
}
|
|
|
|
for ($i = 1; $i <= 5; ++$i) {
|
|
|
|
if ($team->getParticipants()[$i - 1] == NULL)
|
|
|
|
continue;
|
|
|
|
$participant = User::fromId($team->getParticipants()[$i - 1]);
|
|
|
|
$id = $participant->getId();
|
2019-09-24 22:57:41 +00:00
|
|
|
if ($_SESSION["role"] == Role::ADMIN)
|
|
|
|
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName()
|
|
|
|
. " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
|
|
|
|
else
|
|
|
|
echo "<strong>Participant $i :</strong> " . $participant->getFirstName() . " " . $participant->getSurname() . "<br />";
|
2019-09-24 22:43:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
Code d'accès : <strong><?= $team->getAccessCode() ?></strong>
|
|
|
|
</div>
|
|
|
|
<div class="alert alert-info">
|
|
|
|
<!--suppress HtmlUnknownTarget -->
|
|
|
|
Autorise Animath à diffuser mes vidéos : <?= $team->allowPublish() ? "oui" : "non" ?> (<a
|
|
|
|
href="/mon-equipe/diffusion-videos">changer</a>)
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php if (date("Y-m-d H:i:s") >= $CONFIG->getInscriptionDate() && $team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="alert alert-danger">
|
|
|
|
La date limite d'inscription est dépassée, vous ne pouvez plus demander la validation de votre équipe.
|
|
|
|
</div>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } else {
|
|
|
|
if (isset($_GET["modifier"])) { ?>
|
2019-09-09 23:48:52 +00:00
|
|
|
|
2019-09-12 16:47:57 +00:00
|
|
|
<form method="POST">
|
2019-09-24 22:43:26 +00:00
|
|
|
<div class="form-row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="name">Nom :</label>
|
|
|
|
<input class="form-control" type="text" id="name" name="name"
|
|
|
|
value="<?= $team->getName() ?>" required/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label for="trigram">Trigramme :</label>
|
|
|
|
<input class="form-control" type="text" id="trigram" name="trigram"
|
|
|
|
value="<?= $team->getTrigram() ?>" pattern="[A-Z]{3}" maxlength="3" required/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="problem">Problème :</label>
|
|
|
|
<select id="problem" name="problem" class="custom-select">
|
|
|
|
<?php
|
|
|
|
for ($i = 1; $i <= 4; ++$i)
|
|
|
|
echo "<option value='$i' " . ($team->getProblem() == $i ? "selected" : "") . ">$i</option>";
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" name="team_edit" type="submit"
|
|
|
|
value="Modifier l'équipe"/>
|
|
|
|
</div>
|
2019-09-09 23:48:52 +00:00
|
|
|
</form>
|
2019-09-12 16:47:57 +00:00
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
2019-09-24 08:08:53 +00:00
|
|
|
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY && date("Y-m-d H:i:s") <= $CONFIG->getInscriptionDate()) { ?>
|
2019-09-12 16:47:57 +00:00
|
|
|
<!--suppress HtmlUnknownTarget -->
|
2019-09-24 22:43:26 +00:00
|
|
|
<a href="/mon-equipe/modifier">
|
|
|
|
<button class="btn btn-secondary btn-lg btn-block">Modifier mon équipe</button>
|
|
|
|
</a>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } ?>
|
2019-09-24 22:57:41 +00:00
|
|
|
<hr/><div class="mt-4 mb-4">
|
|
|
|
<h1 class="display-5">Autorisation de droit à l'image</h1>
|
|
|
|
</div>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php
|
|
|
|
printDocuments($documents);
|
|
|
|
|
|
|
|
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
2019-09-24 22:43:26 +00:00
|
|
|
<form method="POST" enctype="multipart/form-data">
|
|
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
<div class="form-group col-md-12">
|
|
|
|
<label for="document">Fichier :</label>
|
|
|
|
<input class="form-control" type="file" id="document" name="document" required/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="send_document"
|
|
|
|
value="Envoyer le document"/>
|
|
|
|
</div>
|
2019-09-12 16:47:57 +00:00
|
|
|
</form>
|
2019-09-24 22:43:26 +00:00
|
|
|
|
2019-09-12 16:47:57 +00:00
|
|
|
<hr/>
|
2019-09-24 22:43:26 +00:00
|
|
|
|
|
|
|
<form method="POST">
|
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="leave_team"
|
|
|
|
value="Quitter l'équipe"/>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$can_validate = canValidate($team);
|
|
|
|
if ($can_validate) { ?>
|
2019-09-24 23:08:38 +00:00
|
|
|
<hr />
|
2019-09-24 22:43:26 +00:00
|
|
|
<form method="post">
|
2019-09-24 23:08:38 +00:00
|
|
|
<label for="engage">Je m'engage à participer à l'intégralité des Correspondances</label>
|
2019-09-26 20:24:18 +00:00
|
|
|
<input type="checkbox" name="engage" id="engage"/>
|
2019-09-24 22:43:26 +00:00
|
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="request_validation"
|
|
|
|
value="Demander la validation"/>
|
|
|
|
</form>
|
|
|
|
<?php } ?>
|
2019-09-24 23:08:38 +00:00
|
|
|
<?php }
|
|
|
|
elseif ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
Votre équipe est en attente de validation.
|
|
|
|
</div>
|
|
|
|
<?php } elseif (Phase::getCurrentPhase() >= Phase::PHASE1) { ?>
|
2019-09-24 08:42:20 +00:00
|
|
|
<hr/>
|
|
|
|
<h2>Déroulement du tournoi</h2>
|
|
|
|
<?php if ($video != null) { ?>
|
|
|
|
<h4>Vidéo de solution proposée :</h4>
|
|
|
|
Lien de la vidéo : <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a><br/>
|
|
|
|
<?php displayVideo($video->getLink()) ?>
|
|
|
|
<br/>
|
|
|
|
<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
|
|
|
|
<h4>Questions reçues :</h4>
|
|
|
|
<?php
|
|
|
|
for ($i = 0; $i < 2; ++$i) {
|
|
|
|
if ($questions_received[$i] == null)
|
|
|
|
continue;
|
|
|
|
$asker = Team::fromId($questions_received[$i][0]->getFrom());
|
|
|
|
$answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2, $asker);
|
|
|
|
?>
|
|
|
|
<h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5>
|
2019-09-24 22:43:26 +00:00
|
|
|
<table>
|
2019-09-24 08:42:20 +00:00
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
for ($j = 0; $j < 6; ++$j) {
|
|
|
|
/** @var Question $question */
|
|
|
|
$question = $questions_received[$i][$j];
|
|
|
|
if ($question->getQuestion() === null)
|
|
|
|
continue;
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Question <?= $question->getNumber() ?> :
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?= $question->getQuestion() ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($question->getAttachedFile() !== null) { ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<em>Pièce jointe attachée :</em>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Réponse :
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?= $question->getAnswer() ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($question->getAttachedFileAnswer() !== null) { ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<em>Pièce jointe attachée :</em>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="/file/<?= $question->getAttachedFileAnswer() ?>">Télécharger</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
|
|
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
|
|
|
|
<h6>Vidéo de réponse proposée par l'équipe :</h6>
|
|
|
|
Lien de la vidéo : <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a><br/>
|
|
|
|
<?php displayVideo($answer->getLink()) ?>
|
|
|
|
<br/>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if (Phase::getCurrentPhase() >= 2) {
|
|
|
|
for ($i = 0; $i < 2; ++$i) {
|
|
|
|
$defender = Team::fromId($team->getVideoTeamIds()[$i]);
|
|
|
|
if ($defender == null)
|
|
|
|
continue;
|
|
|
|
$sol = Video::getVideo(Reason::SOLUTION, $defender);
|
|
|
|
$answer = Video::getVideo($i == 0 ? Reason::ANSWER1 : Reason::ANSWER2, $team);
|
|
|
|
$questions = Question::getQuestions($team, $defender);
|
|
|
|
?>
|
|
|
|
<h4>Vidéo de solution proposée par l'équipe <?= $defender->getName() ?>
|
|
|
|
(<?= $defender->getTrigram() ?>) :</h4>
|
|
|
|
Lien de la vidéo : <a href="<?= $sol->getLink() ?>"><?= $sol->getLink() ?></a><br/>
|
|
|
|
<?php displayVideo($sol->getLink()) ?>
|
|
|
|
<br/>
|
|
|
|
<h5>Vos questions :</h5>
|
|
|
|
<br/>
|
2019-09-24 22:43:26 +00:00
|
|
|
<table>
|
2019-09-24 08:42:20 +00:00
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
for ($j = 0; $j < 6; ++$j) {
|
|
|
|
/** @var Question $question */
|
|
|
|
$question = $questions[$j];
|
|
|
|
if ($question->getQuestion() === null)
|
|
|
|
continue;
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Question <?= $question->getNumber() ?> :
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?= $question->getQuestion() ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($question->getAttachedFile() !== null) { ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<em>Pièce jointe attachée :</em>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="/file/<?= $question->getAttachedFile() ?>">Télécharger</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Réponse :
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?= $question->getAnswer() ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($question->getAttachedFileAnswer() !== null) { ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<em>Pièce jointe attachée :</em>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="/file/<?= $question->getAttachedFileAnswer() ?>">Télécharger</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
|
|
<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
|
|
|
|
<h5>Votre vidéo de réponse :</h5>
|
|
|
|
Lien de la vidéo : <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a><br/>
|
|
|
|
<?php displayVideo($answer->getLink()) ?>
|
|
|
|
<hr/>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
2019-09-12 16:47:57 +00:00
|
|
|
<?php } ?>
|
2019-09-09 23:48:52 +00:00
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|