This commit is contained in:
William 2022-03-14 09:00:07 +01:00
parent 082ba1c709
commit d10736bdb9
5 changed files with 5 additions and 44 deletions

View File

@ -81,11 +81,11 @@ class AccessControl
{
if ($this->app->user->loggedIn && $this->app->user->powerLevel >= $powerLevel)
{
echo "Authorized!";
# code...
} else {
http_response_code(401);
$this->app->view("template/header", ["title" => "Ingen tilgang!"]);
$this->app->view("Core/AccessControl/unauthorized");
$this->app->view("App/Core/AccessControl/unauthorized");
$this->app->view("template/footer");
die();
}

View File

@ -1,32 +0,0 @@
<h1>Lagtabell</h1>
<br>
<table>
<tr>
<th>#</th>
<th>Navn</th>
<th>Bedrift</th>
<th>Kortnummer</th>
<th>Leder</th>
<th>Telefon</th>
<th>Deltagere</th>
<th>Runder</th>
<th>Bestetid</th>
</tr>
<?php
$i = 0;
foreach ($teams as $team) {
$i++;
echo '<tr>';
echo "<td>" . $i . "</td>";
echo "<td>" . htmlspecialchars($team->name) . "</td>";
echo "<td>" . htmlspecialchars($team->company) . "</td>";
echo "<td>" . htmlspecialchars($team->cardnumber) . "</td>";
echo "<td>" . htmlspecialchars($team->leader) . "</td>";
echo "<td>" . htmlspecialchars($team->phone) . "</td>";
echo "<td>" . htmlspecialchars($team->participants) . "</td>";
echo "<td>" . htmlspecialchars($team->rounds) . "</td>";
echo "<td>" . "Ukjent" . "</td>";
echo '</tr>';
}
?>
</table>

View File

@ -39,7 +39,6 @@
<ul>
<li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li>
<li><a href="<?=$this->config['root_url']?>example.php">Eksempel</a></li>
<li><a href="<?=$this->config['root_url']?>teamtable/index.php">Se lagene</a></li>
</ul>
<?php if ($this->user->loggedIn): ?>

View File

@ -1,10 +1,4 @@
<?php
$app = require '../../app/inc.php';
<?php $app = require '../../app/inc.php';
$model = $app->model('Teamtable');
$teams = $model->getAll();
$app->view('template/header', ['title' => 'Lagtabell']);
$app->view('pages/teamtable/index', ["teams" => $teams]);
$app->view('template/footer');
// redirect
$app->redirect('edit/');