61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?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"]);
|
|
$app->view('pages/race/results',
|
|
[
|
|
"view" => "summary",
|
|
"teams" => $filtered_teams
|
|
]
|
|
);
|
|
$app->view('template/footer');
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$app->view('template/header', ["title" => "Resultater"]);
|
|
$app->view('pages/race/results');
|
|
$app->view('template/footer');
|
|
|
|
break;
|
|
} |