EIANotesApp/Views/header.phtml
2025-06-16 14:33:00 +02:00

40 lines
1.8 KiB
PHTML

<!DOCTYPE html>
<html>
<head>
<title>Notizen App</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width">
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
<script src="JavaScript/script.js"></script>
</head>
<body>
<header class="top-bar">
<h1>Notes App <?php if($_SESSION['role'] === 'admin') echo "<span style='font-size:0.7em; color:#ffdd57;'>(Admin Panel)</span>"; ?></h1>
<?php if (isset($_SESSION['user_id'])): ?>
<div class="user-info">
<span>Welcome, <?php echo htmlspecialchars($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?>!</span>
<form id="logout-form" method="POST" style="display: inline;">
<input type="hidden" name="action" value="logout">
<button type="submit" class="icon-button" title="Logout"></button>
</form>
<!-- <button class="icon-button" title="More options">⋮</button> -->
</div>
<?php else: ?>
<div class="user-info">
<?php if (!isset($_SESSION['user_id'])): ?>
<a href="?controller=User&do=showUserLoginForm">Login</a>
<?php endif; ?>
<?php if (!isset($_SESSION['user_id'])): ?>
<a href="?controller=User&do=showUserRegisterForm">Register</a>
<?php endif; ?>
</div>
<?php endif; ?>
</header>
<nav>
<ul>
<li><a href="?controller=Welcome&do=showWelcome">Willkommen</a></li>
<li><a href="?controller=Notes&do=showNotes">Notizen</a></li>
</ul>
</nav>
<div class="wrapper">
<main>