This commit is contained in:
Walter Hupfeld
2023-10-10 11:04:06 +02:00
parent 6a550d2fb8
commit a98f0769bc
3 changed files with 78 additions and 77 deletions

View File

@@ -19,35 +19,18 @@
$strName=$row['Name'];
$numFlaeche=$row['Flaeche'];
$numPopulation=$row['Einwohner'];
}
$numRegbez=$row['UREGBEZ'];
$numKreis=$row['UKREIS'];
$numGemeinde=$row['UGEMEINDE'];
} else {exit;}
$strLocation=" AND ULAND=$numLand AND UREGBEZ=$numRegbez AND UKREIS=$numKreis AND UGEMEINDE=$numGemeinde ";
$resultUnfallzahlen = get_unfallzahlen($numJahr,$strLocation);
$resultUnfallart = get_unfallart($numJahr,$strLocation);
$resultUnfalltyp = get_unfalltyp($numJahr,$strLocation);
$resultBeteiligte = get_beteiligte($numJahr,$strLocation);
$numGesamt=0;
//Unfallzahlen
$strWhat=" SUM(UKATEGORIE=1) as Tote,
SUM(UKATEGORIE=2) as Schwerverletzte,
SUM(UKATEGORIE=3) as Leichtverletzte,
COUNT(*) as gesamt";
$strWhere= " IstRad=1 ";
$strSQL="SELECT $strWhat FROM data
WHERE $strWhere
AND ULAND=:land AND UREGBEZ=:regbez AND UKREIS=:kreis
AND UGEMEINDE=:gemeinde AND UJAHR=:jahr";
$result= $db->prepare($strSQL);
$result->bindParam(":land",$numLand);
$result->bindParam(":regbez",$numRegbez);
$result->bindParam(":kreis",$numKreis);
$result->bindParam(":gemeinde",$numGemeinde);
$result->bindParam(":jahr",$numJahr);
$result->execute();
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$numTote=$row['Tote'];
$numSchwerverletzte=$row['Schwerverletzte'];
$numLeichtverletzte=$row['Leichtverletzte'];
$numGesamt=$row['gesamt'];
}
?>
<!DOCTYPE html>
<html lang="de">
@@ -105,9 +88,14 @@
<div class="row">
<div class="col-5">
<table class="table table-sm">
<tr><th>Unfall mit Getöteten</th><td><?=$numTote?></td></tr>
<tr><th>Unfall mit Schwerverletztem</th><td><?=$numSchwerverletzte?></td></tr>
<tr><th>Unfall mit Leichtverletztem</th><td><?=$numLeichtverletzte?></td></tr>
<?php
//DEBUG echo "<pre>"; print_r($resultUnfallzahlen);echo "</pre>";
$numGesamt=0;
foreach ($resultUnfallzahlen as $row) {
echo "<tr><td>".$arrCategory[$row['UKATEGORIE']]."</td><td>".$row['anz']."</td></tr>\n";
$numGesamt+=$row['anz'];
}
?>
<tr><th>Gesamt</th><td><strong><?=$numGesamt?></strong></td></tr>
</table>
</div>
@@ -122,14 +110,17 @@
</div>
</div>
<div class="row">
<div class="col-5">
<h4>Unfallbeteiligte</h4>
<table class='table table-sm'>
<?php
echo get_beteiligte("",2022,$strLocation)
?>
// DEBUG: echo "<pre>"; print_r($resultBeteiligte);echo "</pre>";
foreach ($resultBeteiligte as $key => $numCount) {
echo "<tr><td>".$arrBeteiligte[$key]."</td><td>".$numCount."</td></tr>\n";
}
?>
</table>
</div>
</div>
@@ -137,18 +128,26 @@
<div class="row">
<div class="col-5">
<h4>Unfalltyp</h4>
<table class='table table-sm'>
<?php
echo get_unfalltyp("",2022,$strLocation);
foreach ($resultUnfalltyp as $row) {
echo "<tr><td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n";
}
?>
</table>
</div>
</div>
<div class="row">
<div class="col-5">
<h4>Unfallart</h4>
<table class='table table-sm'>
<?php
echo get_unfallart("",2022,$strLocation);
?>
foreach ($resultUnfallart as $row) {
echo "<tr><td>".$arrUnfallart[$row['UART']]."</td><td>".$row['anz']."</td></tr>\n";
}
?>
</table>
</div>
</div>
</div>