|
|
|
@ -3,12 +3,60 @@
|
|
|
|
|
require("config.php");
|
|
|
|
|
require_once("lib/functions.php");
|
|
|
|
|
|
|
|
|
|
$numYear="2020";
|
|
|
|
|
|
|
|
|
|
$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 = "Unfallkarte für die Stadt $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);
|
|
|
|
|
$numYear=2020;
|
|
|
|
|
|
|
|
|
|
$numVehicle = (isset($_GET['v'])) ? (int) $_GET['v'] : 1;
|
|
|
|
|
$numYear = (isset($_GET['year'])) ? (int) $_GET['year'] : $numYear;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch ($numVehicle) {
|
|
|
|
|
case 1:
|
|
|
|
@ -43,7 +91,6 @@
|
|
|
|
|
$strYear = " AND UJAHR='".$numYear."' ";
|
|
|
|
|
|
|
|
|
|
$strSQL="SELECT * FROM data WHERE ".$strWhere.$strYear.$strLocation;
|
|
|
|
|
echo $strSQL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$result = $db->query($strSQL);
|
|
|
|
@ -101,8 +148,8 @@
|
|
|
|
|
<!-- 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="index.php?year=2019&v=<?=$numVehicle?>">2019</a>
|
|
|
|
|
<a class="navbar-brand" href="index.php?year=2020&v=<?=$numVehicle?>">2020</a>
|
|
|
|
|
<a class="navbar-brand" href="index.php?year=2019&v=<?=$numVehicle?>&d=<?=$strDistrict?>">2019</a>
|
|
|
|
|
<a class="navbar-brand" href="index.php?year=2020&v=<?=$numVehicle?>&d=<?=$strDistrict?>">2020</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>
|
|
|
|
@ -115,13 +162,21 @@
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<li class="nav-item <?=$strActive?>">
|
|
|
|
|
<a class="nav-link" href="index.php?v=<?=$key?>&year=<?=$numYear?>"><?=$strVehicle?>
|
|
|
|
|
<a class="nav-link" href="index.php?v=<?=$key?>&year=<?=$numYear?>&d=<?=$strDistrict?>"><?=$strVehicle?>
|
|
|
|
|
<span class="sr-only">(current)</span> </a>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<form method="GET" action="index.php">
|
|
|
|
|
<select name="d" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
|
|
|
|
<?php foreach ($arrDistrict as $key => $strTitle):
|
|
|
|
|
$strActive = ($strDistrict==$key) ? "selected=\"selected\"" : ""; ?>
|
|
|
|
|
<option value="<?=$key?>" <?=$strActive?>><?=$strTitle?></option>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</select>
|
|
|
|
|
</from>
|
|
|
|
|
<ul class="navbar-nav mr-auto right">
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a class="nav-link" href="impressum.php">Impressum</a>
|
|
|
|
@ -263,7 +318,9 @@
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function myFunction(chosen) {
|
|
|
|
|
console.log(chosen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|