| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- declare(strict_types=1);
- use App\App\Bootstrap;
- use App\Admin\Auth;
- use App\Storage\JsonStore;
- require dirname(__DIR__) . '/src/autoload.php';
- Bootstrap::init();
- $auth = new Auth();
- $auth->requireLogin();
- $store = new JsonStore();
- $list = $store->listSubmissions();
- $query = trim((string) ($_GET['q'] ?? ''));
- if ($query !== '') {
- $list = array_values(array_filter($list, static function (array $item) use ($query): bool {
- return strpos(strtolower((string) ($item['email'] ?? '')), strtolower($query)) !== false;
- }));
- }
- ?><!doctype html>
- <html lang="de">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Admin Übersicht</title>
- <link rel="stylesheet" href="/assets/css/tokens.css">
- <link rel="stylesheet" href="/assets/css/base.css">
- </head>
- <body>
- <main class="container">
- <section class="card">
- <h1>Abgeschlossene Anträge</h1>
- <p><a href="/admin/login.php?logout=1">Abmelden</a></p>
- <form method="get" class="field">
- <label for="q">Suche E-Mail</label>
- <input id="q" name="q" value="<?= htmlspecialchars($query) ?>">
- </form>
- <?php if (empty($list)): ?>
- <p>Keine Anträge vorhanden.</p>
- <?php else: ?>
- <table>
- <thead>
- <tr>
- <th>E-Mail</th>
- <th>Eingereicht</th>
- <th>Aktion</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($list as $item): ?>
- <tr>
- <td><?= htmlspecialchars((string) ($item['email'] ?? '')) ?></td>
- <td><?= htmlspecialchars((string) ($item['submitted_at'] ?? '')) ?></td>
- <td><a href="/admin/application.php?id=<?= urlencode((string) ($item['application_key'] ?? '')) ?>">Details</a></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php endif; ?>
- </section>
- </main>
- </body>
- </html>
|