XyX
All checks were successful
Deploy / deploy (push) Successful in 53s

This commit is contained in:
2026-08-06 01:17:05 +02:00
parent 80f1ad6b99
commit fa40ca1a60
9 changed files with 165 additions and 81 deletions

View File

@@ -178,7 +178,7 @@ final class AccountPages
$listingCatalog = $pdo ? new ListingCatalog($pdo) : null;
$section = (string)($_GET['section'] ?? 'profile');
$canManageSystemSettings = $communityAccess ? $communityAccess->canManageApplications($userId) : false;
$allowedSections = ['profile', 'children', 'events', 'community', 'settings'];
$allowedSections = ['profile', 'children', 'events', 'places', 'community', 'settings'];
if ($canManageSystemSettings) {
$allowedSections[] = 'system';
}
@@ -691,6 +691,8 @@ final class AccountPages
$eventsUpcoming = [];
$eventsPast = [];
$eventsJoinedUpcoming = [];
$eventsJoinedPast = [];
$editEvent = null;
$otherListings = [];
$editListing = null;
@@ -717,6 +719,32 @@ final class AccountPages
$stmt?->execute(['id' => $userId]);
$eventsPast = $stmt?->fetchAll(\PDO::FETCH_ASSOC) ?: [];
$stmt = $pdo?->prepare(
'SELECT e.id, e.title, e.teaser_public, e.image_path, e.starts_at, e.city, e.visibility, e.status,
ep.status AS participation_status,
u.display_name AS host_name
FROM event_participants ep
INNER JOIN events e ON e.id = ep.event_id
INNER JOIN users u ON u.id = e.created_by
WHERE ep.user_id = :id AND e.created_by <> :id AND e.starts_at >= NOW()
ORDER BY e.starts_at ASC'
);
$stmt?->execute(['id' => $userId]);
$eventsJoinedUpcoming = $stmt?->fetchAll(\PDO::FETCH_ASSOC) ?: [];
$stmt = $pdo?->prepare(
'SELECT e.id, e.title, e.teaser_public, e.image_path, e.starts_at, e.city, e.visibility, e.status,
ep.status AS participation_status,
u.display_name AS host_name
FROM event_participants ep
INNER JOIN events e ON e.id = ep.event_id
INNER JOIN users u ON u.id = e.created_by
WHERE ep.user_id = :id AND e.created_by <> :id AND e.starts_at < NOW()
ORDER BY e.starts_at DESC'
);
$stmt?->execute(['id' => $userId]);
$eventsJoinedPast = $stmt?->fetchAll(\PDO::FETCH_ASSOC) ?: [];
if (isset($_GET['edit_event'])) {
$editId = (int)$_GET['edit_event'];
$stmt = $pdo?->prepare('SELECT * FROM events WHERE id = :id AND created_by = :uid AND starts_at >= NOW() LIMIT 1');
@@ -759,6 +787,8 @@ final class AccountPages
'editChild',
'eventsUpcoming',
'eventsPast',
'eventsJoinedUpcoming',
'eventsJoinedPast',
'editEvent',
'otherListings',
'editListing',