added moderation portal with admin authentification and seperate styling

This commit is contained in:
2026-04-20 16:01:10 +02:00
parent 11a062dd84
commit 7dea362c89
7 changed files with 604 additions and 5 deletions

View File

@@ -67,9 +67,16 @@ function handle_read($input) {
// Builds SQL Query with Placeholders for prepared Statement
$sql = "SELECT *, ST_AsGeoJSON(geom) AS geojson
FROM contributions
WHERE municipality_id = :mid AND status = 'approved'";
WHERE municipality_id = :mid";
$params = [':mid' => $municipality_id];
// Optional: Filters by Status (Default: only approved)
$status = $input['status'] ?? 'approved';
if ($status !== 'all') {
$sql .= " AND status = :status";
$params[':status'] = $status;
}
// Optional: Filters by Category
if (!empty($input['category'])) {
$sql .= " AND category = :cat";