- admin/shows.php: list shows - admin/show_edit.php: add, edit and delete shows, with validated background image uploads saved under generated names - admin/index.php: queue the next show, switch the live show, or clear the queue - includes/broadcasts.php: setBroadcastShow() and clearQueuedShow(), shared by the dashboard and cli/set_show.php - includes/admin_layout.php: flash messages and Shows nav link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
require __DIR__ . '/../includes/auth.php';
|
|
require __DIR__ . '/../includes/admin_layout.php';
|
|
|
|
$admin = requireAdmin();
|
|
$shows = getDB()->query('SELECT id, slug, name, background_image FROM shows ORDER BY name')->fetchAll();
|
|
|
|
adminHeader('Shows', $admin);
|
|
?>
|
|
<ul class="actions">
|
|
<li><a href="show_edit.php" class="button primary small">Add a show</a></li>
|
|
</ul>
|
|
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Background</th>
|
|
<th>Name</th>
|
|
<th>Slug</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($shows as $show): ?>
|
|
<tr>
|
|
<td>
|
|
<?php if ($show['background_image']): ?>
|
|
<img src="../images/backgrounds/<?= e(rawurlencode($show['background_image'])) ?>" alt="" style="width:80px;height:50px;object-fit:cover;border-radius:4px;display:block;">
|
|
<?php else: ?>
|
|
<em>Default</em>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?= e($show['name']) ?></td>
|
|
<td><code><?= e($show['slug']) ?></code></td>
|
|
<td><a href="show_edit.php?id=<?= (int)$show['id'] ?>">Edit</a></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php if (!$shows): ?>
|
|
<tr><td colspan="4">No shows yet.</td></tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php
|
|
adminFooter();
|