| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?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.
- *
- * @global int Player ID.
- * @global resource Database connection.
- */
- public function __construct(){
- global $UID;
- global $db;
- $this->view = PATH::VIEW . "optimizer.php";
- $s = $this->build_query();
- $q = $db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->teams, new Team($r["id"]));
- }
- $s = "
- SELECT id
- FROM unit
- WHERE unit.uid = '$UID';
- ";
- $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 The query to be executed.
- */
- private function build_query(){
- global $UID;
- $s = "
- SELECT id
- FROM team
- WHERE uid = '$UID'
- ";
- return $s;
- }
- }
- ?>
|