This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/public/race/results.php

61 lines
1.3 KiB
PHP
Raw Normal View History

2022-04-26 21:20:32 +00:00
<?php $app = require '../../app/inc.php';
2022-05-11 15:36:20 +00:00
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;
}