checkbox
This commit is contained in:
parent
b48d66479f
commit
0ae8f915c4
@ -91,4 +91,6 @@ i.wa {
|
|||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5 {margin-top:15px;}
|
||||||
|
|
||||||
.statistik td, th {border: 1px solid grey; font-size: smaller;}
|
.statistik td, th {border: 1px solid grey; font-size: smaller;}
|
45
index.php
45
index.php
@ -113,7 +113,7 @@
|
|||||||
$strDescription=generate_tooltip_description($row);
|
$strDescription=generate_tooltip_description($row);
|
||||||
$strCategory=generate_category($row);
|
$strCategory=generate_category($row);
|
||||||
$arrMarker[]="marker[".$id."] = [L.marker([".$numLat."," .$numLng."],"
|
$arrMarker[]="marker[".$id."] = [L.marker([".$numLat."," .$numLng."],"
|
||||||
." { icon: ".$arrMarkerType[$topic]." }),'check_".$strCategory."'];\n"
|
." { icon: ".$arrMarkerType[$topic]." }),'".$strCategory."'];\n"
|
||||||
."marker[".$id."][0].addTo(mymap);\n "
|
."marker[".$id."][0].addTo(mymap);\n "
|
||||||
."marker[".$id."][0].bindPopup('".$strDescription."');";
|
."marker[".$id."][0].bindPopup('".$strDescription."');";
|
||||||
$numId++;
|
$numId++;
|
||||||
@ -311,25 +311,54 @@
|
|||||||
|
|
||||||
if (jQuery(this).prop("checked")) {
|
if (jQuery(this).prop("checked")) {
|
||||||
jQuery.each(marker, function(key, value) {
|
jQuery.each(marker, function(key, value) {
|
||||||
|
console.log(value);
|
||||||
if (value) {
|
if (value) {
|
||||||
if (filter.match(value[1]))
|
if (filter.match(value[1])) { value[0].addTo(mymap); }
|
||||||
{ value[0].addTo(mymap); }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
jQuery.each(marker, function(key, value) {
|
jQuery.each(marker, function(key, value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
if (filter.match(value[1]))
|
if (filter.match(value[1])) { value[0].remove(); }
|
||||||
{ value[0].remove(); }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('#check_art').click(function(){
|
||||||
function myFunction(chosen) {
|
if (jQuery(this).prop("checked")) {
|
||||||
console.log(chosen);
|
$('.uart').prop( "checked", true );
|
||||||
|
} else {
|
||||||
|
$('.uart').prop( "checked", false );
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#check_kat').click(function(){
|
||||||
|
console.log("test");
|
||||||
|
if (jQuery(this).prop("checked")) {
|
||||||
|
$('.ukat').prop( "checked", true );
|
||||||
|
} else {
|
||||||
|
$('.ukat').prop( "checked", false );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#check_typ').click(function(){
|
||||||
|
if (jQuery(this).prop("checked")) {
|
||||||
|
$('.utyp').prop( "checked", true );
|
||||||
|
} else {
|
||||||
|
$('.utyp').prop( "checked", false );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#check_art').click(function(){
|
||||||
|
if (jQuery(this).prop("checked")) {
|
||||||
|
$('.uart').prop( "checked", true );
|
||||||
|
} else {
|
||||||
|
$('.uart').prop( "checked", false );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,7 +11,6 @@ function generate_tooltip_description($row) {
|
|||||||
global $arrWochentage;
|
global $arrWochentage;
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
|
||||||
$strDescription = "<h3>Daten zum Unfall</h3>";
|
$strDescription = "<h3>Daten zum Unfall</h3>";
|
||||||
$description = "<strong>Unfallkategorie:</strong> ".$arrCategory[$row['UKATEGORIE']]."<br>";
|
$description = "<strong>Unfallkategorie:</strong> ".$arrCategory[$row['UKATEGORIE']]."<br>";
|
||||||
$description .= "<strong>Unfallmonat/Jahr:</strong> ".$row['UMONAT']."/".$row['UJAHR']."<br>";
|
$description .= "<strong>Unfallmonat/Jahr:</strong> ".$row['UMONAT']."/".$row['UJAHR']."<br>";
|
||||||
@ -29,17 +28,19 @@ function generate_tooltip_description($row) {
|
|||||||
if ($row['IstSonstige']) $description .="mit Beteiligung eines oben nicht genannten Verkehrsmittels";
|
if ($row['IstSonstige']) $description .="mit Beteiligung eines oben nicht genannten Verkehrsmittels";
|
||||||
|
|
||||||
$strDescription .= nl2br2($description);
|
$strDescription .= nl2br2($description);
|
||||||
|
|
||||||
return $strDescription;
|
return $strDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_category($row) {
|
function generate_category($row) {
|
||||||
return "UART_".$row['UART']."|UKATEGORIE_".$row['UKATEGORIE'];
|
$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;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* reads gps location form picture data
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function read_gps_location($file){
|
function read_gps_location($file){
|
||||||
@ -96,13 +97,13 @@ function nl2br2($string) {
|
|||||||
global $arrCategory;
|
global $arrCategory;
|
||||||
global $strLocation;
|
global $strLocation;
|
||||||
|
|
||||||
$strTable="<h5>Unfallkategorie</h5>";
|
$strTable="<h5><input type='checkbox' id='check_kat' class='check_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='check_UKATEGORIE_".$row['UKATEGORIE']."' id='check_UKATEGORIE_".$row['UKATEGORIE']."' class='check' checked='checked' ></td>"
|
$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";
|
."<td>".$arrCategory[$row['UKATEGORIE']]."</td><td>".$row['anz']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,16 +122,16 @@ function nl2br2($string) {
|
|||||||
WHERE ".$strWhere.$strYear.$strLocation;
|
WHERE ".$strWhere.$strYear.$strLocation;
|
||||||
|
|
||||||
$result = $db->query($strSQL);
|
$result = $db->query($strSQL);
|
||||||
$strTable.="<h5>Unfallbeteiligte</h5>";
|
$strTable.="<h5><input type='checkbox' id='check_beteiligt' class='check_header' checked='checked'>Unfallbeteiligte</h5>";
|
||||||
$strTable.="<table class='statistik'>";
|
$strTable.="<table class='statistik'>";
|
||||||
//$strTable.="<tr><th>Unfallbeteiligte</th><th>Anzahl</th></tr>";
|
//$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>Fahrräder</td><td>".$row['rad']."</td></tr>";
|
$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>PKWs</td><td>".$row['pkw']."</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>Fussgänger</td><td>".$row['fuss']."</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>Krafträder</td><td>".$row['krad']."</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>LKWs</td><td>".$row['lkw']."</td></tr>\n";
|
$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>Sonstiges</td><td>".$row['sonstiges']."</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";
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -168,32 +169,37 @@ 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>Alleinunfälle und Unfälle mit geicher Fahrzeugart</td><td>".$row['count']."</td></tr>";
|
$strTable.="<tr><td></td><td>Alleinunfälle und Unfälle mit geicher Fahrzeugart</td><td>".$row['count']."</td></tr>";
|
||||||
|
}
|
||||||
|
$strTable.="</table>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Unfalltyp
|
||||||
|
|
||||||
|
$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.="<table class='statistik'>";
|
||||||
|
$result = $db->query($strSQL);
|
||||||
|
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>"
|
||||||
|
."<td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n";
|
||||||
}
|
}
|
||||||
$strTable.="</table>";
|
$strTable.="</table>";
|
||||||
|
|
||||||
//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>Unfallart</h5>";
|
$strTable.="<h5><input type='checkbox' id='check_art' class='check_header' checked='checked'>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='check_UART_".$row['UART']."' id='check_URT_".$row['UART']."' class='check' checked='checked' ></td>"
|
$strTable.="<tr><td><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>";
|
||||||
|
|
||||||
//Unfallart
|
//Erläuterung
|
||||||
|
|
||||||
$strSQL="SELECT UTYP1, count(UTYP1) as anz FROM data WHERE ".$strWhere.$strYear.$strLocation." GROUP BY UTYP1";
|
|
||||||
$strTable.="<h5>Unfalltyp</h5>";
|
|
||||||
$strTable.="<table class='statistik'>";
|
|
||||||
$result = $db->query($strSQL);
|
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$strTable.="<tr><td>".$arrUnfalltyp[$row['UTYP1']]."</td><td>".$row['anz']."</td></tr>\n";
|
|
||||||
}
|
|
||||||
$strTable.="</table>";
|
|
||||||
|
|
||||||
$strTable.="<a href='https://recht.nrw.de/lmi/owa/br_vbl_show_pdf?p_id=12225' target='_blank'>Unfalltpyen</a><br>";
|
$strTable.="<a href='https://recht.nrw.de/lmi/owa/br_vbl_show_pdf?p_id=12225' target='_blank'>Unfalltpyen</a><br>";
|
||||||
$strTable.="<a href='https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Verkehrsunfaelle/Methoden/verkehrsunfaelle-grundbegriffe.pdf?__blob=publicationFile' target='_blank'>Unfallbeschreibung</a><br>";
|
$strTable.="<a href='https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Verkehrsunfaelle/Methoden/verkehrsunfaelle-grundbegriffe.pdf?__blob=publicationFile' target='_blank'>Unfallbeschreibung</a><br>";
|
||||||
|
Loading…
Reference in New Issue
Block a user