AdminV3 Interface

This commit is contained in:
2026-01-23 19:32:49 +00:00
parent 1aa6899789
commit 9c70816fb6
4 changed files with 83 additions and 9 deletions
+51 -3
View File
@@ -41,6 +41,9 @@ if ($loggedIn) {
$tickets_info = sanitize_text($_POST['tickets_info'] ?? '');
$reserve_by_mail = isset($_POST['reserve_by_mail']) && $_POST['reserve_by_mail'] === '1';
$reserve_email = trim((string)($_POST['reserve_email'] ?? ''));
if ($reserve_by_mail && $reserve_email === '') {
$reserve_email = 'walschleber.kultour@gmail.com';
}
if ($reserve_email !== '' && !filter_var($reserve_email, FILTER_VALIDATE_EMAIL)) {
$reserve_email = '';
}
@@ -295,12 +298,14 @@ if ($loggedIn) {
<div class="col-lg-7">
<div class="card shadow-sm">
<div class="card-body">
<h2 class="h5 mb-3">Alle Vorträge</h2>
<h2 class="h5 mb-3">Kommende Vorträge</h2>
<?php
$events = load_events();
usort($events, 'by_datetime_desc');
$upcoming = array_values(array_filter($events, 'is_upcoming'));
$archived = array_values(array_filter($events, fn($e) => !is_upcoming($e)));
?>
<?php if (!$events): ?>
<?php if (!$upcoming): ?>
<p class="text-muted">Noch keine Einträge.</p>
<?php else: ?>
<div class="table-responsive">
@@ -314,7 +319,7 @@ if ($loggedIn) {
</tr>
</thead>
<tbody>
<?php foreach ($events as $e): ?>
<?php foreach ($upcoming as $e): ?>
<tr>
<td><?= h($e['date']) ?> <?= h($e['time']) ?></td>
<td>
@@ -335,6 +340,49 @@ if ($loggedIn) {
</table>
</div>
<?php endif; ?>
<div class="mt-4">
<button class="btn btn-outline-secondary btn-sm" type="button" data-bs-toggle="collapse" data-bs-target="#archive-events" aria-expanded="false" aria-controls="archive-events">
Archivierte Vorträge (<?= count($archived) ?>)
</button>
<div class="collapse mt-3" id="archive-events">
<?php if (!$archived): ?>
<p class="text-muted mb-0">Keine archivierten Vorträge vorhanden.</p>
<?php else: ?>
<div class="table-responsive">
<table class="table align-middle">
<thead>
<tr>
<th>Datum</th>
<th>Titel</th>
<th>Ort</th>
<th class="text-end"></th>
</tr>
</thead>
<tbody>
<?php foreach ($archived as $e): ?>
<tr>
<td><?= h($e['date']) ?> <?= h($e['time']) ?></td>
<td>
<div class="fw-semibold"><?= h($e['title']) ?></div>
<div class="text-muted small"><?= h($e['speaker']) ?></div>
<?php if (!empty($e['reserve_by_mail'])): ?>
<span class="badge text-bg-info">MailReservierung</span>
<?php endif; ?>
</td>
<td><?= h($e['venue_name']) ?></td>
<td class="text-end">
<a class="btn btn-sm btn-outline-primary" href="admin.php?edit=<?= h($e['id']) ?>">Bearbeiten</a>
<a class="btn btn-sm btn-outline-danger" href="admin.php?delete=<?= h($e['id']) ?>" onclick="return confirm('Wirklich löschen?')">Löschen</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>