Beispiel #1
0
 public function renderInventory()
 {
     $this->template["game_type"] = Views\GameTypeExtended::fetchAll($this->pdo);
     $this->template["game_box"] = Views\GameBoxExtended::fetchAll($this->pdo, false);
 }
 public function renderInventar()
 {
     $retired = $this->getParam("retired");
     $this->addCss("hra.css");
     $this->template['pageTitle'] = "Správa evidovaných herních krabic";
     $this->template['col_game'] = 4;
     $this->template['col_code'] = 12;
     $boxes = Views\GameBoxExtended::fetchAll($this->pdo);
     $games = Views\GameTypeExtended::fetchAll($this->pdo);
     $gamesSrt = [];
     foreach ($games as $g) {
         $g->tracking_codes = [];
         $gamesSrt[$g->game_type_id] = $g;
     }
     foreach ($boxes as $b) {
         if ($b->tracking_code && (!$b->retired || $retired)) {
             $game = $gamesSrt[$b->game_type_id];
             $game->addTrackingCode($b);
         }
     }
     $this->template['retireAction'] = 'retireBox';
     $this->template['insertAction'] = 'insertBox';
     $this->template['games'] = $gamesSrt;
 }