Files
clemensandClaude Opus 5 d24ee9bf91 Betreiber-Zentralstelle, Mandanten-Design und schlankerer Einstieg
Funktions-Schalter je Mandant (app/features.php, tenant_features): der
Betreiber schaltet FAQ, Selbsteintrag, PDF, PayPal-Eingang, CSV-Import,
Mailversand, Jahresabschluss, Datenexport und eigenes Design pro Mandant
frei. Gesperrte Funktionen verschwinden aus Menue und Schaltflaechen, ihre
Seiten weisen Aufrufe und POSTs ab. Das Back-Office ist jetzt fuer
Platform-Admins im Menue verlinkt statt nur per URL erreichbar.

Eigenes Design je Mandant: Akzentfarbe und Logo in den Mandant-
Einstellungen, eingebettet ueber app/branding.php; das Logo liegt
geschuetzt in var/tenant_logos und wird nur ueber
tenant-logo-anzeigen.php an den eigenen Mandanten ausgeliefert.

Weniger Startinformationen: Startpaket neuer Mandanten auf zwei
Beispielfragen gekuerzt, Anleitung von ~1400 auf ~750 Woerter gestrafft
und um Abschnitte zu gesperrten Funktionen bereinigt.

Vorder-/Rueckseite erst bei mehr als 50 Personen (vorher schon ab 50).
Die Schwelle liegt jetzt gemeinsam in app/ledger.php und gilt auch fuer
die Vorder-/Rueckseiten-Auswahl beim Erfassen, wo sie bisher unabhaengig
von der Teamgroesse angeboten wurde.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 22:52:55 +02:00

107 lines
2.7 KiB
PHP

<?php
include "functions.php";
require_once __DIR__ . "/app/ledger.php";
require_once __DIR__ . "/app/features.php";
$pdo = app_db_pdo();
$saasUser = saas_current_user($pdo);
$tenantId = 0;
$hasAccess = false;
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;
}
$participants = $hasAccess
? ledger_fetch_participant_summaries($pdo, $tenantId, ['active_only' => true])
: [];
include "header.php";
include "headerline.php";
include "nav.php";
?>
<section id="banner">
<div class="content">
<?php
if ($hasAccess) {
?>
<h2>Aktive Mitarbeiter mit Gesamtstand</h2>
<br>
<ul class="actions">
<?php if (app_feature_enabled($pdo, $tenantId, 'pdf_export')): ?>
<li>
<form action="exportKaffeeliste.php" method="get">
<button type="submit">Kaffeeliste exportieren</button>
</form>
</li>
<?php endif; ?>
<li>
<form action="letzteneintraege.php" method="get">
<button type="submit">Letzten Einträge</button>
</form>
</li>
<?php if (app_feature_enabled($pdo, $tenantId, 'csv_import')): ?>
<li>
<form action="csvupload.php" method="get">
<button type="submit">CSV Upload</button>
</form>
</li>
<?php endif; ?>
</ul>
<br>
<table border="1" class="table table-striped table-bordered">
<tr>
<th>Name</th>
<th>E-Mail</th>
<th>Aktueller Stand</th>
<th>Gesamtausgabe (€)</th>
<th>Gesamtstriche</th>
<th>Gesamteinzahlungen</th>
</tr>
<?php
foreach ($participants as $participant) {
$participantId = (int)$participant['participant_id'];
$name = saas_html($participant['display_name']);
$email = saas_html((string)($participant['email'] ?? ''));
$balance = kaffeeliste_money((int)$participant['balance_cents']);
$totalCosts = kaffeeliste_money((int)$participant['total_costs_cents']);
$totalMarks = number_format((int)$participant['total_marks'], 0, ',', '.');
$totalPayments = kaffeeliste_money((int)$participant['total_payments_cents']);
echo "<tr>";
echo "<td><a href=\"teilnehmerauswertung.php?participant_id={$participantId}\">{$name}</a></td>";
echo "<td>{$email}</td>";
echo "<td>{$balance}</td>";
echo "<td>{$totalCosts}</td>";
echo "<td>{$totalMarks}</td>";
echo "<td>{$totalPayments}</td>";
echo "</tr>";
}
?>
</table>
<br><br>
<?php if (app_feature_enabled($pdo, $tenantId, 'mail_dispatch')): ?>
<form action="mailversenden.php" method="get">
<button type="submit">Info-Mail versenden</button>
</form>
<?php endif; ?>
<?php
} else {
echo "<h2>Kein Zugriff</h2>";
}
?>
</div>
</section>
<?php include "footer.php"; ?>