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/app/view/template/header.php

81 lines
3.1 KiB
PHP
Raw Normal View History

2022-01-14 06:43:31 +00:00
<!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">
2022-01-15 10:26:02 +00:00
<title><?=htmlspecialchars($title);?> Stafett for livet</title>
2022-01-14 06:43:31 +00:00
<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>