dashboard - first draft of complete redesign
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
function contentpanel_cleanup_expired_announcements(PDO $pdo, string $today): void
|
||||
{
|
||||
// Das Enddatum ist einschließlich gültig; ohne Enddatum zählt das Startdatum.
|
||||
// Datensätze ohne beide Datumswerte werden nicht als abgelaufen gelöscht.
|
||||
$statement = $pdo->prepare(
|
||||
'DELETE FROM ansagen WHERE COALESCE(ansage_datum_bis, ansage_datum_von) < ?'
|
||||
);
|
||||
$statement->execute([$today]);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
require_once __DIR__ . '/news.php';
|
||||
require_once __DIR__ . '/news_queue.php';
|
||||
require_once __DIR__ . '/announcements.php';
|
||||
|
||||
function contentpanel_html($value): string
|
||||
{
|
||||
@@ -294,6 +295,6 @@ function contentpanel_fetch_announcements(PDO $pdo, string $today): array
|
||||
return contentpanel_query($pdo,
|
||||
'SELECT id, ansage_titel AS title, ansage_untertitel AS subtitle, ansage_datum_von AS date,
|
||||
ansage_datum_bis AS end_date, ansage_uhrzeit AS time, ansage_ort AS location
|
||||
FROM ansagen WHERE ansage_datum_von >= ? OR ansage_datum_bis >= ? ORDER BY ansage_datum_von',
|
||||
[$today, $today])->fetchAll(PDO::FETCH_ASSOC);
|
||||
FROM ansagen WHERE COALESCE(ansage_datum_bis, ansage_datum_von) >= ? ORDER BY ansage_datum_von',
|
||||
[$today])->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user