Files
intranet/web/intranet_repo/projects/seelsorge/content/profile.php
T

63 lines
3.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/* Profil-Overlay für Kalender und Besuchsstellen. */
require_once dirname(__DIR__) . '/util/seelsorge_helpers.php';
$profile_container_name = 'profile_seelsorge';
$profile_overlay_id = 'profile_seelsorge_overlay';
$profileRecords = seelsorge_profile_records($pdo);
?>
<div class="standard_overlay" id="<?= $profile_overlay_id ?>">
<div class="bg_blur"></div>
<?php foreach ($profileRecords as $record):
$partner = $record['user'];
$userId = (int) $partner['user_id'];
$fullName = trim(($partner['first_name'] ?? '') . ' ' . ($partner['last_name'] ?? ''));
$isRegistered = !empty($partner['first_name']);
$groups = $record['permissions'];
?>
<div class="profile_container" name="<?= $profile_container_name ?>" id="<?= $userId ?>">
<div class="profile-modal-card">
<button type="button" class="exit" aria-label="Schließen" onclick="openCloseProfile(0, '<?= $profile_container_name ?>', '<?= $profile_overlay_id ?>');">×</button>
<div class="profile-modal-hero">
<img class="profile-modal-img" src="<?= htmlspecialchars($record['image']) ?>" alt="Profilbild">
<div>
<?php if ($isRegistered): ?>
<div class="profile-modal-title"><?= htmlspecialchars($fullName) ?></div>
<?php else: ?>
<div class="profile-modal-title" style="color:rgba(255,255,255,0.7);">Nicht registriert</div>
<?php endif; ?>
<div class="profile-modal-subtitle">
<span><?= htmlspecialchars($partner['mail'] ?? '') ?></span>
</div>
</div>
</div>
<div class="profile-modal-body">
<?php if (!empty($partner['phone'])): ?>
<div class="profile-modal-field">
<div class="profile-modal-field-label">Telefon</div>
<div class="profile-modal-field-value">
<a href="tel:0<?= htmlspecialchars($partner['phone']) ?>">0<?= htmlspecialchars($partner['phone']) ?></a>
</div>
</div>
<?php endif; ?>
<?php $activeGroups = array_filter($groups, static fn($value, $key) => $key !== 'user_id' && (int) $value === 1, ARRAY_FILTER_USE_BOTH); ?>
<?php if ($activeGroups): ?>
<div class="profile-modal-field">
<div class="profile-modal-field-label">Gruppen</div>
<div class="profile-modal-chips">
<?php foreach (array_keys($activeGroups) as $groupName): ?>
<span class="profile-modal-chip"><?= htmlspecialchars($groupName) ?></span>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>