mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-26 05:02:21 +00:00
153 lines
6.0 KiB
PHP
153 lines
6.0 KiB
PHP
<?php
|
|
require_once "header.php";
|
|
?>
|
|
|
|
<div class="mt-4 mb-4">
|
|
<h1 class="display-4">Mon équipe</h1>
|
|
</div>
|
|
|
|
<?php if (!$has_error && isset($send_document)) { ?>
|
|
<div class="alert alert-success">
|
|
Le fichier a été correctement envoyé !
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<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();
|
|
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 />";
|
|
}
|
|
for ($i = 1; $i <= 5; ++$i) {
|
|
if ($team->getParticipants()[$i - 1] == NULL)
|
|
continue;
|
|
$participant = User::fromId($team->getParticipants()[$i - 1]);
|
|
$id = $participant->getId();
|
|
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 />";
|
|
}
|
|
|
|
?>
|
|
</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>
|
|
|
|
<?php if (date("Y-m-d H:i:s") >= $CONFIG->getInscriptionDate() && $team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
|
<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>
|
|
<?php } else {
|
|
if (isset($_GET["modifier"])) { ?>
|
|
|
|
<form method="POST">
|
|
<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>
|
|
</form>
|
|
|
|
<?php } else { ?>
|
|
|
|
<?php if ($team->getValidationStatus() == ValidationStatus::NOT_READY && date("Y-m-d H:i:s") <= $CONFIG->getInscriptionDate()) { ?>
|
|
<!--suppress HtmlUnknownTarget -->
|
|
<a href="/mon-equipe/modifier">
|
|
<button class="btn btn-secondary btn-lg btn-block">Modifier mon équipe</button>
|
|
</a>
|
|
<?php } ?>
|
|
<hr/><div class="mt-4 mb-4">
|
|
<h1 class="display-5">Autorisation de droit à l'image</h1>
|
|
</div>
|
|
<?php
|
|
printDocuments($documents);
|
|
|
|
if ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
|
|
<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>
|
|
</form>
|
|
|
|
<hr/>
|
|
|
|
<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) { ?>
|
|
<hr />
|
|
<form method="post">
|
|
<label for="engage">Je m'engage à participer à l'intégralité des Correspondances</label>
|
|
<input type="checkbox" name="engage" id="engage"/>
|
|
<input class="btn btn-primary btn-lg btn-block" type="submit" name="request_validation"
|
|
value="Demander la validation"/>
|
|
</form>
|
|
<?php } ?>
|
|
<?php }
|
|
elseif ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
|
|
<div class="alert alert-warning">
|
|
Votre équipe est en attente de validation.
|
|
</div>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
|
|
<?php require_once "footer.php" ?>
|