0, "crystal" => 0, "energy" => 0, "energy_max" => 0, "arena_energy" => 0, "arena_energy_max" => 0, "darkportal_energy" => 0, "darkportal_energy_max" => 0, "dimension_energy" => 0, "dimension_energy_max" => 0, "honor_point" => 0, "guild_point" => 0, "honor_medal" => 0, "honor_mark" => 0, "event_coin" => 0, "social_point" => 0, "ancient_stone" => 0, "costume_point" => 0, ]; /** * Constructor. * * Retrieves the data and initializes the variables. * * @param SQLite3 $db Connection to the database. * @param string $lang Lowercase, two-letter language code. */ public function __construct($db){ global $path; global $root; parent::__construct($db); $this->view = $path["view"] . "home.php"; // TODO:Filter by player? $s = "SELECT " . " uid, " . " name, " . " country, " . " experience, " . " rep, " . " mana, " . " crystal, " . " energy, " . " energy_max, " . " arena_energy, " . " arena_energy_max, " . " darkportal_energy, " . " darkportal_energy_max, " . " dimension_energy, " . " dimension_energy_max, " . " honor_point, " . " guild_point, " . " honor_medal, " . " honor_mark, " . " event_coin, " . " social_point, " . " costume_point " . "FROM player "; $q = $this->db->query($s); $r = $q->fetchArray(SQLITE3_ASSOC); if ($r){ $this->uid = $r["uid"]; $this->name = $r["name"]; $this->country = $r["country"]; $this->experience = $r["experience"]; if (strlen($r["rep"]) > 0){ $this->rep = new Unit($this->db, $r["rep"]); } $this->currency["mana"] = $r["mana"]; $this->currency["crystal"] = $r["crystal"]; $this->currency["energy"] = $r["energy"]; $this->currency["energy_max"] = $r["energy_max"]; $this->currency["arena_energy"] = $r["arena_energy"]; $this->currency["arena_energy_max"] = $r["arena_energy_max"]; $this->currency["darkportal_energy"] = $r["darkportal_energy"]; $this->currency["darkportal_energy_max"] = $r["darkportal_energy_max"]; $this->currency["dimension_energy"] = $r["dimension_energy"]; $this->currency["dimension_energy_max"] = $r["dimension_energy_max"]; $this->currency["honor_point"] = $r["honor_point"]; $this->currency["guild_point"] = $r["guild_point"]; $this->currency["honor_medal"] = $r["honor_medal"]; $this->currency["honor_mark"] = $r["honor_mark"]; $this->currency["event_coin"] = $r["event_coin"]; $this->currency["social_point"] = $r["social_point"]; $this->currency["costume_point"] = $r["costume_point"]; } $this->title = "SWDB"; $this->description = "Summoners War DataBase"; $this->canonical = $root; } } ?>