diff --git a/css/style.css b/css/style.css index 630c0e9..d75120d 100644 --- a/css/style.css +++ b/css/style.css @@ -90,4 +90,6 @@ i.wa { left: 50%; z-index: 1000; display:none; -} \ No newline at end of file +} + +.statistik td, th {border: 1px solid grey; font-size: smaller;} \ No newline at end of file diff --git a/lib/functions.php b/lib/functions.php index 31381fb..ec4d551 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -87,6 +87,8 @@ function nl2br2($string) { function get_statistics($numVehicle,$strWhere) { global $db; + global $arrUnfallart; + global $arrUnfalltyp; $strSQL="SELECT sum(IstRad) as rad, sum(IstPKW) as pkw, @@ -107,8 +109,8 @@ function nl2br2($string) { $strTable.="PKWs".$row['pkw'].""; $strTable.="Fussgänger".$row['fuss'].""; $strTable.="Krafträder".$row['krad'].""; - $strTable.="LKWs".$row['lkw'].""; - $strTable.="Sonstiges".$row['sonstiges'].""; + $strTable.="LKWs".$row['lkw']."\n"; + $strTable.="Sonstiges".$row['sonstiges']."\n"; } /* @@ -143,13 +145,39 @@ function nl2br2($string) { WHERE IstPKW=0 and IstFuss=0 and IstKrad=0 and IstGkfz=0 and IstRad=0"; break; } - - + $result = $db->query($strSQL); if ($row = $result->fetchArray()) { - $strTable.="Alleinunfälle".$row['count'].""; + $strTable.="Alleinunfälle und Unfälle mit geicher Fahrzeugart".$row['count'].""; } - $strTable.=""; + + //Unfallart + + $strSQL="SELECT UART, count(UART) as anz FROM Unfallorte2019_Hamm WHERE ".$strWhere." GROUP BY UART"; + $strTable.="
Unfallart
"; + $strTable.=""; + $result = $db->query($strSQL); + while ($row = $result->fetchArray()) { + $strTable.="\n"; + } + $strTable.="
".$arrUnfallart[$row['UART']]."".$row['anz']."
"; + + //Unfallart + + $strSQL="SELECT UTYP1, count(UTYP1) as anz FROM Unfallorte2019_Hamm WHERE ".$strWhere." GROUP BY UTYP1"; + $strTable.="
Unfalltyp
"; + $strTable.=""; + $result = $db->query($strSQL); + while ($row = $result->fetchArray()) { + $strTable.="\n"; + } + $strTable.="
".$arrUnfalltyp[$row['UTYP1']]."".$row['anz']."
"; + + $strTable.="Unfalltpyen
"; + $strTable.="Unfallbeschreibung
"; + + + return $strTable; } \ No newline at end of file