1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-27 02:13:06 +00:00
plateforme-tfjm2/server_files/views/solutions.php

63 lines
1.9 KiB
PHP
Raw Normal View History

<?php
require_once "header.php";
2019-12-19 12:02:01 +00:00
if (!$has_error && isset($save_solution)) { ?>
<div class="alert alert-success">
Le fichier a été correctement envoyé !
</div>
<?php } ?>
2019-09-06 11:48:50 +00:00
2020-01-01 21:41:08 +00:00
<?php if (date("Y-m-d H:i:s") < $tournament->getSolutionsDate()) { ?>
2019-09-07 23:35:05 +00:00
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
2019-12-19 12:02:01 +00:00
<div class="form-row">
<div class="form-group col-md-6">
<label for="problem">Problème :</label>
<select class="custom-select" id="problem" name="problem">
<?php
for ($i = 1; $i <= 9; ++$i) {
echo "<option value=\"$i\">$i</option>\n";
}
?>
</select>
</div>
<div class="form-group col-md-6">
<label for="file">Fichier :</label>
<input class="form-control" type="file" id="file" name="solution"/>
</div>
</div>
<input class="btn btn-lg btn-primary btn-block" type="submit" name="send_solution" value="Envoyer" />
2019-09-07 23:35:05 +00:00
</form>
2019-09-06 11:48:50 +00:00
<?php } ?>
2019-09-07 23:35:05 +00:00
<hr/>
2019-09-06 11:48:50 +00:00
2019-09-07 23:35:05 +00:00
<h2>Solutions soumises :</h2>
2019-09-06 11:48:50 +00:00
<?php
2019-09-07 23:35:05 +00:00
/** @var Solution $sol */
foreach ($solutions as $sol) {
$file_id = $sol->getFileId();
$problem = $sol->getProblem();
$version = $sol->getVersion();
2019-12-19 12:02:01 +00:00
echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
2019-09-06 11:48:50 +00:00
}
2019-09-07 23:35:05 +00:00
if ($team->isSelectedForFinal()) { ?>
<hr/>
<h2>Solutions soumises pour la finale :</h2>
<?php
/** @var Solution $sol */
foreach ($solutions_final as $sol) {
$file_id = $sol->getFileId();
$problem = $sol->getProblem();
$version = $sol->getVersion();
2019-12-19 12:02:01 +00:00
echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
2019-09-07 23:35:05 +00:00
}
}
require_once "footer.php";