This commit is contained in:
Walter Hupfeld 2023-07-28 22:36:31 +02:00
parent 0ae8f915c4
commit e18ee929a6
3 changed files with 55 additions and 37 deletions

View File

@ -17,12 +17,12 @@ try {
$arrVehicles = array (
1 => "Fahrrad",
2 => "PKW",
3 => "Fussgänger",
4 => "Kraftrad",
5 => "LKW",
6 => "Sonstiges"
1 => "Fahrrad",
2 => "PKW",
3 => "Fussgänger",
4 => "Kraftrad",
5 => "LKW",
6 => "Sonstiges"
);
$arrVehicles_pl = array (
@ -35,16 +35,15 @@ $arrVehicles_pl = array (
);
$arrWochentage = array (
1 => "Sonntag",
2 => "Montag",
3 => "Dienstag",
4 => "Mittwoch",
5 => "Donnerstag",
6 => "Freitag",
7 => "Samstag"
1 => "Sonntag",
2 => "Montag",
3 => "Dienstag",
4 => "Mittwoch",
5 => "Donnerstag",
6 => "Freitag",
7 => "Samstag"
);
$arrCategory = array (
1 => "Unfall mit Getöteten",
2 => "Unfall mit Schwerverletztem",
@ -108,7 +107,6 @@ $arrMarkerType = array (
5=>"truckMarker",
);
$arrIcon = array (
0 => "<i class='wa bg-primary fa fa-info'></i>",
1 => "<i class='wa bg-danger fa fa-male'></i>",

View File

@ -220,9 +220,8 @@
<div id="loader"><img src="css/images/ajax-loader.gif"></div>
<script>
// Map ----------------------------------------------------------------------
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
@ -311,7 +310,6 @@
if (jQuery(this).prop("checked")) {
jQuery.each(marker, function(key, value) {
console.log(value);
if (value) {
if (filter.match(value[1])) { value[0].addTo(mymap); }
}
@ -325,11 +323,29 @@
}
})
function check_all(){
jQuery.each(marker, function(key, value) {
console.log(value);
if (value) { value[0].addTo(mymap); }
});
};
function uncheck_all()
{
jQuery.each(marker, function(key, value) {
console.log(value);
if (value) { value[0].remove(); }
});
};
$('#check_art').click(function(){
if (jQuery(this).prop("checked")) {
$('.uart').prop( "checked", true );
check_all();
} else {
$('.uart').prop( "checked", false );
uncheck_all();
}
});
@ -337,24 +353,30 @@
console.log("test");
if (jQuery(this).prop("checked")) {
$('.ukat').prop( "checked", true );
check_all();
} 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();
}
});

View File

@ -32,14 +32,14 @@ function generate_tooltip_description($row) {
}
function generate_category($row) {
$strReturn = "UART_".$row['UART']."|UKATEGORIE_".$row['UKATEGORIE']."|UTYP_".$row['UTYP1'];
if ($row['IstRad']) $strReturn .="|UBETEILIGT_RAD";
if ($row['IstPKW']) $strReturn .="|UBETEILIGT_PKW";
if ($row['IstFuss']) $strReturn .="|UBETEILIGT_FUSS";
if ($row['IstKrad']) $strReturn .="|UBETEILIGT_KRAD";
if ($row['IstGkfz']) $strReturn .="|UBETEILIGT_LKW";
if ($row['IstSonstige']) $strReturn .="|UBETEILIGT_SONSTIGES";
return $strReturn;
$strReturn = "UART_".$row['UART']."|UKATEGORIE_".$row['UKATEGORIE']."|UTYP_".$row['UTYP1'];
if ($row['IstRad']) $strReturn .="|UBETEILIGT_RAD";
if ($row['IstPKW']) $strReturn .="|UBETEILIGT_PKW";
if ($row['IstFuss']) $strReturn .="|UBETEILIGT_FUSS";
if ($row['IstKrad']) $strReturn .="|UBETEILIGT_KRAD";
if ($row['IstGkfz']) $strReturn .="|UBETEILIGT_LKW";
if ($row['IstSonstige']) $strReturn .="|UBETEILIGT_SONSTIGES";
return $strReturn;
}
@ -106,20 +106,19 @@ function nl2br2($string) {
$strTable.="<tr><td><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";
}
$strTable.="</table>";
$strSQL="SELECT
sum(IstRad) as rad,
sum(IstPKW) as pkw,
sum(IstFuss) as fuss,
sum(IstKrad) as krad,
sum(IstGkfz) as lkw,
sum(IstSonstige) as sonstiges,
count(*) as summe
FROM data
WHERE ".$strWhere.$strYear.$strLocation;
sum(IstRad) as rad,
sum(IstPKW) as pkw,
sum(IstFuss) as fuss,
sum(IstKrad) as krad,
sum(IstGkfz) as lkw,
sum(IstSonstige) as sonstiges,
count(*) as summe
FROM data
WHERE ".$strWhere.$strYear.$strLocation;
$result = $db->query($strSQL);
$strTable.="<h5><input type='checkbox' id='check_beteiligt' class='check_header' checked='checked'>Unfallbeteiligte</h5>";
@ -132,7 +131,6 @@ function nl2br2($string) {
$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><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";
}
/*
$strSQL="SELECT count(*) as count