Site de la semaine d'accueil
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stats.php 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. ob_start(); // Start reading html
  3. include "script/db.php";
  4. $req_p0 = $db->query('SELECT SUM(points) AS s FROM scores WHERE team = 0');
  5. $r0 = $req_p0->fetchAll(PDO::FETCH_ASSOC);
  6. if(!($r0[0]['s'] > 0)) {
  7. $r0[0]['s'] = 0;
  8. }
  9. $req_p1 = $db->query('SELECT SUM(points) AS s FROM scores WHERE team = 1');
  10. $r1 = $req_p1->fetchAll(PDO::FETCH_ASSOC);
  11. if(!($r1[0]['s'] > 0)) {
  12. $r1[0]['s'] = 0;
  13. }
  14. ?>
  15. <main>
  16. <div class="box-jaune">
  17. <span class="corners corners-top"></span>
  18. <span class="corners corners-bottom"></span>
  19. <div class="title">Stats de la semaine</div>
  20. <span class="circles circles-top"></span>
  21. <span class="circles circles-bottom"></span>
  22. </div>
  23. <section>
  24. <strong>Les stats de la semaine.</strong>
  25. <br><br>
  26. Remporte le plus de points possible pour faire gagner ton équipe, mais attention à ne pas lui en faire
  27. perdre !
  28. <br><br>
  29. </section>
  30. <table class="out">
  31. <tr>
  32. <td><div class="title_in">PKpeach - <?= $r0[0]['s'] ?> points</div></td>
  33. <td><div class="title_in">Boomario - <?= $r1[0]['s'] ?> points</div></td>
  34. </tr>
  35. <tr>
  36. <td>
  37. <?php
  38. $req = $db->query('SELECT texte, points FROM scores WHERE team = 0 ORDER BY id DESC');
  39. while($r = $req->fetch()) {
  40. ?>
  41. <span class="box-point">
  42. <table class="in">
  43. <td class="left"><?= $r['texte'] ?></td>
  44. <td class="right"><?= $r['points'] ?></td>
  45. </table>
  46. </span>
  47. <?php
  48. }
  49. ?>
  50. </td>
  51. <td>
  52. <?php
  53. $req = $db->query('SELECT texte, points FROM scores WHERE team = 1 ORDER BY id DESC');
  54. while($r = $req->fetch()) {
  55. ?>
  56. <span class="box-point">
  57. <table class="in">
  58. <td class="left"><?= $r['texte'] ?></td>
  59. <td class="right"><?= $r['points'] ?></td>
  60. </table>
  61. </span>
  62. <?php
  63. }
  64. ?>
  65. </td>
  66. </tr>
  67. </table>
  68. </main>
  69. <?php
  70. $infopage = ["", "Statistiques", ob_get_clean(), "", "stats"]; //relativepath, pagetitle, pagecontent, pagescript | cf structure/template.php ligne 2 à 6
  71. include("structure/template.php");
  72. ?>