format('l, F j \a\t g:ia') . ' ' . STATION_TIMEZONE_LABEL . ' (' . substr($utc, 11, 5) . ' UTC'; if (substr($utc, 0, 10) !== $local->format('Y-m-d')) $text .= ' on ' . (new DateTimeImmutable($utc))->format('l'); return $text . ')'; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { verifyCsrf(); $action = $_POST['action'] ?? ''; if ($action === 'set_show') { $stmt = $db->prepare('SELECT id, name FROM shows WHERE id = ?'); $stmt->execute([(int)($_POST['show_id'] ?? 0)]); $show = $stmt->fetch(); $date = trim((string)($_POST['date'] ?? '')); $time = substr(trim((string)($_POST['time'] ?? '')), 0, 5); $scheduledAt = $date === '' && $time === '' ? null : stationTimeToUtc("$date $time"); $episodeTitle = trim((string)($_POST['episode_title'] ?? '')); $label = $show['name'] . ($episodeTitle !== '' ? " ({$episodeTitle})" : ''); if (!$show) { flash('Please choose a show.', 'error'); } elseif (($date !== '' || $time !== '') && $scheduledAt === null) { flash('Please enter both a valid date and time, or leave both blank.', 'error'); } elseif (setBroadcastShow($db, (int)$show['id'], $scheduledAt, $episodeTitle) === 'live') { flash("The live broadcast is now {$label}."); } else { flash("{$label} is queued" . ($scheduledAt ? ' for ' . describeScheduledAt($scheduledAt) : '') . '. It will go live as soon as the stream starts.'); } } elseif ($action === 'clear_queue') { clearQueuedShow($db); flash('The queued show has been cleared.'); } header('Location: index.php'); exit; } $live = liveBroadcast($db); $current = currentShow($db); $shows = $db->query('SELECT id, name FROM shows ORDER BY name')->fetchAll(); $scheduledLocal = !$live && $current && $current['scheduled_at'] ? utcToStationTime($current['scheduled_at']) : null; adminHeader('Dashboard', $admin); ?>

Broadcast status

Live now, since UTC. Offline. is queued for the next broadcast. Offline. No show is queued.