47 lines
1.9 KiB
PHP
47 lines
1.9 KiB
PHP
<?php /* Name: header.php
|
|
Beschreibung: Ausgabe des Seitenkopfes inkl. Intranet-Menü
|
|
- Profil-Leiste */
|
|
?>
|
|
<header>
|
|
<div class="header_menue unselectable" id="header_menue">
|
|
|
|
<a class="nak-logo-link" href="<?php echo $g_httpHomePath; ?>">
|
|
<img src="/intranet_repo/projects/_central/img/nak-logo.svg" alt="NAK" class="nak-logo-icon">
|
|
<div class="nak-logo-text">
|
|
<span class="nak-name">Neuapostolische Kirche</span>
|
|
<span class="nak-gemeinde">Berlin-Reinickendorf</span>
|
|
</div>
|
|
</a>
|
|
|
|
<div class="header_profile" id="header_profile">
|
|
|
|
<?php // Profilbild
|
|
// Generiere den Dateinamen basierend auf Benutzer-ID und Datum/Uhrzeit
|
|
$profileImg = glob($g_profilePicturePath."{$_SESSION['user_id']}-*.jpg");
|
|
|
|
// Überprüfe, ob eine passende Datei existiert
|
|
if (!empty($profileImg)) {
|
|
// Sortiere die Dateien nach Datum/Uhrzeit und nimm die neueste
|
|
usort($profileImg, function($a, $b) {
|
|
return filemtime($b) - filemtime($a);
|
|
});
|
|
$latestProfileImg = $profileImg[0];
|
|
|
|
// Entferne den absoluten Pfad
|
|
$headerProfileImg = str_replace($_SERVER['DOCUMENT_ROOT'], '', $latestProfileImg);
|
|
} else {
|
|
// Standardbild, wenn keine passende Datei gefunden wurde
|
|
$headerProfileImg = "/intranet_repo/general_files/profile_pictures/default.jpg";
|
|
}
|
|
|
|
// Bild anzeigen
|
|
echo "<img src='$headerProfileImg' alt='Profil' id='header_profile_img' onclick='openCloseHeaderProfile();'>";
|
|
?>
|
|
|
|
<div class="header_profile_bar" onclick="window.location.href='<?php echo $g_httpLogoutPath; ?>';">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"/></svg>
|
|
<span>Abmelden</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|