fixed header

This commit is contained in:
Felix Ivo 2025-06-16 14:33:00 +02:00
parent 75742157b7
commit a2fd5f011b
2 changed files with 21 additions and 8 deletions

View File

@ -1,5 +1,4 @@
<?php include dirname(__DIR__).'/header.phtml'; ?>
<script src="JavaScript/script.js"></script>
<div class="form-container">
<h2>Login</h2>
<form id="login-form" method="POST">

View File

@ -8,13 +8,27 @@
<script src="JavaScript/script.js"></script>
</head>
<body>
<header>
<div class="wrapper">
<div class="button">
<a href="?controller=User&do=showUserLoginForm">Anmelden</a>
<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>
<h1>Notes<span>.de</span></h1>
</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>