| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- require_once($path["page"] . "Page.php");
- require_once($path["entity"] . "Fusion.php");
- require_once($path["entity"] . "Monster_Collection.php");
- /**
- * Fusion page model.
- */
- class Fusion_Page extends Page{
- /**
- * List of fusions.
- */
- public $fusion = [];
- /**
- * {@see Monster_Collection} of owned monsters.
- */
- public $collection = [];
- /**
- * Constructor.
- *
- * Retrieves the data and initializes the variables.
- *
- * @param SQLite3 $db Connection to the database.
- */
- public function __construct($db){
- global $path;
- global $root;
- parent::__construct($db);
- $this->view = $path["view"] . "fusion.php";
- $s =
- "SELECT DISTINCT target " .
- "FROM fusion " .
- "ORDER BY target_stars DESC; ";
- $q = $this->db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->fusion, new Fusion($this->db, $r["target"]));
- }
- $s =
- "SELECT id " .
- "FROM monster_collection " .
- "WHERE level <> 0 " .
- "ORDER BY " .
- " stars DESC, " .
- " level DESC; ";
- $q = $this->db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->collection, new Monster_Collection($this->db, $r["id"]));
- }
- $this->title = "";
- $this->name = "";
- $this->description = "";
- $this->favicon = "";
- $this->icon = "";
- $this->canonical = $root . "/fusion/";
- $this->author = $root . "/fusion/";
- }
- }
- ?>
|