commented index.php
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// WebGIS Citizen Participation Portal — Main Page
|
// WebGIS Citizen Participation Portal — Main Page
|
||||||
// Loads Municipality Configuration from the Database and renders the
|
// Loads Municipality Configuration from the Database.
|
||||||
// Map Interface with Header, Sidebar, and Footer.
|
// Renders Leaflet Map Interface including Leaflet Plugins
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
|
|
||||||
require_once __DIR__ . '/../api/db.php';
|
require_once __DIR__ . '/../api/db.php';
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Load Municipality Configuration
|
// Loads Municipality Configuration
|
||||||
// ToDo: Make dynamic via URL Slug (e.g. /lohne) once multi-tenant
|
// ToDo's: Dynamic Loading via URL Slug once multi-tenant Routing
|
||||||
// Routing is implemented. Hardcoded to Slug 'lohne' for now.
|
// is implemented. Hardcoded Slug for now.
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
$pdo = get_db();
|
$pdo = get_db();
|
||||||
$stmt = $pdo->prepare("SELECT * FROM municipalities WHERE slug = :slug");
|
$stmt = $pdo->prepare("SELECT * FROM municipalities WHERE slug = :slug");
|
||||||
@@ -18,42 +18,46 @@ $stmt->execute([':slug' => 'lohne']);
|
|||||||
$municipality = $stmt->fetch();
|
$municipality = $stmt->fetch();
|
||||||
|
|
||||||
if (!$municipality) {
|
if (!$municipality) {
|
||||||
die("Municipality not found.");
|
http_response_code(404);
|
||||||
|
echo "<!DOCTYPE html><html><body><h1>404 — Municipality not listed in Database.</h1></body></html>";
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Bürgerbeteiligung <?= htmlspecialchars($municipality['name']) ?></title>
|
<title>Bürgerbeteiligungsportal <?= htmlspecialchars($municipality['name']) ?></title>
|
||||||
|
<link rel="icon" href="assets/icon-municipality.png" type="image/png">
|
||||||
|
|
||||||
<!-- ============================================================= -->
|
<!-- ============================================================= -->
|
||||||
<!-- CSS Dependencies -->
|
<!-- Loads CSS Dependencies -->
|
||||||
<!-- ============================================================= -->
|
<!-- ============================================================= -->
|
||||||
|
|
||||||
<!-- Leaflet 1.9.4 -->
|
<!-- Leaflet -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css">
|
||||||
|
|
||||||
<!-- Geoman Drawing Tools -->
|
<!-- Geoman Drawing Tools -->
|
||||||
<link rel="stylesheet" href="https://unpkg.com/@geoman-io/leaflet-geoman-free@2.17.0/dist/leaflet-geoman.css">
|
<link rel="stylesheet" href="https://unpkg.com/@geoman-io/leaflet-geoman-free@2.17.0/dist/leaflet-geoman.css">
|
||||||
|
|
||||||
<!-- Leaflet Sidebar v2 -->
|
<!-- Leaflet Sidebar -->
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet-sidebar-v2@3.2.3/css/leaflet-sidebar.min.css">
|
<link rel="stylesheet" href="https://unpkg.com/leaflet-sidebar-v2@3.2.3/css/leaflet-sidebar.min.css">
|
||||||
|
|
||||||
<!-- Leaflet Fullscreen -->
|
<!-- Leaflet Fullscreen -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/3.0.2/Control.FullScreen.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/3.0.2/Control.FullScreen.css">
|
||||||
|
|
||||||
<!-- Leaflet Geocoder (Address Search) -->
|
<!-- Leaflet Geocoder for Address Search -->
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder@2.4.0/dist/Control.Geocoder.css">
|
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder@2.4.0/dist/Control.Geocoder.css">
|
||||||
|
|
||||||
<!-- Leaflet PolylineMeasure -->
|
<!-- Leaflet Polyline Measurement Tool -->
|
||||||
<link rel="stylesheet" href="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.css">
|
<link rel="stylesheet" href="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.css">
|
||||||
|
|
||||||
<!-- SweetAlert2 (Confirmation Dialogs) -->
|
<!-- SweetAlert2 for Confirmation Dialogs -->
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
||||||
|
|
||||||
<!-- Font Awesome 6 (Icons) -->
|
<!-- Font Awesome 6 for Icons -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
||||||
|
|
||||||
<!-- Application Styles -->
|
<!-- Application Styles -->
|
||||||
@@ -306,7 +310,7 @@ if (!$municipality) {
|
|||||||
|
|
||||||
|
|
||||||
<!-- ============================================================= -->
|
<!-- ============================================================= -->
|
||||||
<!-- JavaScript Dependencies -->
|
<!-- Loads JavaScript Dependencies -->
|
||||||
<!-- ============================================================= -->
|
<!-- ============================================================= -->
|
||||||
|
|
||||||
<!-- Leaflet 1.9.4 -->
|
<!-- Leaflet 1.9.4 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user