site-accueil-insa/stats.php

52 lines
1.7 KiB
PHP
Raw Normal View History

2018-05-24 13:17:51 +02:00
<?php
2018-06-15 09:33:29 +02:00
require_once 'classes/dao.php';
2018-05-24 13:17:51 +02:00
ob_start(); // Start reading html
2018-06-15 09:33:29 +02:00
function get_stats($team)
{
$dao = new Dao();
2019-05-16 07:28:02 +02:00
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
}
2018-05-24 14:01:44 +02:00
}
2018-05-24 13:17:51 +02:00
2018-05-24 14:01:44 +02:00
?>
<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>
2019-06-13 11:26:30 +02:00
<div id="teamButtonContainer">
<span class="team-button" id="buttonGli" onclick="showScores('gli')">Glissefondor</span>
<span class="team-button" id="buttonPek" onclick="showScores('pek')">Peksentard</span>
<span class="team-button" id="buttonBoo" onclick="showScores('boo')">Boomsouffle</span>
<span class="team-button" id="buttonVer" onclick="showScores('ver')">Verredaigle</span>
2019-06-13 11:26:30 +02:00
</div>
</div>
2018-08-27 08:39:38 +02:00
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/stats.css">
2018-05-24 13:17:51 +02:00
<?php
$pageContent = ob_get_clean(); // Store html content in variable
2018-06-05 20:03:33 +02:00
$pageTitle = "Stats";
$pageScripts = "<script type=\"text/javascript\" src=\"assets/js/statsDisplay.js\"></script>";
include("includes/template.php"); // Display template with variable content