diff --git a/legacy/delete_data.php b/legacy/delete_data.php deleted file mode 100644 index 8cc6d53..0000000 --- a/legacy/delete_data.php +++ /dev/null @@ -1,48 +0,0 @@ - query("DELETE FROM buildings WHERE webgis_id = '$webgis_id'"); - - } catch (PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - if ($request == 'pipelines') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - - try { - - $pdo -> query("DELETE from pipelines where webgis_id= '$webgis_id' "); - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - if ($request == 'valves') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - - try { - - $pdo -> query("DELETE from valves where webgis_id= '$webgis_id' "); - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - -?> \ No newline at end of file diff --git a/legacy/find_data.php b/legacy/find_data.php deleted file mode 100644 index f9fce34..0000000 --- a/legacy/find_data.php +++ /dev/null @@ -1,52 +0,0 @@ - query("SELECT *, ST_AsGeoJSON(geom) as geojson FROM $table WHERE $field = '$value'"); - - $features = []; - - foreach($result as $row) { - // PHP-Objekt erstellen - $geometry = json_decode($row['geojson']); - - // PHP-Objekt bereinigen - unset($row['geom']); - unset($row['geojson']); - - // JSON-Feature hinzufügen - $feature = [ - "type"=>"Feature", - "geometry"=>$geometry, - "properties"=>$row - ]; - - array_push($features, $feature); - }; - - // Feature-Collection hinzufügen - $featureCollection = [ - "type"=>"FeatureCollection", - "features"=>$features - ]; - - echo json_encode($featureCollection); - - // Fehlernachricht ausgeben - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - - } - -?> \ No newline at end of file diff --git a/legacy/insert_data.php b/legacy/insert_data.php deleted file mode 100644 index 54742c8..0000000 --- a/legacy/insert_data.php +++ /dev/null @@ -1,73 +0,0 @@ - query("SELECT * FROM valves WHERE valve_id = '$valve_id'"); - - if ($result->rowCount()>0) { - echo "ERROR: Valve ID already exists. Please type in another ID!"; - } else { - // Datenbankabfrage - $result = $pdo -> query("INSERT INTO valves(valve_id, valve_type, valve_dma_id, valve_diameter, valve_location, valve_visibility, geom) VALUES ('$valve_id', '$valve_type', '$valve_dma_id', '$valve_diameter', '$valve_location', '$valve_visibility', ST_SetSRID(ST_GeomFromGeoJSON('$valve_geometry'), 4326))"); - } - } - - if ($request == 'pipelines') { - $pipeline_id = htmlspecialchars($_POST['pipeline_id'], ENT_QUOTES); - $pipeline_category = htmlspecialchars($_POST['pipeline_category'], ENT_QUOTES); - $pipeline_dma_id = htmlspecialchars($_POST['pipeline_dma_id'], ENT_QUOTES); - $pipeline_diameter = htmlspecialchars($_POST['pipeline_diameter'], ENT_QUOTES); - $pipeline_method = htmlspecialchars($_POST['pipeline_method'], ENT_QUOTES); - $pipeline_location = htmlspecialchars($_POST['pipeline_location'], ENT_QUOTES); - $pipeline_geometry = $_POST['pipeline_geometry']; - - $result = $pdo -> query("SELECT * FROM pipelines WHERE pipeline_id = '$pipeline_id'"); - - if ($result->rowCount()>0) { - echo "ERROR: Pipeline ID already exists. Please type in another ID!"; - } else { - // Datenbankabfrage - $result = $pdo -> query("INSERT INTO pipelines(pipeline_id, pipeline_category, pipeline_dma_id, pipeline_diameter, pipeline_method, pipeline_location, geom) VALUES ('$pipeline_id', '$pipeline_category', '$pipeline_dma_id', '$pipeline_diameter', '$pipeline_method', '$pipeline_location', ST_SetSRID(ST_GeomFromGeoJSON('$pipeline_geometry'), 4326))"); - } - } - - if ($request == 'buildings') { - - $account_no = htmlspecialchars($_POST['account_no'], ENT_QUOTES); - $building_category = htmlspecialchars($_POST['building_category'], ENT_QUOTES); - $building_dma_id = htmlspecialchars($_POST['building_dma_id'], ENT_QUOTES); - $building_storey = htmlspecialchars($_POST['building_storey'], ENT_QUOTES); - $building_population = htmlspecialchars($_POST['building_population'], ENT_QUOTES); - $building_location = htmlspecialchars($_POST['building_location'], ENT_QUOTES); - $building_geometry = $_POST['building_geometry']; - - $result = $pdo -> query("SELECT *from buildings where account_no= '$account_no'"); - - if ($result->rowCount()>0) { - echo "ERROR: Building ID already exists. Please type in another ID!"; - } else { - $sql = $pdo -> query("INSERT INTO buildings(account_no, building_category, building_dma_id, building_storey, building_population, building_location, geom) VALUES ('$account_no', '$building_category', '$building_dma_id', '$building_storey', '$building_population', '$building_location', ST_Force3DZ(ST_SetSRID(ST_GeomFromGeoJSON('$building_geometry'), 4326)))"); - } - } - - - - - - - ?> \ No newline at end of file diff --git a/legacy/load_data.php b/legacy/load_data.php deleted file mode 100644 index 2d8b17d..0000000 --- a/legacy/load_data.php +++ /dev/null @@ -1,63 +0,0 @@ - query("SELECT *, ST_AsGeoJSON(geom) as geojson FROM $table WHERE $dma_id_field = '$dma_id'"); - - $features = []; - - foreach($result as $row) { - // PHP-Objekt erstellen - $geometry = json_decode($row['geojson']); - - // PHP-Objekt bereinigen - unset($row['geom']); - unset($row['geojson']); - - // JSON-Feature hinzufügen - $feature = [ - "type"=>"Feature", - "geometry"=>$geometry, - "properties"=>$row - ]; - - array_push($features, $feature); - }; - - // Feature-Collection hinzufügen - $featureCollection = [ - "type"=>"FeatureCollection", - "features"=>$features - ]; - - echo json_encode($featureCollection); - - // Fehlernachricht ausgeben - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - - } - -?> \ No newline at end of file diff --git a/legacy/test.html b/legacy/test.html deleted file mode 100644 index 8a65c7b..0000000 --- a/legacy/test.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Document - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/update_data.php b/legacy/update_data.php deleted file mode 100644 index bfe7884..0000000 --- a/legacy/update_data.php +++ /dev/null @@ -1,98 +0,0 @@ - query("SELECT * FROM buildings WHERE account_no = '$account_no'"); - - if ($result -> rowCount()>0) { - echo "ERROR: Account Number already exists. Pleas type in another Account Number!"; - } else { - $pdo -> query("UPDATE buildings SET account_no = '$account_no', building_category = '$building_category', building_storey = '$building_storey', building_population = '$building_population', building_location = '$building_location', building_dma_id = '$building_dma_id' WHERE webgis_id = '$webgis_id'"); - } - - } else { $pdo -> query("UPDATE buildings SET account_no = '$account_no', building_category = '$building_category', building_storey = '$building_storey', building_population = '$building_population', building_location = '$building_location', building_dma_id = '$building_dma_id' WHERE webgis_id = '$webgis_id'"); - } - - } catch (PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - - if ($request == 'pipelines') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - $pipeline_id_old = htmlspecialchars($_POST['pipeline_id_old'], ENT_QUOTES); - $pipeline_id = htmlspecialchars($_POST['pipeline_id'], ENT_QUOTES); - $pipeline_dma_id = htmlspecialchars($_POST['pipeline_dma_id'], ENT_QUOTES); - $pipeline_diameter = htmlspecialchars($_POST['pipeline_diameter'], ENT_QUOTES); - $pipeline_location = htmlspecialchars($_POST['pipeline_location'], ENT_QUOTES); - $pipeline_category = htmlspecialchars($_POST['pipeline_category'], ENT_QUOTES); - $pipeline_length = htmlspecialchars($_POST['pipeline_length'], ENT_QUOTES); - - - try { - - if ($pipeline_id_old != $pipeline_id) { - $result = $pdo -> query("SELECT *from pipelines where pipeline_id = '$pipeline_id' "); - - if ($result -> rowCount()>0) { - echo "ERROR: Pipeline ID already exists. Please choose a new ID"; - } else { - $pdo -> query("UPDATE pipelines set pipeline_id = '$pipeline_id', pipeline_dma_id = '$pipeline_dma_id', pipeline_diameter = '$pipeline_diameter', pipeline_location = '$pipeline_location', pipeline_category='$pipeline_category', pipeline_length='$pipeline_length' where webgis_id = '$webgis_id'"); - } - } else { - $pdo -> query("UPDATE pipelines set pipeline_id = '$pipeline_id', pipeline_dma_id = '$pipeline_dma_id', pipeline_diameter = '$pipeline_diameter', pipeline_location = '$pipeline_location', pipeline_category='$pipeline_category', pipeline_length='$pipeline_length' where webgis_id = '$webgis_id'"); - } - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - - if ($request == 'valves') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - $valve_id_old = htmlspecialchars($_POST['valve_id_old'], ENT_QUOTES); - $valve_id = htmlspecialchars($_POST['valve_id'], ENT_QUOTES); - $valve_dma_id = htmlspecialchars($_POST['valve_dma_id'], ENT_QUOTES); - $valve_type = htmlspecialchars($_POST['valve_type'], ENT_QUOTES); - $valve_diameter = htmlspecialchars($_POST['valve_diameter'], ENT_QUOTES); - $valve_location = htmlspecialchars($_POST['valve_location'], ENT_QUOTES); - $valve_visibility = htmlspecialchars($_POST['valve_visibility'], ENT_QUOTES); - - - try { - - if ($valve_id_old != $valve_id) { - $result = $pdo -> query("SELECT *from valves where valve_id = '$valve_id' "); - - if ($result -> rowCount()>0) { - echo "ERROR: Valve ID already exists. Please choose a new ID"; - } else { - $pdo -> query("UPDATE valves set valve_id = '$valve_id', valve_dma_id = '$valve_dma_id', valve_type = '$valve_type', valve_diameter = '$valve_diameter', valve_location = '$valve_location', valve_visibility = '$valve_visibility' where webgis_id = '$webgis_id' "); - } - } else { - $pdo -> query("UPDATE valves set valve_id = '$valve_id', valve_dma_id = '$valve_dma_id', valve_type = '$valve_type', valve_diameter = '$valve_diameter', valve_location = '$valve_location', valve_visibility = '$valve_visibility' where webgis_id = '$webgis_id' "); - } - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - -?> \ No newline at end of file diff --git a/public/admin.php b/public/admin.php index 4c3bb11..778da48 100644 --- a/public/admin.php +++ b/public/admin.php @@ -131,7 +131,7 @@ $counts['total'] = count($all_contributions); Moderation — <?= htmlspecialchars($municipality['name']) ?> - + diff --git a/public/assets/lock-solid-off-black.png b/public/assets/lock-solid-off-black.png new file mode 100644 index 0000000..4e9bf47 Binary files /dev/null and b/public/assets/lock-solid-off-black.png differ diff --git a/public/assets/scale-balanced-solid-off-black.png b/public/assets/scale-balanced-solid-off-black.png new file mode 100644 index 0000000..585c0ee Binary files /dev/null and b/public/assets/scale-balanced-solid-off-black.png differ diff --git a/public/assets/shield-halved-solid-off-black.png b/public/assets/shield-halved-solid-off-black.png new file mode 100644 index 0000000..19e47c0 Binary files /dev/null and b/public/assets/shield-halved-solid-off-black.png differ diff --git a/public/assets/user-group-solid-off-black.png b/public/assets/user-group-solid-off-black.png new file mode 100644 index 0000000..f9bd495 Binary files /dev/null and b/public/assets/user-group-solid-off-black.png differ diff --git a/public/assets/user-group-solid-off-white.png b/public/assets/user-group-solid-off-white.png new file mode 100644 index 0000000..6a28d01 Binary files /dev/null and b/public/assets/user-group-solid-off-white.png differ diff --git a/public/imprint.php b/public/imprint.php index 6c6af10..34ce515 100644 --- a/public/imprint.php +++ b/public/imprint.php @@ -11,7 +11,7 @@ $municipality = $stmt->fetch(); Impressum — <?= htmlspecialchars($municipality['name']) ?> - + diff --git a/public/index.php b/public/index.php index 1fdb22a..f1e7224 100644 --- a/public/index.php +++ b/public/index.php @@ -34,7 +34,7 @@ $news_items = $stmt->fetchAll(); Mitmachkarte <?= htmlspecialchars($municipality['name']) ?> - + @@ -89,7 +89,7 @@ $news_items = $stmt->fetchAll();
- +

Mitmachkarte

@@ -131,9 +131,9 @@ $news_items = $stmt->fetchAll();
@@ -148,17 +148,12 @@ $news_items = $stmt->fetchAll(); @@ -176,9 +171,44 @@ $news_items = $stmt->fetchAll(); + + + +
+

+ Neuigkeiten + +

+
- +

Hilfe @@ -206,44 +236,7 @@ $news_items = $stmt->fetchAll();

Gerne können Sie Ihre Meinung zu bestehenden Beiträgen auch durch die Kommentarfunktion äußern.

Suchen

-

Verwenden Sie die Adresssuche rechts, um schnell den richtigen Ort auf der Mitmachkarte zu finden.

- - -
- - - -
-

- Neuigkeiten - -

-
diff --git a/public/js/app.js b/public/js/app.js index 89fb140..f68997b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -346,7 +346,7 @@ function loadContributions() { layerControl.addOverlay(contributionsLayer, ' Beiträge'); // Update Sidebar List and Statistics updateContributionsList(); - updateStatistics(); + buildCategoryFilter(); }); } @@ -766,7 +766,7 @@ function updateContributionsList() { // Builds HTML if (filtered.length === 0) { - container.innerHTML = '

Keine Beiträge gefunden.

'; + container.innerHTML = '

Keine Beiträge gefunden.

'; return; } @@ -830,22 +830,33 @@ document.getElementById('list-search-input').addEventListener('input', function // Block 12: Sidebar Category Filter and Statistics // ===================================================================== -// Builds Category Filter Checkboxes +// Builds Category Filter Checkboxes with Counts function buildCategoryFilter() { const container = document.getElementById('category-filter'); + + const counts = {}; + contributionsData.forEach(function (f) { + const cat = f.properties.category; + counts[cat] = (counts[cat] || 0) + 1; + }); + + const total = contributionsData.length; let html = ''; for (const key in CATEGORIES) { const cat = CATEGORIES[key]; const checked = activeFilters.indexOf(key) !== -1 ? 'checked' : ''; + const count = counts[key] || 0; - html += '' + - ''; + html += ''; } + html += '

' + total + ' Beiträge insgesamt

'; + container.innerHTML = html; } @@ -892,34 +903,6 @@ function toggleCategoryFilter(checkbox) { updateContributionsList(); } -// Updates Statistics in Home Tab -function updateStatistics() { - const container = document.getElementById('stats-container'); - const total = contributionsData.length; - - // Counts per Category - const counts = {}; - contributionsData.forEach(function (f) { - const cat = f.properties.category; - counts[cat] = (counts[cat] || 0) + 1; - }); - - let html = '

' + total + ' Beiträge insgesamt

'; - - for (const key in CATEGORIES) { - const cat = CATEGORIES[key]; - const count = counts[key] || 0; - if (count > 0) { - html += '
' + - categoryIcon(cat) + ' ' + - cat.label + ': ' + count + - '
'; - } - } - - container.innerHTML = html; -} - // ===================================================================== // Block 13: Modals — Welcome, Login, Info, Privacy, Imprint @@ -1034,7 +1017,7 @@ function escapeHtml(text) { // Returns a colored Font Awesome Icon HTML String for a Category function categoryIcon(cat) { - return ''; + return ''; } // Reverse Geocodes Coordinates and saves Address to Contribution via API diff --git a/public/privacy.php b/public/privacy.php index f2db92f..abbead2 100644 --- a/public/privacy.php +++ b/public/privacy.php @@ -11,7 +11,7 @@ $municipality = $stmt->fetch(); Datenschutz — <?= htmlspecialchars($municipality['name']) ?> - + diff --git a/public/styles.css b/public/styles.css index 1772fe7..efa3990 100644 --- a/public/styles.css +++ b/public/styles.css @@ -464,6 +464,7 @@ select.form-input { cursor: pointer; } margin-bottom: var(--space-sm); line-height: 1.5; color: var(--color-text-secondary); + font-size: 0.85rem; } diff --git "a/\177README.md" "b/\177README.md" index a62f6d5..c5c3563 100644 --- "a/\177README.md" +++ "b/\177README.md" @@ -5,10 +5,8 @@ Citizen Participation Portal for Lohne (Oldenburg). ## Project Structure - `migrations/` — versioned SQL Schema Migrations -- `api/` — Backend (PHP) - `public/` — Frontend (HTML, CSS, JS) - `scripts/` — Maintenance Scripts (backup, deployment) -- `legacy/` — Reference Code from Prototype ## Local Setup