Fusion_Page.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. require_once($path["page"] . "Page.php");
  3. require_once($path["entity"] . "K_Fusion.php");
  4. /**
  5. * Fusion page model.
  6. */
  7. class Fusion_Page extends Page{
  8. /**
  9. * List of top-level fusions.
  10. */
  11. public $fusion = [];
  12. /**
  13. * Constructor.
  14. *
  15. * Retrieves the data and initializes the variables.
  16. *
  17. * @param SQLite3 $db Connection to the database.
  18. */
  19. public function __construct($db){
  20. global $path;
  21. global $root;
  22. parent::__construct($db);
  23. $this->view = $path["view"] . "fusion.php";
  24. $s =
  25. "SELECT DISTINCT product " .
  26. "FROM k_fusion " .
  27. "WHERE stars = 5 " .
  28. "ORDER BY stars DESC; ";
  29. $q = $this->db->query($s);
  30. while ($r = $q->fetchArray(SQLITE3_ASSOC)){
  31. array_push($this->fusion, new Fusion($this->db, $r["product"]));
  32. }
  33. $this->title = "Fusion - SWDB";
  34. $this->description = "Fusion chart";
  35. $this->canonical = $root . "fusion/";
  36. }
  37. }
  38. ?>