main
Walter Hupfeld 2 months ago
parent 4c2d55d699
commit d571968568

@ -4,7 +4,7 @@
* Ideenmelder
* Autor: Walter Hupfeld, Hamm
* E-Mail: info@hupfeld-software.de
* Version: 1.0
* Version: 3.0
* Datum: 18.05.2021
* zuletzt geändert: 18.02.2024
******************************** */

@ -3,7 +3,7 @@
* Ideenmelder
* Autor: Walter Hupfeld, Hamm
* E-Mail: info@hupfeld-software.de
* Version: 1.0
* Version: 3.0
* Datum: 18.05.2021
* zuletzt geändert: 18.02.2024
*/

@ -72,12 +72,21 @@
$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);
@ -90,7 +99,6 @@
$stmt = $db->prepare("DELETE FROM files WHERE id= :id");
$stmt->bindValue(":id",$numDelete);
$stmt->execute();
}
// Karte zeigen
@ -99,6 +107,7 @@
$boolShowmap=$numShowmap==1;
}
$arrTopic = array (
1 => "Fußverkehr",
2 => "Radverkehr",
@ -114,6 +123,7 @@
4 => "<i class='fa fa-car'></i>",
5 => "<i class='fa fa-truck'></i>"
);
?>
<!DOCTYPE html>
<html lang="de">
@ -162,9 +172,7 @@
<li class="nav-item">
<a class="nav-link" href="password.php">Passwort ändern </a>
</li>
</ul>
<div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
@ -191,6 +199,7 @@
<th>Bild</th>
<th>lat/lng</th>
<th>Datum</th>
<?= ($boolApprove) ? "<th>Freigabe</th>" : "" ?>
<th>Aktion</th></tr>
</thead>
<tbody>
@ -253,6 +262,11 @@
echo "<td>".round($row['lat'],5)." ".round($row['lng'],5)."</td>";
}
echo "<td>".$row['created_at']."</td>";
if ($boolApprove) {
$strApproved = ($row['approval']) ? "<i class='fa fa-check' style='color:green'></i>"
: "<i class='fa fa-circle' style='color:red'></i>" ;
echo "<td>".$strApproved." <a href='".$_SERVER['PHP_SELF']."?approvalId=".$id."&csrf=".$_SESSION['csrf_token']."'>change</td>";
}
echo "<td><a class='del' href='".$_SERVER['PHP_SELF']."?delid=".$id."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>&nbsp;";
echo "<a class='edit_defect' href='#' id='edit_".$id."' value='".$id."'><i class='fa fa-pencil'></i></a>";
echo "</td>";

@ -8,7 +8,7 @@ $db_name = "nrw_melder";
$cachetime = 0;
$location_key="";
$mapbox_key="pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw";
$mapbox_key="";
try {
$db = new PDO('mysql:host='.$db_server.';dbname='.$db_name.';charset=utf8mb4', $db_user, $db_passwd);

@ -155,6 +155,7 @@ $arrAge = array (
);
$arrDefect = array (
0 => "--Bitte wählen--",
1 => "Pfosten/Poller",
2 => "Schranke",
3 => "Umlaufsperre/Drängelgitter",

@ -94,7 +94,12 @@ i.wa {
display:none;
}
.not_approved {
color:darkgray;
}
.jumbotron {
background-color:orange;
}
a, a:active, a:visited, a:active {color:orange;}
a, a:active, a:visited, a:active {color:orange;}

@ -1,4 +1,3 @@
<div id="dialog_comment" class="card" title="Kommentar">
<div class="card-header">Ihr Kommentar
<span id="close_comment" type="button" class="close right text-danger">

@ -1,11 +1,11 @@
<?php
function print_username() {
echo <<<EOT
echo <<<HEREDOC
<!-- Username ---------------------------------- -->
<label for="username"><strong>Ihr Name oder Pseudonym:</strong></label>
<input type="text" name="username" maxlength="16" id="username" placeholder="Name" class="text" required="required">
<br>
EOT;
HEREDOC;
}
function print_userinfo() {
@ -57,23 +57,22 @@ function print_description(){
}
function print_topics(){
global $arrTopic;
echo <<<HEREDOC
<!-- Themenfelder ---------------------------------- -->
<strong>Wählen Sie ein Themenfeld aus:</strong></br>
<div class="row">
HEREDOC;
$first=true;
foreach ($arrTopic as $keyTopic => $valTopic) {
$checked = ($first) ? "checked=\"checked\"" : "";
$first=false;
echo '<div class="col-6-md col-6">
<input type="radio" id="topic'.$keyTopic.'" name="topic" value="'.$keyTopic.'" $checked/>
<label for="topic$keyTopic">'.$valTopic.'</label>
</div>';
};
echo "</div> <!-- row -->";
global $arrTopic;
echo <<<HEREDOC
<!-- Themenfelder ---------------------------------- -->
<strong>Wählen Sie ein Themenfeld aus:</strong></br>
<div class="row">
HEREDOC;
$first=true;
foreach ($arrTopic as $keyTopic => $valTopic) {
$checked = ($first) ? "checked=\"checked\"" : "";
$first=false;
echo '<div class="col-6-md col-6">
<input type="radio" id="topic'.$keyTopic.'" name="topic" value="'.$keyTopic.'" $checked/>
<label for="topic$keyTopic">'.$valTopic.'</label>
</div>';
};
echo "</div> <!-- row -->";
}
?>
@ -86,18 +85,13 @@ echo "</div> <!-- row -->";
</div>
<div class="card-body">
<form id="newobjectform" enctype="multipart/form-data" action="#" method="post" >
<form id="newobjectform" enctype="multipart/form-data" action="#" method="post" >
<?php
print_username();
if ($boolUserinfo) print_userinfo();
if ($boolDefect) print_category();
print_description();
if ($boolTopics) {
print_topics();
} else {
echo "<input type='hidden' id='topic' name='topic' value='2' />";
}
if ($boolTopics) print_topics();
?>
<!-- Lokalisierung ---------------------------------- -->

@ -4,8 +4,8 @@
* Ideenmelder
* Autor: Walter Hupfeld, Hamm
* E-Mail: info@hupfeld-software.de
* Version: 1.0
* Datum: 18.05.2021
* Version: 3.0
* Datum: 11.03.2024
******************************** */
@ -14,12 +14,14 @@ function generate_tooltip_description($row) {
global $boolComment;
global $boolUpload;
global $boolDefect;
global $boolApprove;
global $uploaddir;
global $arrTopic;
global $arrDefect;
global $db;
$description = $row['description'];
$description = ($boolApprove && $row['approval']) ? $row['description'] : "Freigabe in Kürze";
$numUps = $row['thumb_ups'];
$numDowns = $row['thumb_downs'];
$id = $row['id'];
@ -29,7 +31,7 @@ function generate_tooltip_description($row) {
$strDescription = "<strong>Anmerkung zu ".$arrTopic[$topic]."</strong><br>";
if ($boolUpload && isset($row['filename'])) {
if ($boolUpload && isset($row['filename']) && ($boolApprove && $row['approval'])) {
$strDescription .= "<a href=\'images/".$row['filename']."\' data-lightbox=\'radweg".$id."\'>";
$strDescription .= "<img src=\'images/".$row['filename']."\' style=\'width:200px;\' /></a><br>";
}

@ -141,7 +141,11 @@
echo "<td>".$row['transport']."</td>";
}
echo "<td>".$arrIcon[$row['topic']]." ".$arrTopic[$row['topic']]."</td>";
echo "<td>" . nl2br(stripslashes($row['description']))."</td>";
if ($boolApprove && $row['approval']) {
echo "<td>" . nl2br(stripslashes($row['description']))."</td>";
} else {
echo "<td class='not_approved'>Freigabe erfolgt in Kürze.</td>";
}
if ($boolComment) {
echo "<td>";
$strSQL = "SELECT username,comment,created_at FROM comment WHERE loc_id=".$id;
@ -168,12 +172,14 @@
}
echo "<td>".$datum."</td>";
if ($boolUpload) {
echo "<td>";
if (isset($row['filename'])) {
echo "<a href='images/".$row['filename']."' data-lightbox='radweg".$id."'>";
echo "<img style='width:120px' src='images/".$row['filename']."'></a>";
if ($boolApprove || $row['approval']) {
echo "<td>";
if (isset($row['filename'])) {
echo "<a href='images/".$row['filename']."' data-lightbox='radweg".$id."'>";
echo "<img style='width:120px' src='images/".$row['filename']."'></a>";
}
echo "</td>";
}
echo "</td>";
}
echo "<td><a class='maplink' name='".$id."' href='#'>Karte</a><!--".round($row['lat'],4)." / ".round($row['lng'],4)."--></td>";
echo "</tr>\n";
@ -207,7 +213,6 @@ jQuery(document).ready(function(){
});
<?php
echo " var points = [];\n";
foreach ($arrPoint as $point) {

Loading…
Cancel
Save