years as select
This commit is contained in:
parent
6b233bd192
commit
0470740929
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$mapbox_token="write_mapbox_token_here";
|
||||||
|
|
||||||
$db_server = "mariadb";
|
$db_server = "mariadb";
|
||||||
$db_user = "dbuser";
|
$db_user = "dbuser";
|
||||||
$db_passwd = "geheim";
|
$db_passwd = "geheim";
|
||||||
|
@ -9,7 +9,7 @@ services:
|
|||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.unfallkarte.entrypoints=https"
|
- "traefik.http.routers.unfallkarte.entrypoints=https"
|
||||||
- "traefik.http.routers.unfallkarte.rule=Host(`unfallkarte.bankerheide.de`,`unfallkarte.hpadm.de`,`unfallkarte.adfc-hamm.de`,`unfallkarte.radwege-hamm.de`,`www.unfallkarte.adfc-hamm.de`,`www.unfallkarte.radwege-hamm.de`)"
|
- "traefik.http.routers.unfallkarte.rule=Host(`unfallkarte.bankerheide.de`,`unfallkarte.adfc-hamm.de`,`unfallkarte.radwege-hamm.de`,`www.unfallkarte.adfc-hamm.de`,`www.unfallkarte.radwege-hamm.de`)"
|
||||||
- "traefik.http.routers.unfallkarte.tls=true"
|
- "traefik.http.routers.unfallkarte.tls=true"
|
||||||
- "traefik.http.routers.unfallkarte.tls.certresolver=http"
|
- "traefik.http.routers.unfallkarte.tls.certresolver=http"
|
||||||
- "traefik.http.routers.unfallkarte.middlewares=default@file"
|
- "traefik.http.routers.unfallkarte.middlewares=default@file"
|
||||||
|
81
index.php
81
index.php
@ -149,42 +149,45 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Navbar -->
|
<!-- Navbar ######################## -->
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
|
||||||
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
|
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
|
||||||
|
|
||||||
<?php
|
<form method="GET" action="index.php">
|
||||||
for ($i=$numLatestYear;$i>=$numStartYear;$i--) {
|
<select name="year" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
||||||
echo "<a class='navbar-brand' href='index.php?year=$i&v=$numVehicle&d=$strDistrict'>$i</a>";
|
<?php
|
||||||
}
|
for ($i=$numLatestYear;$i>=$numStartYear;$i--) {
|
||||||
?>
|
$strActive = ($i==$numYear) ? "selected=\"selected\"" : "";
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
|
echo "<option value='$i' $strActive >$i</a>";
|
||||||
<span class="navbar-toggler-icon"></span>
|
}
|
||||||
</button>
|
echo "<input type='hidden' name='v' value='$numVehicle'>";
|
||||||
<div class="collapse navbar-collapse" id="navbars">
|
echo "<input type='hidden' name='d' value='$strDistrict'>";
|
||||||
|
?>
|
||||||
|
</form>
|
||||||
|
|
||||||
<ul class="navbar-nav mr-auto">
|
<div class="collapse navbar-collapse" id="navbars">
|
||||||
|
<ul class="navbar-nav mr-auto">
|
||||||
|
<?php foreach ($arrVehicles as $key => $strVehicle):
|
||||||
|
$strActive = ($numVehicle==$key) ? "active" : ""
|
||||||
|
?>
|
||||||
|
<li class="nav-item <?=$strActive?>">
|
||||||
|
<a class="nav-link" href="index.php?v=<?=$key?>&year=<?=$numYear?>&d=<?=$strDistrict?>"><?=$strVehicle?>
|
||||||
|
<span class="sr-only">(current)</span> </a>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php foreach ($arrVehicles as $key => $strVehicle):
|
</ul>
|
||||||
$strActive = ($numVehicle==$key) ? "active" : ""
|
|
||||||
?>
|
|
||||||
|
|
||||||
<li class="nav-item <?=$strActive?>">
|
<!-- District -->
|
||||||
<a class="nav-link" href="index.php?v=<?=$key?>&year=<?=$numYear?>&d=<?=$strDistrict?>"><?=$strVehicle?>
|
|
||||||
<span class="sr-only">(current)</span> </a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
</ul>
|
<form method="GET" action="index.php">
|
||||||
|
<select name="d" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
||||||
<div>
|
<?php foreach ($arrDistrict as $key => $strTitle):
|
||||||
<form method="GET" action="index.php">
|
$strActive = ($strDistrict==$key) ? "selected=\"selected\"" : ""; ?>
|
||||||
<select name="d" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
|
<option value="<?=$key?>" <?=$strActive?>><?=$strTitle?></option>
|
||||||
<?php foreach ($arrDistrict as $key => $strTitle):
|
<?php endforeach; ?>
|
||||||
$strActive = ($strDistrict==$key) ? "selected=\"selected\"" : ""; ?>
|
</select>
|
||||||
<option value="<?=$key?>" <?=$strActive?>><?=$strTitle?></option>
|
</form>
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
</from>
|
|
||||||
<ul class="navbar-nav mr-auto right">
|
<ul class="navbar-nav mr-auto right">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="impressum.php">Impressum</a>
|
<a class="nav-link" href="impressum.php">Impressum</a>
|
||||||
@ -194,9 +197,15 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<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>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- Ende Navbar -->
|
<!-- Ende Navbar ############# -->
|
||||||
|
|
||||||
<div class="container-fluid" style="margin-top: 4em;">
|
<div class="container-fluid" style="margin-top: 4em;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -220,21 +229,15 @@
|
|||||||
<!-- row -->
|
<!-- row -->
|
||||||
</div>
|
</div>
|
||||||
<!-- container-fluid -->
|
<!-- container-fluid -->
|
||||||
|
|
||||||
|
|
||||||
<div id="loader"><img src="css/images/ajax-loader.gif"></div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Map ----------------------------------------------------------------------
|
// Map ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
|
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
|
||||||
|
|
||||||
var mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
|
var mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
|
||||||
// ocmlink = '<a href="http://thunderforest.com/">Thunderforest</a>';
|
// ocmlink = '<a href="http://thunderforest.com/">Thunderforest</a>';
|
||||||
var ocmLink = '<a href="https://www.mapbox.com/">Mapbox</a>';
|
var ocmLink = '<a href="https://www.mapbox.com/">Mapbox</a>';
|
||||||
|
|
||||||
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=sk.eyJ1Ijoid2h1cGZlbGQiLCJhIjoiY2xrMW1icTYzMDUxMTNkbXF6NmIyeWI0aSJ9.-GyWgYxxDQGQnD2KnqTOug', {
|
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?=$mapbox_token?>', {
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
minZoom:<?=$numZoom ?>,
|
minZoom:<?=$numZoom ?>,
|
||||||
attribution: 'Map data © '+ mapLink +' contributors, ' +
|
attribution: 'Map data © '+ mapLink +' contributors, ' +
|
||||||
@ -274,11 +277,11 @@
|
|||||||
"opacity": 0.6
|
"opacity": 0.6
|
||||||
};
|
};
|
||||||
|
|
||||||
var hammLayer = new L.GeoJSON.AJAX(["<?= $fileGeojson ?>"], {
|
var districtLayer = new L.GeoJSON.AJAX(["<?= $fileGeojson ?>"], {
|
||||||
style: myStyle,
|
style: myStyle,
|
||||||
invert: true
|
invert: true
|
||||||
});
|
});
|
||||||
hammLayer.addTo(mymap);
|
districtLayer.addTo(mymap);
|
||||||
|
|
||||||
// Marker from database -------------------------------------------------------
|
// Marker from database -------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user