Catalog_Page.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. require_once($path["page"] . "Page.php");
  3. /**
  4. * Catalog page model.
  5. */
  6. class Catalog_Page extends Page{
  7. /**
  8. * List of all monster types.
  9. */
  10. public $types = [];
  11. /**
  12. * Constructor.
  13. *
  14. * Retrieves the data and initializes the variables.
  15. *
  16. * @param SQLite3 $db Connection to the database.
  17. */
  18. public function __construct($db){
  19. global $path;
  20. global $root;
  21. parent::__construct($db);
  22. $this->view = $path["view"] . "catalog.php";
  23. $s = "SELECT DISTINCT type FROM monster;";
  24. $q = $this->db->query($s);
  25. while ($r = $q->fetchArray(SQLITE3_ASSOC)){
  26. array_push($this->types, $r["type"]);
  27. }
  28. $this->title = "Catalog - SWDB";
  29. $this->name = "SWDB";
  30. $this->description = "Catalog of all monsters";
  31. $this->favicon = "";
  32. $this->icon = "";
  33. $this->canonical = $root . "catalog/";
  34. $this->author = $root;
  35. }
  36. }
  37. ?>