prepare("DELETE FROM location WHERE id = :id AND district=:district"); $stmt->bindValue(":id",$numDelete); $stmt->bindValue(":district",$strDistrict); $stmt->execute(); $stmt = $db->prepare("DELETE FROM comment WHERE loc_id= :loc_id"); $stmt->bindValue(":loc_id",$numDelete); $stmt->execute(); $stmt = $db->prepare("SELECT * FROM files where loc_id = :loc_id"); $stmt->bindValue(":loc_id", $numDelete, PDO::PARAM_INT); if ($row = $result->fetch(PDO::FETCH_ASSOC)) { $strFilename = $row['filename']; $strFilename = $uploaddir . $strFilename; unset($strFilename); } $stmt = $db->prepare("DELETE FROM files WHERE loc_id= :loc_id"); $stmt->bindValue(":loc_id",$numDelete); $stmt->execute(); } // Kommentar löschen if (isset($_GET['delcid'])) { if($_GET['csrf'] !== $_SESSION['csrf_token']) { die("Ungültiger Token"); } $numDelete=(int)$_GET['delcid']; $stmt = $db->prepare("DELETE FROM comment WHERE id= :id"); $stmt->bindValue(":id",$numDelete); $stmt->execute(); } if (isset($_GET['approvalId'])) { if($_GET['csrf'] !== $_SESSION['csrf_token']) { die("Ungültiger Token"); } $numApproval=(int)$_GET['approvalId']; $stmt = $db->prepare("UPDATE location SET approval = not approval WHERE id= :id"); $stmt->bindValue(":id",$numApproval); $stmt->execute(); } // Bild löschen if (isset($_GET['delfid'])) { if($_GET['csrf'] !== $_SESSION['csrf_token']) { die("Ungültiger Token"); } $numDelete=(int)$_GET['delfid']; $stmt = $db->prepare("SELECT * FROM files where id = :id"); $stmt->bindParam(':id', $id); //$result = $stmt->execute(); if ($row=$result->fetch(PDO::FETCH_ASSOC)) { $strFilename = $row['filename']; $strFilename = $uploaddir . $strFilename; unset($strFilename); } $stmt = $db->prepare("DELETE FROM files WHERE id= :id"); $stmt->bindValue(":id",$numDelete); $stmt->execute(); } // Karte zeigen if (isset($_GET['showmap'])) { $numShowmap=(int)$_GET['showmap']; $boolShowmap=$numShowmap==1; } $arrTopic = array ( 1 => "Fußverkehr", 2 => "Radverkehr", 3 => "Bus und Bahn", 4 => "Pkw-Verkehr", 5 => "Lkw-Verkehr" ); $arrIcon = array ( 1 => "", 2 => "", 3 => "", 4 => "", 5 => "" ); ?> Eintragsliste
Kreis" : "" ?> Alter" : "" ?> Freigabe" : "" ?> query($strSQL); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $id = $row['lid']; echo ""; echo ""; echo ($boolSuperAdmin) ? "" : ""; echo ""; echo ($boolUserinfo) ? "" : ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $strDefect = (isset($row['defect']) && $row['defect']>0) ? $arrDefect[$row['defect']] : ""; echo "\n"; echo "\n"; // Karte einblenden if ($boolShowmap) { echo "\n"; } else { echo ""; } echo ""; if ($boolApprove) { $strApproved = ($row['approval']) ? "" : "" ; echo ""; } echo ""; echo "\n"; if ($boolShowmap) { $strScript.="var mymap_".$id." = L.map(map_".$id.").setView([".$row['lat'].", ".$row['lng']."], 16);\n"; $strScript.="L.tileLayer(url, {maxZoom: 18,minZoom:12,attribution: attribution,id: 'mapbox/streets-v11',tileSize: 512,zoomOffset: -1}).addTo(mymap_".$id.")\n"; $strScript.="L.marker([".$row['lat'].", ".$row['lng']."], { icon: infoMarker } ).addTo(mymap_".$id.")\n\n"; } } ?>
id Username TransportTopic Beschreibung Kommentare Adresse Mangel Bild lat/lng Datum Aktion
".$id."".$row['district']."". stripslashes($row['username']) ."".$row['age']."".$row['transport']."".$arrIcon[$row['topic']]." ".$arrTopic[$row['topic']]."" . nl2br(stripslashes($row['description'])) . "".$row['thumb_ups']."".$row['thumb_downs'].""; $strSQL = "SELECT id,username,comment,created_at FROM comment WHERE loc_id=".$id; $comments = $db->query($strSQL); while ($comment = $comments->fetch(PDO::FETCH_ASSOC)) { echo "
"; echo "".$comment['username']." schrieb am "; $numDatum = strtotime($comment['created_at']); $strDatum = date("d.m.Y",$numDatum); echo $strDatum."
"; echo nl2br(stripslashes($comment['comment'])); echo ""; echo "
"; } echo "
".$row['road']." ".$row['house_number']."
" .$row['neighbourhood']." " .$row['hamlet']." " .$row['suburb']."
" .$row['postcode']." ".$row['city']."
".$strDefect.""; $strSQL = "SELECT id,filename FROM files WHERE loc_id=".$id; $files=$db->query($strSQL); if ($file=$files->fetch(PDO::FETCH_ASSOC)) { echo ""; echo ""; echo ""; } echo "
".round($row['lat'],5)." ".round($row['lng'],5)."".$row['created_at']."".$strApproved." change "; echo ""; echo "
zurück