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('');
|
|
|
|
foreach ($dao->get_score_team($team) as $row) {
|
|
|
|
$text = $row['text'];
|
|
|
|
$points = $row['points'];
|
|
|
|
if ($points > 0)
|
|
|
|
$id = "positive";
|
2018-05-24 14:01:44 +02:00
|
|
|
else
|
2018-06-15 09:33:29 +02:00
|
|
|
$id = "negative";
|
|
|
|
?>
|
|
|
|
<tr id="<?= $id ?>">
|
2018-07-06 19:34:49 +02:00
|
|
|
<td><?= htmlspecialchars($text) ?></td>
|
2018-06-15 09:33:29 +02:00
|
|
|
<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
|
|
|
?>
|
2018-06-15 09:33:29 +02:00
|
|
|
<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 !
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div id="stats-container">
|
|
|
|
<table class="stats-table" id="stats-usa">
|
|
|
|
<tr>
|
|
|
|
<td colspan="2" class="edit-button-container">
|
|
|
|
<a href="edit_score/usa/edit.php" class="edit-button" id="button-usa">
|
|
|
|
Éditer les scores
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th colspan="2">USA</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="stat-log">Log</td>
|
|
|
|
<td class="stat-points">Points</td>
|
|
|
|
</tr>
|
|
|
|
<?php get_stats('usa') ?>
|
|
|
|
</table>
|
|
|
|
<table class="stats-table" id="stats-urss">
|
|
|
|
<tr>
|
|
|
|
<td colspan="2" class="edit-button-container">
|
|
|
|
<a href="edit_score/urss/edit.php" class="edit-button" id="button-urss">
|
|
|
|
Éditer les scores
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th colspan="2">URSS</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="stat-log">Log</td>
|
|
|
|
<td class="stat-points">Points</td>
|
|
|
|
</tr>
|
|
|
|
<?php get_stats('urss') ?>
|
|
|
|
</table>
|
|
|
|
</div>
|
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";
|
2018-05-24 14:01:44 +02:00
|
|
|
ob_start(); // Start reading html
|
|
|
|
?>
|
2018-06-05 20:03:33 +02:00
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/stats.css">
|
2018-05-24 14:01:44 +02:00
|
|
|
<?php
|
|
|
|
$pageMeta = ob_get_clean(); // Store html content in variable
|
2018-05-24 13:17:51 +02:00
|
|
|
include("template.php"); // Display template with variable content
|