2020-07-30 18:36:57 +02:00
|
|
|
<?php
|
|
|
|
|
2023-10-06 11:50:50 +02:00
|
|
|
require("config.php");
|
2023-10-06 12:37:02 +02:00
|
|
|
require_once("lib/attributes.php");
|
2020-07-30 18:36:57 +02:00
|
|
|
require_once("lib/functions.php");
|
|
|
|
|
2023-10-06 12:48:19 +02:00
|
|
|
$numYear=$numLatestYear;
|
|
|
|
|
2021-10-27 15:01:27 +02:00
|
|
|
$strDistrict = (isset($_GET['d'])) ? $_GET['d'] : "Hamm";
|
|
|
|
$numVehicle = (isset($_GET['v'])) ? (int) $_GET['v'] : 1;
|
|
|
|
$numYear = (isset($_GET['year'])) ? (int) $_GET['year'] : $numYear;
|
|
|
|
|
2023-10-09 17:52:21 +02:00
|
|
|
require_once("lib/init.php");
|
2020-07-30 18:36:57 +02:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="de">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
<script src="js/jquery.min.js"></script>
|
2023-10-26 11:20:38 +02:00
|
|
|
<script src="js/bootstrap.min.js"></script>
|
2020-07-30 18:36:57 +02:00
|
|
|
<script src="js/leaflet.js"></script>
|
|
|
|
<script src="js/leaflet.ajax.js"></script>
|
|
|
|
<script src="js/leaflet.awesome-markers.js"></script>
|
|
|
|
<script src="js/leaflet.snogylop.js"></script>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="css/font-awesome.min.css">
|
|
|
|
<link rel="stylesheet" href="css/bootstrap.min.css" />
|
|
|
|
<link rel="stylesheet" href="css/leaflet.css" />
|
|
|
|
<link rel="stylesheet" href="css/leaflet.awesome-markers.css" />
|
|
|
|
<link rel="stylesheet" href="css/style.css" />
|
2020-07-31 07:34:37 +02:00
|
|
|
<title><?= $strTitle ?></title>
|
2020-07-30 18:36:57 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2023-10-06 20:27:05 +02:00
|
|
|
<!-- Navbar ######################## -->
|
|
|
|
|
2020-07-30 18:36:57 +02:00
|
|
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
|
2023-10-22 21:19:10 +02:00
|
|
|
<div class="collapse navbar-collapse" id="navbars">
|
2020-07-30 18:36:57 +02:00
|
|
|
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
|
2023-10-06 20:27:05 +02:00
|
|
|
|
2023-10-22 21:19:10 +02:00
|
|
|
<ul class="navbar-nav mr-auto">
|
|
|
|
|
2023-10-06 20:27:05 +02:00
|
|
|
<form method="GET" action="index.php">
|
|
|
|
<select name="year" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
|
|
|
<?php
|
|
|
|
for ($i=$numLatestYear;$i>=$numStartYear;$i--) {
|
|
|
|
$strActive = ($i==$numYear) ? "selected=\"selected\"" : "";
|
|
|
|
echo "<option value='$i' $strActive >$i</a>";
|
|
|
|
}
|
|
|
|
echo "<input type='hidden' name='v' value='$numVehicle'>";
|
|
|
|
echo "<input type='hidden' name='d' value='$strDistrict'>";
|
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
|
2023-10-11 21:35:47 +02:00
|
|
|
<form method="GET" action="index.php">
|
|
|
|
<select name="v" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
|
|
|
<?php
|
|
|
|
foreach ($arrVehicles as $key=>$vehicle)
|
|
|
|
{
|
2023-10-11 21:38:01 +02:00
|
|
|
$strActive = ($key==$numVehicle) ? "selected=\"selected\"" : "";
|
2023-10-11 21:35:47 +02:00
|
|
|
echo "<option value='$key' $strActive >$vehicle</a>";
|
|
|
|
}
|
|
|
|
echo "<input type='hidden' name='year' value='$numYear'>";
|
|
|
|
echo "<input type='hidden' name='d' value='$strDistrict'>";
|
|
|
|
?>
|
|
|
|
</form>
|
2023-10-26 11:20:38 +02:00
|
|
|
</ul>
|
2023-10-22 21:19:10 +02:00
|
|
|
<!-- District -->
|
2023-10-06 20:27:05 +02:00
|
|
|
<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>
|
|
|
|
</form>
|
2023-10-26 11:20:38 +02:00
|
|
|
|
2023-10-22 21:19:10 +02:00
|
|
|
<div>
|
2020-07-30 18:36:57 +02:00
|
|
|
<ul class="navbar-nav mr-auto right">
|
2023-10-26 11:20:38 +02:00
|
|
|
<li class="nav-item active dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle" href="./" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
Statistik
|
|
|
|
</a>
|
|
|
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
|
|
|
<a class="dropdown-item" href="statistics/index.php">Übersicht</a>
|
|
|
|
<a class="dropdown-item" href="statistics/nrw_details.php">NRW</a>
|
|
|
|
<a class="dropdown-item" href="statistics/kreise.php">Kreise</a>
|
|
|
|
<a class="dropdown-item" href="statistics/gemeinden.php">Gemeinden</a>
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-07-30 18:36:57 +02:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="impressum.php">Impressum</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="datenschutz.php">Datenschutzerklärung</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2023-10-06 20:27:05 +02:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
2020-07-30 18:36:57 +02:00
|
|
|
</div>
|
2023-10-22 21:19:10 +02:00
|
|
|
</nav>
|
2023-10-06 20:27:05 +02:00
|
|
|
<!-- Ende Navbar ############# -->
|
2020-07-30 18:36:57 +02:00
|
|
|
|
|
|
|
<div class="container-fluid" style="margin-top: 4em;">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
|
|
|
|
<div class="sidebar-sticky">
|
2021-07-31 20:56:13 +02:00
|
|
|
<h1>Jahr <?= $numYear?></h2>
|
2020-09-05 11:59:06 +02:00
|
|
|
<h2>Unfälle mit <?= $arrVehicles_pl[$numVehicle]; ?> </h2>
|
2020-07-30 18:36:57 +02:00
|
|
|
<ul class="nav flex-column">
|
2021-07-31 20:56:13 +02:00
|
|
|
<?php echo get_statistics($numVehicle,$strWhere,$strYear); ?>
|
2020-07-30 18:36:57 +02:00
|
|
|
</ul>
|
2020-09-05 11:59:06 +02:00
|
|
|
|
2020-07-30 18:36:57 +02:00
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-1">
|
|
|
|
<div id="mapid"></div>
|
|
|
|
</main>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- row -->
|
|
|
|
</div>
|
|
|
|
<!-- container-fluid -->
|
2023-07-28 22:36:31 +02:00
|
|
|
<script>
|
2020-07-30 18:36:57 +02:00
|
|
|
// Map ----------------------------------------------------------------------
|
|
|
|
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
|
|
|
|
|
|
|
|
var mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
|
|
|
|
// ocmlink = '<a href="http://thunderforest.com/">Thunderforest</a>';
|
|
|
|
var ocmLink = '<a href="https://www.mapbox.com/">Mapbox</a>';
|
|
|
|
|
2023-10-06 20:27:05 +02:00
|
|
|
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?=$mapbox_token?>', {
|
2020-07-30 18:36:57 +02:00
|
|
|
maxZoom: 18,
|
|
|
|
minZoom:<?=$numZoom ?>,
|
|
|
|
attribution: 'Map data © '+ mapLink +' contributors, ' +
|
|
|
|
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
|
|
|
|
'Imagery © ' + ocmLink,
|
|
|
|
//id: 'mapbox/streets-v11',
|
|
|
|
id: 'mapbox/outdoors-v11',
|
|
|
|
tileSize: 512,
|
|
|
|
zoomOffset: -1
|
|
|
|
}).addTo(mymap);
|
|
|
|
|
|
|
|
// markerIcons ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
var infoMarker = L.AwesomeMarkers.icon({icon: 'info', prefix: 'fa', markerColor: 'orange'});
|
2020-08-01 15:40:09 +02:00
|
|
|
var bicycleMarker = L.AwesomeMarkers.icon({icon: 'bicycle', prefix: 'fa', markerColor: 'red'});
|
2020-07-30 18:36:57 +02:00
|
|
|
var carMarker = L.AwesomeMarkers.icon({icon: 'car', prefix: 'fa', markerColor: 'red'});
|
|
|
|
var truckMarker = L.AwesomeMarkers.icon({icon: 'truck', prefix: 'fa', markerColor: 'beige'});
|
|
|
|
var trainMarker = L.AwesomeMarkers.icon({icon: 'bus', prefix: 'fa', markerColor: 'blue'});
|
|
|
|
var pedestrianMarker = L.AwesomeMarkers.icon({icon: 'male', prefix: 'fa', markerColor: 'darkblue'});
|
|
|
|
|
|
|
|
function getMarker(topic) {
|
|
|
|
var arrMarker = [];
|
|
|
|
<?php
|
|
|
|
foreach ($arrMarkerType as $key => $value) {
|
|
|
|
echo "arrMarker[".$key."]=".$value.";\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
return arrMarker[topic];
|
|
|
|
}
|
|
|
|
|
|
|
|
//Hamm-Layer - todo invers area ---------------------------------------
|
|
|
|
|
|
|
|
var myStyle = {
|
|
|
|
"color": "grey",
|
|
|
|
"fillColor": "lightblue",
|
|
|
|
"weight": 4,
|
|
|
|
"opacity": 0.6
|
|
|
|
};
|
|
|
|
|
2023-10-06 20:27:05 +02:00
|
|
|
var districtLayer = new L.GeoJSON.AJAX(["<?= $fileGeojson ?>"], {
|
2020-07-30 18:36:57 +02:00
|
|
|
style: myStyle,
|
|
|
|
invert: true
|
|
|
|
});
|
2023-10-06 20:27:05 +02:00
|
|
|
districtLayer.addTo(mymap);
|
2020-07-30 18:36:57 +02:00
|
|
|
|
|
|
|
// Marker from database -------------------------------------------------------
|
|
|
|
|
|
|
|
var marker = [];
|
|
|
|
var arrDescription = [];
|
|
|
|
|
|
|
|
<?php
|
|
|
|
foreach ($arrMarker as $idx=>$strMarker) {
|
|
|
|
echo $strMarker."\n";
|
|
|
|
}
|
|
|
|
echo "var marker_max=".$markerid."\n";
|
|
|
|
?>
|
|
|
|
|
|
|
|
// Info-Marker für Start --------------------------------------------------------
|
|
|
|
|
|
|
|
var marker2 = L.marker([<?=$numInfoLat?>, <?=$numInfoLng?>], { icon: infoMarker }).addTo(mymap);
|
2020-08-02 20:08:48 +02:00
|
|
|
|
|
|
|
|
2020-07-30 18:36:57 +02:00
|
|
|
<?php
|
2020-08-02 20:08:48 +02:00
|
|
|
echo "marker2.bindPopup('".$strIntro."');";
|
|
|
|
if ($numVehicle==0) {
|
|
|
|
echo "marker2.openPopup();";
|
|
|
|
}
|
2020-07-30 18:36:57 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Hide and show marker form checkbox ----------------------------------------
|
|
|
|
|
|
|
|
$('.check').click(function() {
|
2023-07-28 07:45:47 +02:00
|
|
|
filter = this.name;
|
2020-07-30 18:36:57 +02:00
|
|
|
if (jQuery(this).prop("checked")) {
|
|
|
|
jQuery.each(marker, function(key, value) {
|
|
|
|
if (value) {
|
2023-07-28 20:11:45 +02:00
|
|
|
if (filter.match(value[1])) { value[0].addTo(mymap); }
|
2020-07-30 18:36:57 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
jQuery.each(marker, function(key, value) {
|
|
|
|
if (value) {
|
2023-07-28 20:11:45 +02:00
|
|
|
if (filter.match(value[1])) { value[0].remove(); }
|
2020-07-30 18:36:57 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2023-07-28 22:36:31 +02:00
|
|
|
function check_all(){
|
|
|
|
jQuery.each(marker, function(key, value) {
|
|
|
|
if (value) { value[0].addTo(mymap); }
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
function uncheck_all()
|
|
|
|
{
|
|
|
|
jQuery.each(marker, function(key, value) {
|
|
|
|
if (value) { value[0].remove(); }
|
|
|
|
});
|
|
|
|
};
|
2020-07-30 18:36:57 +02:00
|
|
|
|
2023-07-30 16:58:10 +02:00
|
|
|
$('input[type=radio][name=kategorie]').on('change', function() {
|
|
|
|
$('.td_ubet').hide();
|
|
|
|
$('.td_utyp').hide();
|
|
|
|
$('.td_uart').hide();
|
|
|
|
$('.td_ukat').hide();
|
|
|
|
check_all();
|
|
|
|
$("input[type=checkbox]").prop('checked', $(this).prop('checked'));
|
|
|
|
switch ($(this).val()) {
|
|
|
|
case 'UART':
|
|
|
|
$('.td_uart').show();
|
|
|
|
break;
|
|
|
|
case 'UKAT':
|
|
|
|
$('.td_ukat').show();
|
|
|
|
break;
|
|
|
|
case 'UTYP':
|
|
|
|
$('.td_utyp').show();
|
|
|
|
break;
|
|
|
|
case 'UBET':
|
2023-07-30 17:44:03 +02:00
|
|
|
$('.td_ubet').show();
|
|
|
|
$('.veh_<?=$numVehicle?>').hide();
|
2023-07-30 16:58:10 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
2020-07-30 18:36:57 +02:00
|
|
|
|
2023-07-30 16:58:10 +02:00
|
|
|
$('.td_ubet').hide();
|
|
|
|
$('.td_utyp').hide();
|
|
|
|
$('.td_uart').hide();
|
|
|
|
$('.td_ukat').show();
|
|
|
|
$('input:radio[name=kategorie]').val(['UKAT']);
|
2023-10-06 12:12:25 +02:00
|
|
|
</script>
|
2020-07-30 18:36:57 +02:00
|
|
|
</body>
|
|
|
|
</html>
|