<?php $app = require '../../app/inc.php';
use App\Teamtable\TeamMapper;
$view = filter_input(INPUT_GET, 'view');
switch ($view) {
case 'focused':
$app->view('template/header',
[
"title" => "Resultater",
"hide_nav" => TRUE,
"hide_menu" => TRUE
]
);
$app->view('pages/race/results',
"view" => "focused"
$app->view('template/footer');
break;
case 'summary':
$team_mapper = new TeamMapper($app->database->conn);
$teams = $team_mapper->getAll();
$filtered_teams = [];
// filter out any teams that have no rounds
foreach ($teams as $team)
{
if ($team->rounds !== 0)
$filtered_teams[] = $team;
}
$app->view('template/header', ["title" => "Sammendrag"]);
"view" => "summary",
"teams" => $filtered_teams
default:
$app->view('template/header', ["title" => "Resultater"]);
$app->view('pages/race/results');