forked from rebillar/site-accueil-insa
49 lines
1.5 KiB
PHP
Executable file
49 lines
1.5 KiB
PHP
Executable file
<?php
|
|
require_once 'classes/dao.php';
|
|
|
|
ob_start(); // Start reading html
|
|
|
|
|
|
function get_stats($team)
|
|
{
|
|
$dao = new Dao();
|
|
foreach ($dao->get_score_team($team) as $row) {
|
|
$text = $row['text'];
|
|
$points = $row['points'];
|
|
if ($points > 0)
|
|
$id = "positive";
|
|
else
|
|
$id = "negative";
|
|
?>
|
|
<tr id="<?= $id ?>">
|
|
<td><?= htmlspecialchars($text) ?></td>
|
|
<td><?= $points ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
?>
|
|
<div class="inner">
|
|
<h1>Stats</h1>
|
|
<p>
|
|
Les stats de la semaine.
|
|
<br>
|
|
Remporte le plus de points possible pour faire gagner ton équipe, mais attention à ne pas lui en faire
|
|
perdre !
|
|
<br><br>
|
|
<strong>Clique sur une équipe pour voir le détail de son score</strong>
|
|
</p>
|
|
<div id="teamButtonContainer">
|
|
<span class="team-button" id="buttonBoo" onclick="showScores('boo')">Boomiflore</span>
|
|
<span class="team-button" id="buttonPek" onclick="showScores('pek')">Peksureau</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/stats.css">
|
|
<?php
|
|
$pageContent = ob_get_clean(); // Store html content in variable
|
|
$pageTitle = "Stats";
|
|
$pageScripts = "<script type=\"text/javascript\" src=\"assets/js/statsDisplay.js\"></script>";
|
|
include("includes/template.php"); // Display template with variable content
|