From e09253a4341425fcadfda93a701ebd179436b68b Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Sun, 30 Jul 2023 17:44:03 +0200 Subject: [PATCH] final --- css/style.css | 3 +-- index.php | 3 ++- lib/functions.php | 35 +++++++++++++++++++---------------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/css/style.css b/css/style.css index e2b7d33..552f569 100644 --- a/css/style.css +++ b/css/style.css @@ -91,8 +91,7 @@ i.wa { display:none; } -h5 {margin-top:15px;} +h5 {margin-top:8px;} .statistik td, th {border: 1px solid grey; font-size: smaller;} -.radio_header {margin-right:7px;} diff --git a/index.php b/index.php index b576cd8..d1a2dcf 100644 --- a/index.php +++ b/index.php @@ -353,7 +353,8 @@ $('.td_utyp').show(); break; case 'UBET': - $('.td_ubet').show(); + $('.td_ubet').show(); + $('.veh_').hide(); break; } }); diff --git a/lib/functions.php b/lib/functions.php index 3d1e817..2024ee5 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -39,6 +39,7 @@ function generate_category($row) { if ($row['IstKrad']) $strReturn .="|UBETEILIGT_KRAD"; if ($row['IstGkfz']) $strReturn .="|UBETEILIGT_LKW"; if ($row['IstSonstige']) $strReturn .="|UBETEILIGT_SONSTIGES"; + if (substr_count($strReturn, '|')==3) $strReturn.="|UBETEILIGT_SELBST"; return $strReturn; } @@ -97,7 +98,10 @@ function nl2br2($string) { global $arrCategory; global $strLocation; - $strTable="
Unfallkategorie
"; + // Unfallkategorie + + $strTable="
"; + $strTable.="
"; $strTable.=""; $strSQL="SELECT UKATEGORIE, count(UKATEGORIE) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UKATEGORIE"; $result = $db->query($strSQL); @@ -108,6 +112,7 @@ function nl2br2($string) { } $strTable.="
"; + //Unfallbeteilgte $strSQL="SELECT sum(IstRad) as rad, @@ -121,15 +126,16 @@ function nl2br2($string) { WHERE ".$strWhere.$strYear.$strLocation; $result = $db->query($strSQL); - $strTable.="
Unfallbeteiligte
"; + $strTable.="
"; + $strTable.="
"; $strTable.=""; while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.=""; - $strTable.=""; - $strTable.=""; - $strTable.=""; - $strTable.="\n"; - $strTable.="\n"; + $strTable.=""; + $strTable.=""; + $strTable.=""; + $strTable.=""; + $strTable.="\n"; + $strTable.="\n"; } switch ($numVehicle) { case 1: @@ -161,16 +167,15 @@ function nl2br2($string) { $result = $db->query($strSQL.$strYear); if ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.=""; + $strTable.=""; } $strTable.="
Fahrräder".$row['rad']."
PKWs".$row['pkw']."
Fussgänger".$row['fuss']."
Krafträder".$row['krad']."
LKWs".$row['lkw']."
Sonstiges".$row['sonstiges']."
Fahrräder".$row['rad']."
PKWs".$row['pkw']."
Fussgänger".$row['fuss']."
Krafträder".$row['krad']."
LKWs".$row['lkw']."
Sonstiges".$row['sonstiges']."
Alleinunfälle und Unfälle mit geicher Fahrzeugart".$row['count']."
Alleinunfälle und Unfälle mit geicher Fahrzeugart".$row['count']."
"; - - //Unfalltyp $strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UTYP1"; - $strTable.="
Unfalltyp
"; + $strTable.="
"; + $strTable.="
"; $strTable.=""; $result = $db->query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { @@ -182,7 +187,8 @@ function nl2br2($string) { //Unfallart $strSQL="SELECT UART, count(UART) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UART"; - $strTable.="
Unfallart
"; + $strTable.="
"; + $strTable.="
"; $strTable.="
"; $result = $db->query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { @@ -195,8 +201,5 @@ function nl2br2($string) { $strTable.="Unfalltpyen
"; $strTable.="Unfallbeschreibung
"; - - - return $strTable; } \ No newline at end of file