site-accueil-insa/admin/scores.php
2019-06-04 14:49:19 +02:00

78 lines
No EOL
2.5 KiB
PHP

<?php
ob_start(); // Start reading html
$relativePath = "../";
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Edition des scores</h2>
<ul>
<strong style="color: #ee293d">Quelques règles pour les scores</strong>
<li>Pas de score total négatif pour une équipe</li>
<li>A priori les scores supérieurs à 1000 marchent, mais au cas où restez à
moins de 1000 (comme l'année dernière quoi)</li>
</ul>
Si jamais y'a un quelconque problème, envoyez-moi un message.
<br>
<br>
<select id="teamSelect">
<option value="gli">Glissefondor</option>
<option value="pek">Peksentard</option>
<option value="boo">Boomsouffle</option>
<option value="ver">Verredaigle</option>
</select>
<div class="add-line">
<i class="fas fa-plus"></i>
</div>
<div class="edit-header">
<div class="stat-log">Log</div>
<div class="stat-points">Points</div>
<div class="stat-trash"><i class='fas fa-trash'></i></div>
</div>
<table class="stats-table edit-stats">
</table>
<div class="save">
<i class="fas fa-save"></i> Enregistrer
</div>
<br>
<div class="buttons-container">
<a href="index.php" class="admin-back-button">
Retour sur la page admin
</a>
<a href="<?= $relativePath ?>stats.php" class="website-back-button">
Retour sur le site
</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "Édition scores";
$pageScripts = "<script type=\"text/javascript\" src=\"../assets/js/statsManager.js\"></script>";
include($relativePath . "includes/template.php"); // Display template with variable content
function get_stats($team, $path)
{
$dao = new Dao($path);
foreach ($dao->get_score_team($team) as $row) {
$text = $row['text'];
$points = $row['points'];
?>
<tr class="entry">
<td class="edit-text"><input type='text' value="<?= $text ?>"/></td>
<td class="edit-points"><input type='number' value="<?= $points ?>"/></td>
<td class='remove-line'><i class="fas fa-trash"></td>
</tr>
<?php
}
}
?>