From 247294145fa09c296db556078219b49698d1068a Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Mon, 9 Oct 2023 19:14:10 +0200 Subject: [PATCH] Gemeinde Detail --- statistics/gemeinde_detail.php | 112 +++++++++++++++++++++++++++++++++ statistics/gemeinden.php | 51 ++++++++------- statistics/kreis_detail.php | 0 statistics/kreise.php | 6 +- 4 files changed, 145 insertions(+), 24 deletions(-) create mode 100644 statistics/gemeinde_detail.php create mode 100644 statistics/kreis_detail.php diff --git a/statistics/gemeinde_detail.php b/statistics/gemeinde_detail.php new file mode 100644 index 0000000..540a209 --- /dev/null +++ b/statistics/gemeinde_detail.php @@ -0,0 +1,112 @@ +prepare("SELECT * FROM community WHERE ULAND=:land AND UREGBEZ=:regbez AND UKREIS=:kreis AND UGEMEINDE=:gemeinde"); + $result->bindParam(":land",$numLand); + $result->bindParam(":regbez",$numRegbez); + $result->bindParam(":kreis",$numKreis); + $result->bindParam(":gemeinde",$numGemeinde); + $result->execute(); + if ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $strName=$row['Name']; + $numFlaeche=$row['Flaeche']; + $numPopulation=$row['Einwohner']; + } + + //Unfallzahlen + + $strWhat=" SUM(UKATEGORIE=1) as Tote, + SUM(UKATEGORIE=2) as Schwerverletzte, + SUM(UKATEGORIE=3) as Leichtverletzte, + COUNT(*) as gesamt"; + $strWhere= " IstRad=1 "; + $strSQL="SELECT $strWhat FROM data + WHERE $strWhere + AND ULAND=:land AND UREGBEZ=:regbez AND UKREIS=:kreis + AND UGEMEINDE=:gemeinde AND UJAHR=:jahr"; + + $result= $db->prepare($strSQL); + $result->bindParam(":land",$numLand); + $result->bindParam(":regbez",$numRegbez); + $result->bindParam(":kreis",$numKreis); + $result->bindParam(":gemeinde",$numGemeinde); + $result->bindParam(":jahr",$numJahr); + $result->execute(); + if ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $numTote=$row['Tote']; + $numSchwerverletzte=$row['Schwerverletzte']; + $numLeichtverletzte=$row['Leichtverletzte']; + $numGesamt=$row['gesamt']; + } +?> + + + + + + + Fahrrad-Unfallstatistik NRW + + + + + + + + + + + + + + +
+

Fahrradunfälle in

+

Unfallzahlen

+
+
+ + + + + + +
Unfall mit Getöteten
Unfall mit Schwerverletztem
Unfall mit Leichtverletztem
Gesamt
+
+
+
+ \ No newline at end of file diff --git a/statistics/gemeinden.php b/statistics/gemeinden.php index 4a51b1d..5ef25d5 100644 --- a/statistics/gemeinden.php +++ b/statistics/gemeinden.php @@ -16,6 +16,7 @@ +