From 6a550d2fb897311a73bb92005662c2f9d4491e4f Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Mon, 9 Oct 2023 20:46:26 +0200 Subject: [PATCH] Gemeinden detail --- statistics/gemeinde_detail.php | 65 ++++++++++++++++++++++++++++------ statistics/include.php | 65 ++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 11 deletions(-) create mode 100644 statistics/include.php diff --git a/statistics/gemeinde_detail.php b/statistics/gemeinde_detail.php index 540a209..5fcf7b6 100644 --- a/statistics/gemeinde_detail.php +++ b/statistics/gemeinde_detail.php @@ -1,5 +1,7 @@

Fahrradunfälle in

+ Einwohnerzahl:   Fläche: km2

Unfallzahlen

-
-
- - - - - - -
Unfall mit Getöteten
Unfall mit Schwerverletztem
Unfall mit Leichtverletztem
Gesamt
-
-
+
+
+ + + + + +
Unfall mit Getöteten
Unfall mit Schwerverletztem
Unfall mit Leichtverletztem
Gesamt
+
+
+ +
+
+ + + +
Quote pro Tausend Einwohner
Quote pro Fläche /km2
+
+
+ + + +
+
+

Unfallbeteiligte

+ +
+
+ + +
+
+

Unfalltyp

+ +
+
+ +
+
+

Unfallart

+ +
+
\ No newline at end of file diff --git a/statistics/include.php b/statistics/include.php new file mode 100644 index 0000000..42db9ca --- /dev/null +++ b/statistics/include.php @@ -0,0 +1,65 @@ +query($strSQL); + + $strTable=""; + if ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $strTable.=""; + $strTable.=""; + $strTable.=""; + $strTable.=""; + $strTable.="\n"; + $strTable.="\n"; + } + $strSQL="SELECT count(*) as count FROM data + WHERE IstPKW=0 and IstFuss=0 and IstKrad=0 and IstGkfz=0 and IstSonstige=0".$strLocation; + + $result = $db->query($strSQL." AND UJAHR=".$strYear); + if ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $strTable.=""; + } + $strTable.="
Fahrräder".$row['rad']."
PKW".$row['pkw']."
Fussgänger".$row['fuss']."
Krafträder".$row['krad']."
LKW".$row['lkw']."
Sonstiges".$row['sonstiges']."
Alleinunfälle und Unfälle mit geicher Fahrzeugart".$row['count']."
"; + return $strTable; +} + +function get_unfalltyp($strWhere,$strYear,$strLocation){ + global $db; + global $arrUnfalltyp; + $numVehicle=1; + $strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE istRad=1 AND UJAHR=".$strYear.$strLocation." GROUP BY UTYP1"; + $strTable=""; + $result = $db->query($strSQL); + while ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $strTable.="\n"; + } + $strTable.="
".$arrUnfalltyp[$row['UTYP1']]."".$row['anz']."
"; + return $strTable; +} + +function get_unfallart($strWhere,$strYear,$strLocation){ + global $db; + global $arrUnfallart; + $numVehicle=1; + $strSQL="SELECT UART, count(UART) as anz FROM data WHERE istRad=1 AND UJAHR=".$strYear.$strLocation." GROUP BY UART"; + $strTable=""; + $result = $db->query($strSQL); + while ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $strTable.="\n"; + } + $strTable.="
".$arrUnfallart[$row['UART']]."".$row['anz']."
"; + return $strTable; +} +