statistics 2
This commit is contained in:
		| @@ -90,4 +90,6 @@ i.wa { | ||||
|     left: 50%; | ||||
|     z-index: 1000; | ||||
|     display:none; | ||||
| } | ||||
| } | ||||
|  | ||||
| .statistik td, th {border: 1px solid grey; font-size: smaller;} | ||||
| @@ -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.="<tr><td>PKWs</td><td>".$row['pkw']."</td></tr>"; | ||||
|        $strTable.="<tr><td>Fussgänger</td><td>".$row['fuss']."</td></tr>"; | ||||
|        $strTable.="<tr><td>Krafträder</td><td>".$row['krad']."</td></tr>"; | ||||
|        $strTable.="<tr><td>LKWs</td><td>".$row['lkw']."</td></tr>"; | ||||
|        $strTable.="<tr><td>Sonstiges</td><td>".$row['sonstiges']."</td></tr>"; | ||||
|        $strTable.="<tr><td>LKWs</td><td>".$row['lkw']."</td></tr>\n"; | ||||
|        $strTable.="<tr><td>Sonstiges</td><td>".$row['sonstiges']."</td></tr>\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.="<tr><td>Alleinunfälle</td><td>".$row['count']."</td></tr>"; | ||||
|         $strTable.="<tr><td>Alleinunfälle und Unfälle mit geicher Fahrzeugart</td><td>".$row['count']."</td></tr>"; | ||||
|     }             | ||||
|      | ||||
|     $strTable.="</table>"; | ||||
|  | ||||
|     //Unfallart | ||||
|  | ||||
|     $strSQL="SELECT UART, count(UART) as anz FROM Unfallorte2019_Hamm WHERE ".$strWhere." GROUP BY UART"; | ||||
|     $strTable.="<h5>Unfallart</h5>"; | ||||
|     $strTable.="<table class='statistik'>"; | ||||
|     $result = $db->query($strSQL); | ||||
|     while ($row = $result->fetchArray()) { | ||||
|         $strTable.="<tr><td>".$arrUnfallart[$row['UART']]."</td><td>".$row['anz']."</td></tr>\n"; | ||||
|     } | ||||
|     $strTable.="</table>"; | ||||
|  | ||||
|     //Unfallart | ||||
|  | ||||
|     $strSQL="SELECT UTYP1, count(UTYP1) as anz FROM Unfallorte2019_Hamm WHERE ".$strWhere." GROUP BY UTYP1"; | ||||
|     $strTable.="<h5>Unfalltyp</h5>"; | ||||
|     $strTable.="<table class='statistik'>"; | ||||
|     $result = $db->query($strSQL); | ||||
|     while ($row = $result->fetchArray()) { | ||||
|         $strTable.="<tr><td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n"; | ||||
|     } | ||||
|     $strTable.="</table>"; | ||||
|  | ||||
|     $strTable.="<a href='https://recht.nrw.de/lmi/owa/br_vbl_show_pdf?p_id=12225' target='_blank'>Unfalltpyen</a><br>"; | ||||
|     $strTable.="<a href='https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Verkehrsunfaelle/Methoden/verkehrsunfaelle-grundbegriffe.pdf?__blob=publicationFile' target='_blank'>Unfallbeschreibung</a><br>"; | ||||
|      | ||||
|  | ||||
|  | ||||
|     return $strTable; | ||||
|  } | ||||
		Reference in New Issue
	
	Block a user