98 lines
3.7 KiB
PHP
98 lines
3.7 KiB
PHP
|
<!DOCTYPE html>
|
||
|
<html lang="de">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
<title>Fahrrad-Unfallstatistik NRW</title>
|
||
|
<link rel="stylesheet" href="../css/bootstrap.min.css"/>
|
||
|
<style>
|
||
|
.rechts {text-align:right;background-color:#eee;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="container my-5">
|
||
|
<h1>Fahrradunfälle in Nordrhein-Westfalen in Gemeinden</h2>
|
||
|
<table class="table table-striped table-sm">
|
||
|
<tr><th></th>
|
||
|
<th colspan="4">Fahrradunfälle</th>
|
||
|
<th colspan="4">Todesfälle</th>
|
||
|
<th colspan="4">Schwerverletzte</th>
|
||
|
<th colspan="4">Leichtverletzte</th>
|
||
|
<th></th><th></th><th></th>
|
||
|
</tr>
|
||
|
<tr><th>Kreis</th>
|
||
|
<th>2022</th><th>2021</th><th>2020</th><th>2019</th>
|
||
|
<th>2022</th><th>2021</th><th>2020</th><th>2019</th>
|
||
|
<th>2022</th><th>2021</th><th>2020</th><th>2019</th>
|
||
|
<th>2022</th><th>2021</th><th>2020</th><th>2019</th>
|
||
|
<th>Fäche</th><th>Einw. in Tausend</th>
|
||
|
<th>Quote</th>
|
||
|
|
||
|
</tr>
|
||
|
<?php
|
||
|
|
||
|
require("../config.php");
|
||
|
|
||
|
$strSQL="SELECT d.Name as Gemeinde,
|
||
|
SUM(UJAHR=2022) as Jahr_2022,
|
||
|
SUM(UJAHR=2021) as Jahr_2021,
|
||
|
SUM(UJAHR=2020) as Jahr_2020,
|
||
|
SUM(UJAHR=2019) as Jahr_2019,
|
||
|
|
||
|
SUM(UJAHR=2022 AND UKATEGORIE=1) as Tode_2022,
|
||
|
SUM(UJAHR=2021 AND UKATEGORIE=1) as Tode_2021,
|
||
|
SUM(UJAHR=2020 AND UKATEGORIE=1) as Tode_2020,
|
||
|
SUM(UJAHR=2019 AND UKATEGORIE=1) as Tode_2019,
|
||
|
|
||
|
SUM(UJAHR=2022 AND UKATEGORIE=2) as Schwerverletzt_2022,
|
||
|
SUM(UJAHR=2021 AND UKATEGORIE=2) as Schwerverletzt_2021,
|
||
|
SUM(UJAHR=2020 AND UKATEGORIE=2) as Schwerverletzt_2020,
|
||
|
SUM(UJAHR=2019 AND UKATEGORIE=2) as Schwerverletzt_2019,
|
||
|
|
||
|
SUM(UJAHR=2022 AND UKATEGORIE=3) as Leichtverletzt_2022,
|
||
|
SUM(UJAHR=2021 AND UKATEGORIE=3) as Leichtverletzt_2021,
|
||
|
SUM(UJAHR=2020 AND UKATEGORIE=3) as Leichtverletzt_2020,
|
||
|
SUM(UJAHR=2019 AND UKATEGORIE=3) as Leichtverletzt_2019,
|
||
|
Flaeche, Einwohner,
|
||
|
SUM(UJAHR=2022)/d.Einwohner*1000 as Quote_2022
|
||
|
FROM data s, community d
|
||
|
WHERE IstRad=1
|
||
|
AND d.ULAND=s.ULAND AND d.UREGBEZ=s.UREGBEZ AND d.UKREIS=s.UKREIS AND d.UGEMEINDE=s.UGEMEINDE
|
||
|
GROUP BY s.ULAND, s.UREGBEZ, s.UKREIS,s.UGEMEINDE
|
||
|
ORDER BY Quote_2022 DESC
|
||
|
";
|
||
|
// --- ORDER BY s.ULAND, s.UREGBEZ, s.UKREIS,s.UGEMEINDE
|
||
|
|
||
|
$result=$db->query($strSQL);
|
||
|
|
||
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||
|
echo "<tr>";
|
||
|
echo "<td>".$row['Gemeinde']."</td>";
|
||
|
echo "<td>".$row['Jahr_2022']."</td>";
|
||
|
echo "<td>".$row['Jahr_2021']."</td>";
|
||
|
echo "<td>".$row['Jahr_2020']."</td>";
|
||
|
echo "<td>".$row['Jahr_2019']."</td>";
|
||
|
echo "<td>".$row['Tode_2022']."</td>";
|
||
|
echo "<td>".$row['Tode_2021']."</td>";
|
||
|
echo "<td>".$row['Tode_2020']."</td>";
|
||
|
echo "<td>".$row['Tode_2019']."</td>";
|
||
|
echo "<td>".$row['Schwerverletzt_2022']."</td>";
|
||
|
echo "<td>".$row['Schwerverletzt_2021']."</td>";
|
||
|
echo "<td>".$row['Schwerverletzt_2020']."</td>";
|
||
|
echo "<td>".$row['Schwerverletzt_2019']."</td>";
|
||
|
echo "<td>".$row['Leichtverletzt_2022']."</td>";
|
||
|
echo "<td>".$row['Leichtverletzt_2021']."</td>";
|
||
|
echo "<td>".$row['Leichtverletzt_2020']."</td>";
|
||
|
echo "<td>".$row['Leichtverletzt_2019']."</td>";
|
||
|
echo "<td class='rechts'>".$row['Flaeche']."</td>";
|
||
|
echo "<td class='rechts'>".round($row['Einwohner']/1000,1)."</td>";
|
||
|
echo "<td class='rechts'>".round($row['Quote_2022'],2)."</td>";
|
||
|
echo "</tr>\n";
|
||
|
}
|
||
|
echo "</table>\n";
|
||
|
?>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|