forked from vergnet/site-accueil-insa
totaux stats
This commit is contained in:
parent
f302491f63
commit
8ea59b4944
1 changed files with 16 additions and 2 deletions
18
stats.php
18
stats.php
|
@ -1,6 +1,20 @@
|
|||
<?php
|
||||
ob_start(); // Start reading html
|
||||
include "script/db.php";
|
||||
|
||||
$req_p0 = $db->query('SELECT SUM(points) AS s FROM scores WHERE team = 0');
|
||||
$r0 = $req_p0->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if(!($r0[0]['s'] > 0)) {
|
||||
$r0[0]['s'] = 0;
|
||||
}
|
||||
|
||||
$req_p1 = $db->query('SELECT SUM(points) AS s FROM scores WHERE team = 1');
|
||||
$r1 = $req_p1->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if(!($r1[0]['s'] > 0)) {
|
||||
$r1[0]['s'] = 0;
|
||||
}
|
||||
?>
|
||||
<main>
|
||||
<div class="box-jaune">
|
||||
|
@ -23,8 +37,8 @@ include "script/db.php";
|
|||
|
||||
<table class="out">
|
||||
<tr>
|
||||
<td><div class="title_in">PKpeach</div></td>
|
||||
<td><div class="title_in">Boomario</div></td>
|
||||
<td><div class="title_in">PKpeach - <?= $r0[0]['s'] ?> points</div></td>
|
||||
<td><div class="title_in">Boomario - <?= $r1[0]['s'] ?> points</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
Loading…
Reference in a new issue