Add name of user to header

This commit is contained in:
“VeLiTi”
2024-06-12 13:55:22 +02:00
parent 22abeb6056
commit 0215155842

View File

@@ -202,6 +202,11 @@ function template_header($title, $selected = 'assets', $selected_child = 'view')
$icon_image = icon_image;
$admin_links = menu($selected,$selected_child);
$user = ucfirst($_SESSION['username']);
if (filter_var($user, FILTER_VALIDATE_EMAIL)){
$user = substr($user, 0, strpos($user, "@"));
}
if (isset($_SESSION['id'])){$id = $_SESSION['id'];} else{$id='';}
if(isset($_SESSION['country_code'])){
@@ -249,7 +254,10 @@ echo <<<EOT
</a>
<div class="space-between"></div>
<div class="dropdown right">
<i class="fas fa-user-circle"></i>
<div>
<i class="fas fa-user-circle"></i>
$user
</div>
<div class="list">
<a href="index.php?page=profile">$profile</a>
<a href="index.php?page=logout">$logout</a>