| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * Optimizer team list page file.
- *
- * Provides a class with all the properties and methods to display the page.
- *
- * @category Page
- */
- /**
- * Require dependent files if not present.
- */
- require_once(PATH::PAGE . "Page.php");
- require_once(PATH::ENTITY . "Team.php");
- /**
- * Optimizer team list page model.
- *
- * @category Page
- */
- class Optimizer_Page extends Page{
- /**
- * @var \Team[] Teams to show.
- */
- public $teams = [];
- /**
- * Constructor.
- *
- * Retrieves the data and initializes the variables.
- */
- public function __construct(){
- $this->view = PATH::VIEW . "optimizer.php";
- $s = $this->build_query();
- $q = get_context()->get_db()->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->teams, new Team($r["id"]));
- }
- $s = "
- SELECT id
- FROM unit
- WHERE player = '" . get_context()->get_player()->get_id() . "';
- ";
- $this->title = "Optmizer - SWDB";
- $this->description = "Optimizer";
- $this->canonical = URL::BASE . "optmizer/";
- }
- /**
- * Builds the query to the rune table using the selected or default
- * filters.
- *
- * @return string The query to be executed.
- */
- private function build_query(){
- $s = "
- SELECT id
- FROM team
- WHERE player = '" . get_context()->get_player()->get_id() . "'
- ORDER BY
- area_type,
- area
- ";
- return $s;
- }
- }
- ?>
|