| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- require_once($path["frame"] . "Frame.php");
- require_once($path["entity"] . "Monster_Collection.php");
- /**
- * Collection's page monster list.
- */
- class Collection_Collection_Frame extends Frame{
- /**
- * {@see Monster_Collection} of owned monsters.
- */
- public $collection = [];
- /**
- * Monster to mark as selected
- */
- public $selected = -1;
- /**
- * Constructor.
- *
- * Retrieves the data and initializes the variables.
- *
- * @param MySQL_connection $db Connection to the database.
- * @param Array $params Parameters array. May contain the 'selected' parameter
- * to mark a monster as selected.
- */
- public function __construct($db, $params){
- global $path;
- parent::__construct($db);
- $this->view = $path["view"] . "frame/collection.php";
- if (isset($params["selected"])){
- $this->selected = $params["selected"];
- }
- $s =
- "SELECT id " .
- "FROM monster_collection " .
- "WHERE level <> 0 " .
- "ORDER BY " .
- " stars DESC, " .
- " level DESC; ";
- $q = mysqli_query($this->db, $s);
- while ($r = mysqli_fetch_array($q)){
- array_push($this->collection, new Monster_Collection($this->db, $r["id"]));
- }
- }
- }
- ?>
|