totaux stats

This commit is contained in:
Baptiste 2022-06-20 21:20:11 +02:00
parent f302491f63
commit 8ea59b4944

View file

@ -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>