This commit is contained in:
Walter Hupfeld
2024-03-11 23:06:15 +01:00
parent 4c2d55d699
commit d571968568
10 changed files with 66 additions and 46 deletions

View File

@@ -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
******************************** */

View File

@@ -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
*/

View File

@@ -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>";