| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- require_once($path["page"] . "Page.php");
- /**
- * Landing page model.
- */
- class Landing_Page extends Page{
- /**
- * Array of players [uid]=>[name].
- */
- public $players = [];
- /**
- * 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"] . "landing.php";
- $s = "SELECT uid, name FROM player";
- $q = $this->db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- $this->players[$r["uid"]] = $r["name"];
- }
- $this->title = "Player - SWDB";
- $this->description = "Select a player";
- $this->canonical = $root . "landing/";
- }
- }
- ?>
|