1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 19:37:23 +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

@ -18,7 +18,8 @@
<option value="0">Pas de problème choisi</option>
<?php
for ($i = 1; $i <= 4; ++$i) { ?>
<option value="<?= $i ?>" <?= $team->getProblem() == $i ? "selected" : "" ?>>Problème <?= $i ?></option>
<option value="<?= $i ?>" <?= $team->getProblem() == $i ? "selected" : "" ?>>
Problème <?= $i ?></option>
<?php } ?>
</select>
</form>
@ -33,60 +34,61 @@
:</strong> <?= ValidationStatus::getTranslatedName($team->getValidationStatus()) ?>
</div>
<div class="alert alert-info">
<?php
if ($team->getEncadrantId() !== null) {
$encadrant = User::fromId($team->getEncadrantId());
$id = $encadrant->getId();
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 5; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
<?php
if ($team->getEncadrantId() !== null) {
$encadrant = User::fromId($team->getEncadrantId());
$id = $encadrant->getId();
echo "<strong>Encadrant :</strong> <a href=\"$URL_BASE/informations/$id/" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "\">" . $encadrant->getFirstName() . " " . $encadrant->getSurname() . "</a><br />";
}
for ($i = 1; $i <= 5; ++$i) {
if ($team->getParticipants()[$i - 1] == NULL)
continue;
$participant = User::fromId($team->getParticipants()[$i - 1]);
$id = $participant->getId();
echo "<strong>Participant $i :</strong> <a href=\"$URL_BASE/informations/$id/" . $participant->getFirstName() . " " . $participant->getSurname() . "\">" . $participant->getFirstName() . " " . $participant->getSurname() . "</a><br />";
}
?>
</div>
<div class="alert alert-info">
<strong>Autorise Animath à diffuser les vidéos :</strong> <?= $team->allowPublish() ? "oui" : "non" ?>
</div>
<?php
if ($_SESSION["role"] == Role::ADMIN) { ?>
<? if ($team->getValidationStatus() == ValidationStatus::VALIDATED) { ?>
<hr/>
<!--suppress HtmlUnknownTarget -->
<a href="/suivi-correspondances#team-<?= $team->getTrigram() ?>"><button class="btn btn-primary btn-lg btn-block">
Aller aux vidéos de l'équipe</button></a><br />
<form method="POST">
<div class="form-group row">
<div class="form-group col-md-12">
<label for="other_teams">L'équipe va recevoir les questions des équipes suivantes (merci d'en
sélectionner exactement 2) :</label>
<select class="custom-select" id="other_teams" name="other_teams[]" multiple <?= Phase::getCurrentPhase() >= Phase::PHASE2 ? "disabled" : "" ?>>
<?php
/** @var Team $other_team */
foreach ($other_teams as $other_team) {
if ($other_team->getId() == $team->getId())
continue;
<? if ($team->getValidationStatus() == ValidationStatus::VALIDATED) { ?>
<hr/>
<!--suppress HtmlUnknownTarget -->
<a href="/suivi-correspondances#team-<?= $team->getTrigram() ?>">
<button class="btn btn-primary btn-lg btn-block">
Aller aux vidéos de l'équipe
</button>
</a><br/>
<form method="POST">
<div class="form-group row">
<div class="form-group col-md-12">
<label for="other_teams">L'équipe va recevoir les questions des équipes suivantes (merci d'en
lectionner exactement 2) :</label>
<select class="custom-select" id="other_teams" name="other_teams[]"
multiple <?= Phase::getCurrentPhase() >= Phase::PHASE2 ? "disabled" : "" ?>>
<?php
/** @var Team $other_team */
foreach ($other_teams as $other_team) {
if ($other_team->getId() == $team->getId())
continue;
$team_name = $other_team->getName() . " (" . $other_team->getTrigram() . ")";
$team_id = $other_team->getId();
echo "<option value=\"$team_id\" " . (in_array($other_team->getId(), $team->getVideoTeamIds()) ? "selected" : "") . ">$team_name</option>\n";
}
?>
</select>
</div>
$team_name = $other_team->getName() . " (" . $other_team->getTrigram() . ")";
$team_id = $other_team->getId();
echo "<option value=\"$team_id\" " . (in_array($other_team->getId(), $team->getVideoTeamIds()) ? "selected" : "") . ">$team_name</option>\n";
}
?>
</select>
</div>
<div class="form-group row">
<?php if (Phase::getCurrentPhase() < Phase::PHASE2) { ?>
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="update_video_teams"
value="Mettre à jour"/>
<?php } ?>
</div>
</form>
<?php } ?>
</div>
<div class="form-group row">
<?php if (Phase::getCurrentPhase() < Phase::PHASE2) { ?>
<input type="submit" class="btn btn-secondary btn-lg btn-block" name="update_video_teams"
value="Mettre à jour"/>
<?php } ?>
</div>
</form>
<?php } ?>
<hr/>
@ -100,7 +102,7 @@ if ($_SESSION["role"] == Role::ADMIN) { ?>
value="Télécharger l'archive"/>
</form>
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING && $_SESSION["role"] == Role::ADMIN) { ?>
<?php if ($team->getValidationStatus() == ValidationStatus::WAITING) { ?>
<hr/>
<form method="POST">
<div class="form-group">
@ -111,11 +113,12 @@ if ($_SESSION["role"] == Role::ADMIN) { ?>
</div>
</div>
</form>
<?php
} elseif ($team->getValidationStatus() == ValidationStatus::NOT_READY && $_SESSION["role"] == Role::ADMIN) { ?>
<?php
} elseif ($team->getValidationStatus() == ValidationStatus::NOT_READY) { ?>
<hr/>
<form method="POST">
<input type="submit" class="btn btn-primary btn-lg btn-block" name="delete_team" value="Supprimer l'équipe" style="background-color: #ff2e34"/>
<input type="submit" class="btn btn-primary btn-lg btn-block" name="delete_team" value="Supprimer l'équipe"
style="background-color: #ff2e34"/>
</form>
<?php }