site-accueil-insa/stats.php

53 lines
1.6 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>
<br>
<div class="team-button" id="buttonGli" onclick="showScores('gli')">Glissefondor</div>
<br>
<div class="team-button" id="buttonPek" onclick="showScores('pek')">Peksentard</div>
<br>
<div class="team-button" id="buttonBoo" onclick="showScores('boo')">Boomsouffle</div>
<br>
<div class="team-button" id="buttonVer" onclick="showScores('ver')">Verredaigle</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