Initial commit

This commit is contained in:
root
2025-12-23 13:18:58 +02:00
commit 2ef7528ee9
36 changed files with 5983 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../../includes/bootstrap.php';
require_admin_login();
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
header('Location: /public/admin/projects.php');
exit;
}
if (!csrf_verify($_POST['csrf'] ?? null)) {
flash_set('danger', 'CSRF failed.');
header('Location: /public/admin/projects.php');
exit;
}
$id = (int)($_POST['id'] ?? 0);
if ($id <= 0) {
flash_set('danger', 'Invalid project id.');
header('Location: /public/admin/projects.php');
exit;
}
$st = db()->prepare("DELETE FROM projects WHERE id = ?");
$st->execute([$id]);
flash_set('success', 'Project deleted.');
header('Location: /public/admin/projects.php');
exit;