Update file functions.php

This commit is contained in:
Jan BELLON 2024-03-07 21:05:52 +00:00
parent 1267ad2db2
commit a2f8b3994c

View File

@ -3,11 +3,11 @@ session_start();
$role = isset($_SESSION['role']) ? (int)$_SESSION['role'] : 0;
function nav($nav) {
function nav($nav, $role) {
foreach($nav as $name => $url) {
echo "<a href='$url'><div class='navitem'>$name</div></a>";
}
if($role >= 4) {
if($_SESSION['role'] >= 4) {
echo "<a href='admin.php'><div class='navitem'>Admin</div></a>";
}
if (isset($_SESSION['userid'])) {