prepare('SELECT id, name, slug FROM tenants WHERE slug = ? LIMIT 1'); $stmt->execute([$tenantSlug]); $tenant = $stmt->fetch(); return $tenant !== false ? $tenant : null; } function kaffeeliste_money(int $cents): string { return saas_format_money_cents($cents) . ' €'; } if ($saasUser !== null && saas_user_has_role(['owner', 'admin', 'treasurer'], $saasUser)) { $tenantId = (int)$saasUser['tenant_id']; $hasAccess = true; } if (!$hasAccess && $saasUser === null && checkKaffeelisteAdmin($conn, $mailadress)) { $tenant = kaffeeliste_default_tenant($pdo); if ($tenant !== null) { $tenantId = (int)$tenant['id']; $hasAccess = true; } } $participants = $hasAccess ? ledger_fetch_participant_summaries($pdo, $tenantId, ['active_only' => true]) : []; include "header.php"; include "headerline.php"; include "nav.php"; ?>