plateforme-tfjm2/server_files/tournois.php

58 lines
3.2 KiB
PHP

<?php
include 'config.php';
$response = $DB->query("SELECT `name`, `date_start`, `date_end`, `date_inscription`, `date_solutions`, `size` FROM `tournaments`
WHERE `year` = '$YEAR' AND `final` = false ORDER BY `date_start`, `name`;");
$final_data = $DB->query("SELECT `name`, `date_start`, `date_end`, `date_solutions`, `size` FROM `tournaments` WHERE `final` AND `year` = $YEAR;")->fetch();
?>
<?php include "header.php" ?>
<h2>Liste des tournois</h2>
<table style="border: 1px solid black; width: 100%">
<thead style="border: 1px solid black">
<tr>
<th style="border: 1px solid black; text-align: center">Lieu</th>
<th style="border: 1px solid black; text-align: center">Dates</th>
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
<th style="border: 1px solid black; text-align: center">Date de rendu des solutions</th>
<th style="border: 1px solid black; text-align: center">Places disponibles</th>
</tr>
</thead>
<tbody style="border: 1px solid black">
<?php
while (($data = $response->fetch()) !== FALSE) {
?>
<tr style="border: 1px solid black">
<td style="border: 1px solid black; text-align: center"><a href="<?= $URL_BASE ?>/tournoi/<?= $data["name"] ?>"><?= $data["name"] ?></a></td>
<td style="border: 1px solid black; text-align: center">Du <?php echo echo_date($data["date_start"]) ?> au <?php echo echo_date($data["date_end"]) ?></td>
<td style="border: 1px solid black; text-align: center"><?php echo echo_date($data["date_inscription"]) ?></td>
<td style="border: 1px solid black; text-align: center"><?php echo echo_date($data["date_solutions"]) ?></td>
<td style="border: 1px solid black; text-align: center"><?php echo $data["size"] ?></td>
</tr>
<?php
}
?>
<tr style="border: 1px solid black">
<td style="border: 1px solid black; text-align: center"><a href="<?= $URL_BASE ?>/tournoi/<?= $final_data["name"] ?>"><?= $final_data["name"] ?></a></td>
<td colspan="2" style="border: 1px solid black; text-align: center">Du <?php echo echo_date($final_data["date_start"]) ?> au <?php echo echo_date($final_data["date_end"]) ?></td>
<!-- <td style="border: 1px solid black; text-align: center"><?php echo echo_date($final_data["date_inscription"]) ?></td> -->
<td style="border: 1px solid black; text-align: center"><?php echo echo_date($final_data["date_solutions"]) ?></td>
<td style="border: 1px solid black; text-align: center"><?php echo $final_data["size"] ?></td>
</tr>
</tbody>
<tfoot style="border: 1px solid black">
<tr>
<th style="border: 1px solid black; text-align: center">Lieu</th>
<th style="border: 1px solid black; text-align: center">Dates</th>
<th style="border: 1px solid black; text-align: center">Inscription avant le</th>
<th style="border: 1px solid black; text-align: center">Date de rendu des solutions</th>
<th style="border: 1px solid black; text-align: center">Places disponibles</th>
</tr>
</tfoot>
</table>
<?php include "footer.php" ?>