81 lines
3.1 KiB
PHP
81 lines
3.1 KiB
PHP
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8">
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
<title><?=htmlspecialchars($this->params["title"]);?> – Stafett for livet</title>
|
|||
|
|
|||
|
<link rel="stylesheet" href="<?=$this->urlFor('static/style/main.css');?>">
|
|||
|
<link rel="icon" href="<?=$this->urlFor('static/img/cropped-kf-propell-ikon-32x32.png');?>" sizes="32x32">
|
|||
|
<body>
|
|||
|
|
|||
|
<header>
|
|||
|
<div class="navbar-top">
|
|||
|
<div class="inner">
|
|||
|
<a href="<?=$this->urlFor('/');?>" style="display: block; max-width: max-content;">
|
|||
|
<img style="display: block; height: 32px;" src="<?=$this->urlFor('static/img/cropped-kf-propell-ikon-32x32.png');?>" alt="">
|
|||
|
<div style="margin-left: 44px;">
|
|||
|
<div style="font-size: 24px; margin-top: -38px;">Stafett for livet</div>
|
|||
|
<div style="font-size: 10px; margin-top: -6px;"><b>KREFT</b>FORENINGEN</div>
|
|||
|
</div>
|
|||
|
</a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</header>
|
|||
|
|
|||
|
<?php if ((isset($_SESSION['logged_in'])) && ($_SESSION['logged_in'] === TRUE)) : ?>
|
|||
|
<div class="login-statusbar">
|
|||
|
<div class="inner">
|
|||
|
<a href="<?=$this->urlFor('logout.php');?>" style="float: right;">Logg ut</a>
|
|||
|
<div>Inlogget som: <?=htmlspecialchars($_SESSION['username'])?></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<?php endif; ?>
|
|||
|
|
|||
|
<div class="grid-container">
|
|||
|
|
|||
|
<div>
|
|||
|
<nav class="nav-links">
|
|||
|
<ul>
|
|||
|
<li><a href="<?=$this->urlFor('/');?>">Forside</a></li>
|
|||
|
<li><a href="<?=$this->urlFor('login.php');?>">Logg inn</a></li>
|
|||
|
<li><a href="<?=$this->urlFor('example.php');?>">Eksempel</a></li>
|
|||
|
</ul>
|
|||
|
</nav>
|
|||
|
</div>
|
|||
|
|
|||
|
<div>
|
|||
|
<?php
|
|||
|
// is my implementation of alerts janky? maybe...
|
|||
|
if ((isset($_SESSION['alert'])) && (count($_SESSION['alert']) > 0)) {
|
|||
|
foreach ($_SESSION['alert'] as $alert) {
|
|||
|
switch ($alert[0]) {
|
|||
|
case 'success':
|
|||
|
$prefix = 'Suksess –';
|
|||
|
break;
|
|||
|
|
|||
|
case 'info':
|
|||
|
$prefix = 'Info –';
|
|||
|
break;
|
|||
|
|
|||
|
case 'warning':
|
|||
|
$prefix = 'Varsel –';
|
|||
|
break;
|
|||
|
|
|||
|
case 'danger':
|
|||
|
$prefix = 'Error –';
|
|||
|
break;
|
|||
|
|
|||
|
default:
|
|||
|
$alert[0] = 'danger';
|
|||
|
$prefix = 'Ukjent –';
|
|||
|
break;
|
|||
|
}
|
|||
|
echo('<div class="alert alert-'.$alert[0].'"><b>'.$prefix.'</b> '.$alert[1].'</div>');
|
|||
|
}
|
|||
|
$_SESSION['alert'] = [];
|
|||
|
}
|
|||
|
?>
|
|||
|
<main>
|