forked from vergnet/site-accueil-insa
63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
|
<?php
|
||
|
ob_start(); // Start reading html
|
||
|
$relativePath = "../";
|
||
|
?>
|
||
|
<h1>ADMIN</h1>
|
||
|
<h2>Editer Score</h2>
|
||
|
|
||
|
|
||
|
<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-score">
|
||
|
<i class="fas fa-save"></i> Enregistrer
|
||
|
</div>
|
||
|
<br>
|
||
|
<div class="stats-button-container">
|
||
|
<a href="<?= $relativePath ?>stats.php" class="stats-button">
|
||
|
Retour sur le site
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/stats.css"/>
|
||
|
|
||
|
<?php
|
||
|
$pageContent = ob_get_clean(); // Store html content in variable
|
||
|
$pageTitle = "ADMIN";
|
||
|
|
||
|
$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
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|