This repository has been archived on 2023-01-08. You can view files and clone it, but cannot push or open issues or pull requests.
stafett-for-livet/template/_header.php
2021-10-11 09:37:39 +02:00

88 lines
3.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require_once(__DIR__ . "/../app/template.php");
if ($templateParameters["render"] === FALSE) {
return;
}
?>
<!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($templateParameters["title"]);?> Stafett for livet</title>
<link rel="stylesheet" href="<?=$templateUrlPrefix;?>style/main.css">
<link rel="icon" href="<?=$templateUrlPrefix;?>img/cropped-kf-propell-ikon-32x32.png" sizes="32x32">
<body>
<header>
<div class="navbar-top">
<div class="inner">
<a href="<?=$templateUrlPrefix;?>" style="display: block; max-width: max-content;">
<img style="display: block; height: 32px;" src="<?=$templateUrlPrefix;?>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="<?=$templateUrlPrefix;?>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="<?=$templateUrlPrefix;?>">Forside</a></li>
<li><a href="<?=$templateUrlPrefix;?>login.php">Logg inn</a></li>
<li><a href="<?=$templateUrlPrefix;?>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 = 'Advarsel:';
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>