cluster
Walter Hupfeld 9 months ago
parent fddabb11bb
commit d841823661

@ -1,8 +1,4 @@
<!DOCTYPE html>
<?php
require_once("config.php");
$strTitle="Datenschutz";
?>
<html lang="de">
<head>
<meta charset="UTF-8">
@ -15,7 +11,7 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
<a class="navbar-brand" href="#">Unfallkarte</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@ -28,6 +24,10 @@
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
<a class="nav-link" href="statistics/index.php">Statistik</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="impressum.php">Impressum</a>
</li>

@ -1,9 +1,5 @@
<!DOCTYPE html>
<html lang="de">
<?php
require_once("config.php");
$strTitle="Impressum";
?>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -15,7 +11,7 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
<a class="navbar-brand" href="#">Unfallkarte</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@ -28,6 +24,9 @@
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
<a class="nav-link" href="statistics/index.php">Statistik</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="impressum.php">Impressum <span class="sr-only">(current)</span></a>
@ -57,11 +56,7 @@
<a href="https://www.govdata.de/dl-de/by-2-0" target="_blanc">Datenlizenz Deutschland Namensnennung Version 2.0</a></p>
<p>&nbsp;</p>
<h3>Weitere Auswertungen zu Fahrradunfällen</h3>
<ul>
<li><a href="statistics/">Fahrradunfälle nach Kreisen und kreisfreien Städten</a></li>
<li><a href="statistics/gemeinden.php">Fahrradunfälle nach Gemeinden</a></li>
</ul>
<p>&nbsp;</p>
<h3>Impressum</h3>

@ -6,126 +6,11 @@
$numYear=$numLatestYear;
$strDistrict = (isset($_GET['d'])) ? $_GET['d'] : "Hamm";
$numVehicle = (isset($_GET['v'])) ? (int) $_GET['v'] : 1;
$numYear = (isset($_GET['year'])) ? (int) $_GET['year'] : $numYear;
$result= $db->prepare("SELECT count(*) FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
if ($row=$result->fetch(PDO::FETCH_NUM)) {
if ($row[0]==0) $strDistrict="hamm";
}
//$result = $db->query($strSQL);
$result= $db->prepare("SELECT * FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$strDistrict = $row['district'];
$strTitle = $row['title'];
$strGeojson = $row['geojson'];
$numULAND=$row['ULAND'];
$numUREGBEZ=$row['UREGBEZ'];
$numUKREIS=$row['UKREIS'];
$numUGEMEINDE=$row['UGEMEINDE'];
$numInfoLat=$row['lat'];
$numInfoLng=$row['lng'];
$numZoom=$row['zoom'];
$strTitle = "Unfallkarte $strTitle ";
$strIntroText = "$strTitle basierend auf den Daten des Statistischen Bundesamtes.";
$fileGeojson ="geojson/$strGeojson";
$strLocation = " AND ULAND=$numULAND AND UREGBEZ=$numUREGBEZ AND UKREIS=$numUKREIS ";
if ($numUGEMEINDE>0) {
$strLocation .= "AND UGEMEINDE=$numUGEMEINDE";
}
}
$arrDisctrict = array ();
$strSQL = "SELECT district,title FROM district ORDER BY title ASC";
$result=$db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$arrDistrict[$row['district']]=$row['title'];
}
$strIntro ="<h4>".$strTitle."</h4>";
$strIntro .= nl2br2($strIntroText);
switch ($numVehicle) {
case 1:
case 0:
$strWhere ="IstRad = 1";
$topic=2;
break;
case 2:
$strWhere = "IstPKW = 1";
$topic=4;
break;
case 3:
$strWhere = "IstFuss = 1";
$topic=1;
break;
case 4:
$strWhere = "IstKrad = 1";
$topic=0;
break;
case 5:
$strWhere = "IstGkfz = 1";
$topic=5;
break;
case 6:
$strWhere = "IstSonstige = 1";
$topic=3;
break;
default: $strWhere ="IstRad = 1";
$topic=2;
}
$strYear = " AND UJAHR='".$numYear."' ";
$strSQL="SELECT * FROM data WHERE ".$strWhere.$strYear.$strLocation;
$result = $db->query($strSQL);
$arrMarker = array();
$arrDescription = array();
$description="";
$numId=0;
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
//print_r($row);echo "<hr>";
//$id = $row['OBJECTID'];
$id=$numId;
$numLng = $row['XGCSWGS84'];
$numLat = $row['YGCSWGS84'];
if ($row['IstRad']) $description .="mit Fahrradbeteiligung, ";
if ($row['IstPKW']) $description .="mit PKW-Beteiligung, ";
if ($row['IstFuss']) $description .="mit Fußgängerbeteiligung, ";
if ($row['IstKrad']) $description .="mit Kraftradbeteiligung, ";
if ($row['IstGkfz']) $description .="mit Güterkraftzeugbeteiligung, ";
if ($row['IstSonstige']) $description .="mit Beteiligung eines oben nicht genannten Verkehrsmittels";
$strDescription=generate_tooltip_description($row);
$strCategory=generate_category($row);
$arrMarker[]="marker[".$id."] = [L.marker([".$numLat."," .$numLng."],"
." { icon: ".$arrMarkerType[$topic]." }),'".$strCategory."'];\n"
."marker[".$id."][0].addTo(mymap);\n "
."marker[".$id."][0].bindPopup('".$strDescription."');";
$numId++;
}
$markerid=$id+1;
/*
marker[val.id] = [L.marker([val.lat, val.lng], { "icon": L.MakiMarkers.icon({ "color": color, "size": "m", "icon": "circle" }) }).bindPopup(html), val.membertype];
marker[val.id][0].addTo(map);
*/
require_once("lib/init.php");
?>
<!DOCTYPE html>
<html lang="de">
@ -189,6 +74,9 @@
</select>
</form>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
<a class="nav-link" href="statistics/">Statistik</a>
</li>
<li class="nav-item">
<a class="nav-link" href="impressum.php">Impressum</a>
</li>

@ -0,0 +1,110 @@
<?php
$result= $db->prepare("SELECT count(*) FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
if ($row=$result->fetch(PDO::FETCH_NUM)) {
if ($row[0]==0) $strDistrict="hamm";
}
//$result = $db->query($strSQL);
$result= $db->prepare("SELECT * FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$strDistrict = $row['district'];
$strTitle = $row['title'];
$strGeojson = $row['geojson'];
$numULAND=$row['ULAND'];
$numUREGBEZ=$row['UREGBEZ'];
$numUKREIS=$row['UKREIS'];
$numUGEMEINDE=$row['UGEMEINDE'];
$numInfoLat=$row['lat'];
$numInfoLng=$row['lng'];
$numZoom=$row['zoom'];
$strTitle = "Unfallkarte $strTitle ";
$strIntroText = "$strTitle basierend auf den Daten des Statistischen Bundesamtes.";
$fileGeojson ="geojson/$strGeojson";
$strLocation = " AND ULAND=$numULAND AND UREGBEZ=$numUREGBEZ AND UKREIS=$numUKREIS ";
if ($numUGEMEINDE>0) {
$strLocation .= "AND UGEMEINDE=$numUGEMEINDE";
}
}
$arrDisctrict = array ();
$strSQL = "SELECT district,title FROM district ORDER BY title ASC";
$result=$db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$arrDistrict[$row['district']]=$row['title'];
}
$strIntro ="<h4>".$strTitle."</h4>";
$strIntro .= nl2br2($strIntroText);
switch ($numVehicle) {
case 1:
case 0:
$strWhere ="IstRad = 1";
$topic=2;
break;
case 2:
$strWhere = "IstPKW = 1";
$topic=4;
break;
case 3:
$strWhere = "IstFuss = 1";
$topic=1;
break;
case 4:
$strWhere = "IstKrad = 1";
$topic=0;
break;
case 5:
$strWhere = "IstGkfz = 1";
$topic=5;
break;
case 6:
$strWhere = "IstSonstige = 1";
$topic=3;
break;
default: $strWhere ="IstRad = 1";
$topic=2;
}
$strYear = " AND UJAHR='".$numYear."' ";
$strSQL="SELECT * FROM data WHERE ".$strWhere.$strYear.$strLocation;
$result = $db->query($strSQL);
$arrMarker = array();
$arrDescription = array();
$description="";
$numId=0;
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
//print_r($row);echo "<hr>";
//$id = $row['OBJECTID'];
$id=$numId;
$numLng = $row['XGCSWGS84'];
$numLat = $row['YGCSWGS84'];
if ($row['IstRad']) $description .="mit Fahrradbeteiligung, ";
if ($row['IstPKW']) $description .="mit PKW-Beteiligung, ";
if ($row['IstFuss']) $description .="mit Fußgängerbeteiligung, ";
if ($row['IstKrad']) $description .="mit Kraftradbeteiligung, ";
if ($row['IstGkfz']) $description .="mit Güterkraftzeugbeteiligung, ";
if ($row['IstSonstige']) $description .="mit Beteiligung eines oben nicht genannten Verkehrsmittels";
$strDescription=generate_tooltip_description($row);
$strCategory=generate_category($row);
$arrMarker[]="marker[".$id."] = [L.marker([".$numLat."," .$numLng."],"
." { icon: ".$arrMarkerType[$topic]." }),'".$strCategory."'];\n"
."marker[".$id."][0].addTo(mymap);\n "
."marker[".$id."][0].bindPopup('".$strDescription."');";
$numId++;
}
$markerid=$id+1;

@ -6,32 +6,69 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fahrrad-Unfallstatistik NRW</title>
<link rel="stylesheet" href="../css/bootstrap.min.css"/>
<link rel="stylesheet" href="//cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<script src="../js/jquery.min.js"></script>
<script src="//cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<style>
.rechts {text-align:right;background-color:#eee;}
.l {border-left: 1px solid black; }
</style>
</head>
<body>
<div class="container my-5">
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Unfallkarte</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbars">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="../index.php">Karte</a>
</li>
</ul>
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item active">
<a class="nav-link" href="index.php">Statistik <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../impressum.php">Impressum</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../datenschutz.php">Datenschutzerklärung</a>
</li>
</ul>
</div>
</nav>
<!-- Ende Navbar -->
<div class="container-fluid">
<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 class='l'>Fäche</th>
<th>Einw.</th>
<th>Quote</th>
</tr>
<tr><th>Kreis</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l' colspan="2">in Tausend</th><th></th>
</tr>
<table id="unfallzahlen" class="display">
<thead>
<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 class='l'>Fäche</th>
<th>Einw.</th>
<th>Quote</th>
</tr>
<tr><th>Name</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l'>2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class='l' colspan="2">in Tausend</th><th></th>
</tr>
</thead>
<tbody>
<?php
require("../config.php");
@ -92,8 +129,13 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo "<td class='rechts'>".round($row['Quote_2022'],2)."</td>";
echo "</tr>\n";
}
echo "</table>\n";
?>
</tbody>
</table>
</div>
</body>
<script>
let table = new DataTable('#unfallzahlen');
</script>
</html>

@ -1,95 +1,59 @@
<!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;}
.l {border-left: 1px solid black; }
</style>
</head>
<body>
<div class="container my-5">
<h1>Fahrradunfälle in Nordrhein-Westfalen in Kreisen und kreisfreien Städten</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>
</tr>
<tr><th>Kreis</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">Einw. in Tausend</th><th>Quote</th>
</tr>
<?php
require("../config.php");
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unfallstatistik</title>
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link rel="stylesheet" href="../css/style.css" />
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Unfallkarte</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbars">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="../index.php">Karte</a>
</li>
</ul>
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item active">
<a class="nav-link" href="index.php">Statistik <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../impressum.php">Impressum</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../datenschutz.php">Datenschutzerklärung</a>
</li>
</ul>
</div>
</nav>
<!-- Ende Navbar -->
<div class="container main">
<p>&nbsp;</p>
<div class="card">
<div class="card-header"><h2>Statistik zu Unfällen in NRW</h2></div>
<div class="card-body">
<h3>Weitere Auswertungen zu Fahrradunfällen</h3>
<ul>
<li><a href="kreise.php">Fahrradunfälle nach Kreisen und kreisfreien Städten</a></li>
<li><a href="gemeinden.php">Fahrradunfälle nach Gemeinden</a></li>
</ul>
$strSQL="SELECT d.title as Kreis,
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,
d.Population as Population,
SUM(UJAHR=2022)/d.Population*1000 as Quote_2022
FROM data s, district d
WHERE IstRad=1
AND d.ULAND=s.ULAND AND d.UREGBEZ=s.UREGBEZ AND d.UKREIS=s.UKREIS
GROUP BY s.ULAND, s.UREGBEZ, s.UKREIS
ORDER BY Quote_2022 DESC;";
$result=$db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td>".$row['Kreis']."</td>";
echo "<td class='l'>".$row['Jahr_2022']."</td>";
echo "<td>".$row['Jahr_2021']."</td>";
echo "<td>".$row['Jahr_2020']."</td>";
echo "<td>".$row['Jahr_2019']."</td>";
echo "<td class='l'>".$row['Tode_2022']."</td>";
echo "<td>".$row['Tode_2021']."</td>";
echo "<td>".$row['Tode_2020']."</td>";
echo "<td>".$row['Tode_2019']."</td>";
echo "<td class='l'>".$row['Schwerverletzt_2022']."</td>";
echo "<td>".$row['Schwerverletzt_2021']."</td>";
echo "<td>".$row['Schwerverletzt_2020']."</td>";
echo "<td>".$row['Schwerverletzt_2019']."</td>";
echo "<td class='l'>".$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='l rechts'>".round($row['Population']/1000,0)."</td>";
echo "<td class='rechts'>".round($row['Quote_2022'],2)."</td>";
echo "</tr>\n";
}
echo "</table>\n";
?>
</div>
</div>
</body>
</html>
</html>

@ -0,0 +1,139 @@
<!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"/>
<link rel="stylesheet" href="//cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<script src="../js/jquery.min.js"></script>
<script src="//cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<style>
.rechts {text-align:right;}
.l {border-left: 1px solid black; }
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Unfallkarte</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbars">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="../index.php">Karte</a>
</li>
</ul>
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item active">
<a class="nav-link" href="index.php">Statistik <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../impressum.php">Impressum</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="../datenschutz.php">Datenschutzerklärung</a>
</li>
</ul>
</div>
</nav>
<!-- Ende Navbar -->
<div class="container-fluid">
<h1>Fahrradunfälle in Nordrhein-Westfalen in Kreisen und kreisfreien Städten</h2>
<table id="unfallzahlen" class="display">
<thead>
<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>
</tr>
<tr><th>Kreis</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">2022</th><th>2021</th><th>2020</th><th>2019</th>
<th class="l">Einw. in Tausend</th><th>Quote</th>
</tr>
</thead>
<tbody>
<?php
require("../config.php");
$strSQL="SELECT d.title as Kreis,
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,
d.Population as Population,
SUM(UJAHR=2022)/d.Population*1000 as Quote_2022
FROM data s, district d
WHERE IstRad=1
AND d.ULAND=s.ULAND AND d.UREGBEZ=s.UREGBEZ AND d.UKREIS=s.UKREIS
GROUP BY s.ULAND, s.UREGBEZ, s.UKREIS
ORDER BY Quote_2022 DESC;";
$result=$db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td>".$row['Kreis']."</td>";
echo "<td class='l'>".$row['Jahr_2022']."</td>";
echo "<td>".$row['Jahr_2021']."</td>";
echo "<td>".$row['Jahr_2020']."</td>";
echo "<td>".$row['Jahr_2019']."</td>";
echo "<td class='l'>".$row['Tode_2022']."</td>";
echo "<td>".$row['Tode_2021']."</td>";
echo "<td>".$row['Tode_2020']."</td>";
echo "<td>".$row['Tode_2019']."</td>";
echo "<td class='l'>".$row['Schwerverletzt_2022']."</td>";
echo "<td>".$row['Schwerverletzt_2021']."</td>";
echo "<td>".$row['Schwerverletzt_2020']."</td>";
echo "<td>".$row['Schwerverletzt_2019']."</td>";
echo "<td class='l'>".$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='l rechts'>".round($row['Population']/1000,0)."</td>";
echo "<td class='rechts'>".round($row['Quote_2022'],2)."</td>";
echo "</tr>\n";
}
?>
</tbody>
</table>
<script>
let table = new DataTable('#unfallzahlen');
</script>
</div>
</body>
</html>
Loading…
Cancel
Save