| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- require_once($path["page"] . "Page.php");
- require_once($path["entity"] . "Guild.php");
- require_once($path["entity"] . "K_Guild_Skill_Group.php");
- /**
- * Guild page.
- */
- class Guild_Page extends Page{
- /**
- * @{see Guild}.
- */
- public $guild = [];
- /**
- * List of {@see K_Guild_Skill_Group}s.
- */
- public $skill_groups = [];
- /**
- * 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"] . "guild.php";
- $s =
- "SELECT DISTINCT guild AS id " .
- "FROM " .
- " guild_member " .
- " guild; ";
- // TODO: Where guild.member.player = ...
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->guild = new Guild($db, $r["id"]);
- $this->title = $this->guild->name . " - SWDB";
- $this->description = $this->guild->name . " Guild details";
- $s =
- "SELECT id " .
- "FROM k_guild_skill_group " .
- "ORDER BY id; ";
- $q = $this->db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->skill_groups, new K_Guild_Skill_Group($db, $r["id"]));
- }
- }
- else{
- $this->title = "Guild - SWDB";
- $this->description = "No guild";
- }
- $this->canonical = $root . "guild/";
- }
- }
- ?>
|