Créé dans le cadre du projet de fin d'année de la promo 2018 de CIR2 de l'ISEN Brest/Rennes, le Burger Quizz est une adaptation numérique du jeu télévisé éponyme, plus précisément d'une épreuve spécifique de ce jeu : le "Sel ou Poivre".

class.score.php 931B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. class Score {
  3. private $login;
  4. private $score;
  5. private $bdd;
  6. function __construct($login) {
  7. $this->bdd = new Connector();
  8. $options = array(
  9. "where" => array(
  10. array("login", "=", $login);
  11. )
  12. );
  13. $data = $bdd->Select("*", "scores", $options);
  14. $this->login = $data['login'];
  15. $this->score = $data['score'];
  16. }
  17. function getLogin() {
  18. return $this->login;
  19. }
  20. function getScore() {
  21. return $this->score;
  22. }
  23. public static function getScores($nRows, $direction = "desc") {
  24. $bdd = new Connector();
  25. $options = array(
  26. "order by" => array("score", $direction),
  27. "limit" => array($nRows)
  28. );
  29. $array = $bdd->Select("*", "scores", $options);
  30. $scores = array();
  31. foreach($array as $score) {
  32. array_push($scores, new Score($score['login']));
  33. }
  34. return $scores;
  35. }
  36. public static function add($login, $score) {
  37. }
  38. }