Initial commit: OMSORG website + Mitarbeiter-App

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Felix Kemmler
2026-06-13 20:03:22 +02:00
co-authored by Claude Sonnet 4.6
commit 8beb0fcf52
103 changed files with 7384 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
require_once __DIR__ . '/../lib/auth.php';
require_once __DIR__ . '/../lib/db.php';
require_admin();
$action = $_POST['_action'] ?? '';
if ($action === 'add') {
$title = trim((string)($_POST['title'] ?? ''));
$text = trim((string)($_POST['text'] ?? ''));
$date = trim((string)($_POST['date'] ?? '')) ?: date('Y-m-d');
if ($title === '' || $text === '') {
header('Location: ../pages/admin.php?tab=news&err=empty');
exit;
}
$stmt = db()->prepare(
'INSERT INTO news (title, text, date, created_at) VALUES (?, ?, ?, ?)'
);
$stmt->execute([$title, $text, $date, date('c')]);
header('Location: ../pages/admin.php?tab=news&ok=added');
exit;
}
if ($action === 'delete') {
$id = (int)($_POST['news_id'] ?? 0);
if ($id > 0) {
db()->prepare('DELETE FROM news WHERE id = ?')->execute([$id]);
}
header('Location: ../pages/admin.php?tab=news&ok=deleted');
exit;
}
header('Location: ../pages/admin.php?tab=news');
exit;