From b2ad23bd9772ed162a4f9e70d0eb843ad2b84050 Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Sun, 30 Jul 2023 16:58:10 +0200 Subject: [PATCH 1/2] filter_1 --- css/style.css | 4 ++- index.php | 76 +++++++++++++++++------------------------------ lib/functions.php | 34 +++++++++------------ 3 files changed, 45 insertions(+), 69 deletions(-) diff --git a/css/style.css b/css/style.css index 7baa7f9..e2b7d33 100644 --- a/css/style.css +++ b/css/style.css @@ -93,4 +93,6 @@ i.wa { h5 {margin-top:15px;} -.statistik td, th {border: 1px solid grey; font-size: smaller;} \ No newline at end of file +.statistik td, th {border: 1px solid grey; font-size: smaller;} + +.radio_header {margin-right:7px;} diff --git a/index.php b/index.php index 7da5611..b576cd8 100644 --- a/index.php +++ b/index.php @@ -224,6 +224,7 @@ \ No newline at end of file diff --git a/lib/functions.php b/lib/functions.php index e0500da..3d1e817 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -97,13 +97,13 @@ function nl2br2($string) { global $arrCategory; global $strLocation; - $strTable="
Unfallkategorie
"; + $strTable="
Unfallkategorie
"; $strTable.=""; $strSQL="SELECT UKATEGORIE, count(UKATEGORIE) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UKATEGORIE"; $result = $db->query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.="" + $strTable.="" ."\n"; } $strTable.="
".$arrCategory[$row['UKATEGORIE']]."".$row['anz']."
"; @@ -121,22 +121,16 @@ function nl2br2($string) { WHERE ".$strWhere.$strYear.$strLocation; $result = $db->query($strSQL); - $strTable.="
Unfallbeteiligte
"; + $strTable.="
Unfallbeteiligte
"; $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"; } - /* - $strSQL="SELECT count(*) as count - FROM data - WHERE IstRad=0 and IstPKW=0 and IstFuss=0 and IstKrad=0 and IstGkfz=0 and IstSonstige=0"; - */ switch ($numVehicle) { case 1: case 0: @@ -167,7 +161,7 @@ function nl2br2($string) { $result = $db->query($strSQL.$strYear); if ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.=""; + $strTable.=""; } $strTable.="
UnfallbeteiligteAnzahl
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']."
"; @@ -176,11 +170,11 @@ function nl2br2($string) { //Unfalltyp $strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UTYP1"; - $strTable.="
Unfalltyp
"; + $strTable.="
Unfalltyp
"; $strTable.=""; $result = $db->query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.="" + $strTable.="" ."\n"; } $strTable.="
".$arrUnfalltyp[$row['UTYP1']]."".$row['anz']."
"; @@ -188,11 +182,11 @@ function nl2br2($string) { //Unfallart $strSQL="SELECT UART, count(UART) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UART"; - $strTable.="
Unfallart
"; + $strTable.="
Unfallart
"; $strTable.=""; $result = $db->query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $strTable.="" + $strTable.="" ."\n"; } $strTable.="
".$arrUnfallart[$row['UART']]."".$row['anz']."
"; From e09253a4341425fcadfda93a701ebd179436b68b Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Sun, 30 Jul 2023 17:44:03 +0200 Subject: [PATCH 2/2] 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