63 lines
1.9 KiB
PHP
63 lines
1.9 KiB
PHP
<?php
|
|
require_once "header.php";
|
|
|
|
if (!$has_error && isset($save_solution)) { ?>
|
|
<div class="alert alert-success">
|
|
Le fichier a été correctement envoyé !
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { ?>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="MAX_FILE_SIZE" value="5000000"/>
|
|
<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" />
|
|
</form>
|
|
<?php } ?>
|
|
|
|
<hr/>
|
|
|
|
<h2>Solutions soumises :</h2>
|
|
|
|
<?php
|
|
/** @var Solution $sol */
|
|
foreach ($solutions as $sol) {
|
|
$file_id = $sol->getFileId();
|
|
$problem = $sol->getProblem();
|
|
$version = $sol->getVersion();
|
|
echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
|
|
}
|
|
|
|
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();
|
|
echo "<div class=\"alert alert-info\"><strong>Problème $problem</strong> (Version $version) : <a href=\"/file/$file_id\">Télécharger</a></div>\n";
|
|
}
|
|
}
|
|
|
|
require_once "footer.php";
|