filter_1
This commit is contained in:
parent
e18ee929a6
commit
b2ad23bd97
@ -94,3 +94,5 @@ i.wa {
|
|||||||
h5 {margin-top:15px;}
|
h5 {margin-top:15px;}
|
||||||
|
|
||||||
.statistik td, th {border: 1px solid grey; font-size: smaller;}
|
.statistik td, th {border: 1px solid grey; font-size: smaller;}
|
||||||
|
|
||||||
|
.radio_header {margin-right:7px;}
|
||||||
|
70
index.php
70
index.php
@ -224,6 +224,7 @@
|
|||||||
<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>';
|
||||||
@ -306,8 +307,6 @@
|
|||||||
|
|
||||||
$('.check').click(function() {
|
$('.check').click(function() {
|
||||||
filter = this.name;
|
filter = this.name;
|
||||||
console.log(filter);
|
|
||||||
|
|
||||||
if (jQuery(this).prop("checked")) {
|
if (jQuery(this).prop("checked")) {
|
||||||
jQuery.each(marker, function(key, value) {
|
jQuery.each(marker, function(key, value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
@ -325,7 +324,6 @@
|
|||||||
|
|
||||||
function check_all(){
|
function check_all(){
|
||||||
jQuery.each(marker, function(key, value) {
|
jQuery.each(marker, function(key, value) {
|
||||||
console.log(value);
|
|
||||||
if (value) { value[0].addTo(mymap); }
|
if (value) { value[0].addTo(mymap); }
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -333,56 +331,38 @@
|
|||||||
function uncheck_all()
|
function uncheck_all()
|
||||||
{
|
{
|
||||||
jQuery.each(marker, function(key, value) {
|
jQuery.each(marker, function(key, value) {
|
||||||
console.log(value);
|
|
||||||
if (value) { value[0].remove(); }
|
if (value) { value[0].remove(); }
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$('input[type=radio][name=kategorie]').on('change', function() {
|
||||||
$('#check_art').click(function(){
|
$('.td_ubet').hide();
|
||||||
if (jQuery(this).prop("checked")) {
|
$('.td_utyp').hide();
|
||||||
$('.uart').prop( "checked", true );
|
$('.td_uart').hide();
|
||||||
|
$('.td_ukat').hide();
|
||||||
check_all();
|
check_all();
|
||||||
} else {
|
$("input[type=checkbox]").prop('checked', $(this).prop('checked'));
|
||||||
$('.uart').prop( "checked", false );
|
switch ($(this).val()) {
|
||||||
uncheck_all();
|
case 'UART':
|
||||||
|
$('.td_uart').show();
|
||||||
|
break;
|
||||||
|
case 'UKAT':
|
||||||
|
$('.td_ukat').show();
|
||||||
|
break;
|
||||||
|
case 'UTYP':
|
||||||
|
$('.td_utyp').show();
|
||||||
|
break;
|
||||||
|
case 'UBET':
|
||||||
|
$('.td_ubet').show();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#check_kat').click(function(){
|
$('.td_ubet').hide();
|
||||||
console.log("test");
|
$('.td_utyp').hide();
|
||||||
if (jQuery(this).prop("checked")) {
|
$('.td_uart').hide();
|
||||||
$('.ukat').prop( "checked", true );
|
$('.td_ukat').show();
|
||||||
check_all();
|
$('input:radio[name=kategorie]').val(['UKAT']);
|
||||||
} else {
|
|
||||||
$('.ukat').prop( "checked", false );
|
|
||||||
uncheck_all();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#check_typ').click(function(){
|
|
||||||
if (jQuery(this).prop("checked")) {
|
|
||||||
$('.utyp').prop( "checked", true );
|
|
||||||
check_all();
|
|
||||||
} else {
|
|
||||||
$('.utyp').prop( "checked", false );
|
|
||||||
uncheck_all();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#check_art').click(function(){
|
|
||||||
if (jQuery(this).prop("checked")) {
|
|
||||||
$('.uart').prop( "checked", true );
|
|
||||||
check_all();
|
|
||||||
} else {
|
|
||||||
$('.uart').prop( "checked", false );
|
|
||||||
uncheck_all();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -97,13 +97,13 @@ function nl2br2($string) {
|
|||||||
global $arrCategory;
|
global $arrCategory;
|
||||||
global $strLocation;
|
global $strLocation;
|
||||||
|
|
||||||
$strTable="<h5><input type='checkbox' id='check_kat' class='check_header' checked='checked'>Unfallkategorie</h5>";
|
$strTable="<h5><input type='radio' value='UKAT' name='kategorie' class='radio_header' checked='checked'>Unfallkategorie</h5>";
|
||||||
$strTable.="<table class='statistik'>";
|
$strTable.="<table class='statistik'>";
|
||||||
$strSQL="SELECT UKATEGORIE, count(UKATEGORIE) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UKATEGORIE";
|
$strSQL="SELECT UKATEGORIE, count(UKATEGORIE) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UKATEGORIE";
|
||||||
$result = $db->query($strSQL);
|
$result = $db->query($strSQL);
|
||||||
|
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UKATEGORIE_".$row['UKATEGORIE']."' id='UKATEGORIE_".$row['UKATEGORIE']."' class='check ukat' checked='checked' ></td>"
|
$strTable.="<tr><td class='td_ukat'><input type='checkbox' name='UKATEGORIE_".$row['UKATEGORIE']."' id='UKATEGORIE_".$row['UKATEGORIE']."' class='check ukat' checked='checked' ></td>"
|
||||||
."<td>".$arrCategory[$row['UKATEGORIE']]."</td><td>".$row['anz']."</td></tr>\n";
|
."<td>".$arrCategory[$row['UKATEGORIE']]."</td><td>".$row['anz']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
$strTable.="</table>";
|
$strTable.="</table>";
|
||||||
@ -121,22 +121,16 @@ function nl2br2($string) {
|
|||||||
WHERE ".$strWhere.$strYear.$strLocation;
|
WHERE ".$strWhere.$strYear.$strLocation;
|
||||||
|
|
||||||
$result = $db->query($strSQL);
|
$result = $db->query($strSQL);
|
||||||
$strTable.="<h5><input type='checkbox' id='check_beteiligt' class='check_header' checked='checked'>Unfallbeteiligte</h5>";
|
$strTable.="<h5><input type='radio' value='UBET' name='kategorie' class='radio_header'>Unfallbeteiligte</h5>";
|
||||||
$strTable.="<table class='statistik'>";
|
$strTable.="<table class='statistik'>";
|
||||||
//$strTable.="<tr><th>Unfallbeteiligte</th><th>Anzahl</th></tr>";
|
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_RAD' id='BETEILIGT_RAD' class='check' checked='checked' ></td><td>Fahrräder</td><td>".$row['rad']."</td></tr>";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_RAD' id='BETEILIGT_RAD' class='check' checked='checked' ></td><td>Fahrräder</td><td>".$row['rad']."</td></tr>";
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_PKW' id='BETEILIGT_PKW' class='check' checked='checked' ></td><td>PKWs</td><td>".$row['pkw']."</td></tr>";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_PKW' id='BETEILIGT_PKW' class='check' checked='checked' ></td><td>PKWs</td><td>".$row['pkw']."</td></tr>";
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_FUSS' id='BETEILIGT_FUSS' class='check' checked='checked' ></td><td>Fussgänger</td><td>".$row['fuss']."</td></tr>";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_FUSS' id='BETEILIGT_FUSS' class='check' checked='checked' ></td><td>Fussgänger</td><td>".$row['fuss']."</td></tr>";
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_KRAD' id='BETEILIGT_KRAD' class='check' checked='checked' ></td><td>Krafträder</td><td>".$row['krad']."</td></tr>";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_KRAD' id='BETEILIGT_KRAD' class='check' checked='checked' ></td><td>Krafträder</td><td>".$row['krad']."</td></tr>";
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_LKW' id='BETEILIGT_LKW' class='check' checked='checked' ></td><td>LKWs</td><td>".$row['lkw']."</td></tr>\n";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_LKW' id='BETEILIGT_LKW' class='check' checked='checked' ></td><td>LKWs</td><td>".$row['lkw']."</td></tr>\n";
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UBETEILIGT_SONSTIGES' id='BETEILIGT_SONSTIGES' class='check' checked='checked' ></td><td>Sonstiges</td><td>".$row['sonstiges']."</td></tr>\n";
|
$strTable.="<tr><td class='td_ubet'><input type='checkbox' name='UBETEILIGT_SONSTIGES' id='BETEILIGT_SONSTIGES' class='check' checked='checked' ></td><td>Sonstiges</td><td>".$row['sonstiges']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
$strSQL="SELECT count(*) as count
|
|
||||||
FROM data
|
|
||||||
WHERE IstRad=0 and IstPKW=0 and IstFuss=0 and IstKrad=0 and IstGkfz=0 and IstSonstige=0";
|
|
||||||
*/
|
|
||||||
switch ($numVehicle) {
|
switch ($numVehicle) {
|
||||||
case 1:
|
case 1:
|
||||||
case 0:
|
case 0:
|
||||||
@ -167,7 +161,7 @@ function nl2br2($string) {
|
|||||||
|
|
||||||
$result = $db->query($strSQL.$strYear);
|
$result = $db->query($strSQL.$strYear);
|
||||||
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strTable.="<tr><td></td><td>Alleinunfälle und Unfälle mit geicher Fahrzeugart</td><td>".$row['count']."</td></tr>";
|
$strTable.="<tr><td class='td_ubet'></td><td>Alleinunfälle und Unfälle mit geicher Fahrzeugart</td><td>".$row['count']."</td></tr>";
|
||||||
}
|
}
|
||||||
$strTable.="</table>";
|
$strTable.="</table>";
|
||||||
|
|
||||||
@ -176,11 +170,11 @@ function nl2br2($string) {
|
|||||||
//Unfalltyp
|
//Unfalltyp
|
||||||
|
|
||||||
$strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UTYP1";
|
$strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UTYP1";
|
||||||
$strTable.="<h5><input type='checkbox' id='check_typ' class='check_header' checked='checked'>Unfalltyp</h5>";
|
$strTable.="<h5><input type='radio' value='UTYP' name='kategorie' class='radio_header'>Unfalltyp</h5>";
|
||||||
$strTable.="<table class='statistik'>";
|
$strTable.="<table class='statistik'>";
|
||||||
$result = $db->query($strSQL);
|
$result = $db->query($strSQL);
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UTYP_".$row['UTYP1']."' id='UTYP_".$row['UTYP1']."' class='check utyp' checked='checked' ></td>"
|
$strTable.="<tr><td class='td_utyp'><input type='checkbox' name='UTYP_".$row['UTYP1']."' id='UTYP_".$row['UTYP1']."' class='check utyp' checked='checked' ></td>"
|
||||||
."<td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n";
|
."<td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
$strTable.="</table>";
|
$strTable.="</table>";
|
||||||
@ -188,11 +182,11 @@ function nl2br2($string) {
|
|||||||
//Unfallart
|
//Unfallart
|
||||||
|
|
||||||
$strSQL="SELECT UART, count(UART) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UART";
|
$strSQL="SELECT UART, count(UART) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UART";
|
||||||
$strTable.="<h5><input type='checkbox' id='check_art' class='check_header' checked='checked'>Unfallart</h5>";
|
$strTable.="<h5><input type='radio' value='UART' name='kategorie' class='radio_header'>Unfallart</h5>";
|
||||||
$strTable.="<table class='statistik'>";
|
$strTable.="<table class='statistik'>";
|
||||||
$result = $db->query($strSQL);
|
$result = $db->query($strSQL);
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strTable.="<tr><td><input type='checkbox' name='UART_".$row['UART']."' id='UART_".$row['UART']."' class='check uart' checked='checked' ></td>"
|
$strTable.="<tr><td class='td_uart'><input type='checkbox' name='UART_".$row['UART']."' id='UART_".$row['UART']."' class='check uart' checked='checked' ></td>"
|
||||||
."<td>".$arrUnfallart[$row['UART']]."</td><td>".$row['anz']."</td></tr>\n";
|
."<td>".$arrUnfallart[$row['UART']]."</td><td>".$row['anz']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
$strTable.="</table>";
|
$strTable.="</table>";
|
||||||
|
Loading…
Reference in New Issue
Block a user