This commit is contained in:
Walter Hupfeld 2024-03-15 19:46:25 +01:00
parent e325b14ee7
commit 0d5fb5e5da
13 changed files with 77 additions and 44 deletions

View File

@ -23,7 +23,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}
@ -91,9 +91,11 @@
<input type="checkbox" id="districtSelection" name="districtSelection" <?= ($boolDistrictSelection) ? "checked=\"checked\"" :"" ?> >
<label for="districtSelection">Auswahl Kreise in Navigation</label><br>
<input type="checkbox" id="approve" name="approve" <?= ($boolApprove) ? "checked=\"checked\"" :"" ?> >
<label for="approve">Eingaben genehmigen</label>
<label for="approve">Eingaben genehmigen</label><br>
<input type="checkbox" id="sidebar" name="sidebar" <?= ($boolSidebar) ? "checked=\"checked\"" :"" ?> >
<label for="sidebar">Sidebar anzeigen</label>
<br>
<label class="leftlabel">Uplaod-Pfad:</label>
<label class="leftlabel">Upload-Pfad:</label>
<input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$uploaddir?>">
</div>
</div>

View File

@ -17,7 +17,7 @@
$boolDefect = (isset($_POST['defect'])) ? "1" : "0";
$boolDistrictSelection = (isset($_POST['districtSelection'])) ? "1" : "0";
$boolApprove = (isset($_POST['approve'])) ? "1" : "0";
$boolSidebar = (isset($_POST['sidebar'])) ? "1" : "0";
$strUploaddir = $_POST['uploaddir'];
$strTitle = $_POST['title'];
@ -45,6 +45,7 @@
$db->query("UPDATE `config` SET `value`= '$boolDefect' WHERE `key`='boolDefect'");
$db->query("UPDATE `config` SET `value`= '$boolUpload' WHERE `key`='boolUpload'");
$db->query("UPDATE `config` SET `value`= '$boolApprove' WHERE `key`='boolApprove'");
$db->query("UPDATE `config` SET `value`= '$boolSidebar' WHERE `key`='boolSidebar'");
$db->query("UPDATE `config` SET `value`= '$boolDistrictSelection' WHERE `key`='boolDistrictSelection'");
header("Location: configuration.php");

View File

@ -32,7 +32,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}

View File

@ -36,7 +36,7 @@
<link href="../css/font-awesome.min.css" rel="stylesheet">
<script src="../js/jquery.min.js"></script>
<title>Konfigruation</title>
<title>Konfiguration</title>
<style>
.leftlabel { width: 10em;}
input[type="text"] { width: 18em;}

View File

@ -144,7 +144,6 @@
<script src="../js/leaflet.awesome-markers.js"></script>
<script src="../js/jquery.fancybox.min.js"></script>
<title>Eintragsliste</title>
<style>
.tdmap { height:350px; width:300px;}
</style>
@ -237,7 +236,8 @@
$strDatum = date("d.m.Y",$numDatum);
echo $strDatum."</em><br>";
echo nl2br(stripslashes($comment['comment']));
echo "<a class='left' href='".$_SERVER['PHP_SELF']."?delcid=".$comment['id']."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>";
echo "<a class='left' href='".$_SERVER['PHP_SELF']."?delcid=".$comment['id']."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Freischalten/Sperren'><i class='fa fa-trash'></i></span></a>";
echo "</div>";
}
echo "</td>";
@ -256,7 +256,8 @@
if ($file=$files->fetch(PDO::FETCH_ASSOC)) {
echo "<a href='../images/".$file['filename']."' data-fancybox data-caption='".$strDefect."'>";
echo "<img src='../images/".$file['filename']."' style='width:150px'></a>";
echo "<a href='".$_SERVER['PHP_SELF']."?delfid=".$file['id']."&csrf=".$_SESSION['csrf_token']."'><i class='fa fa-trash'></i></a>";
echo "<a href='".$_SERVER['PHP_SELF']."?delfid=".$file['id']."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Bild löschen'><i class='fa fa-trash'></i></span></a>";
}
echo "</td>\n";
@ -270,13 +271,15 @@
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>" ;
$strApproved .= " <i class='fa fa-recycle'></i>";
$strApproved = ($row['approval']) ? "<span data-toggle='data-toggle' title='Eintrag sperren'><i class='fa fa-check' style='color:green'></i>"
: "<span data-toggle='tooltip' title='Eintrag freischalten'><i class='fa fa-circle' style='color:red'></i>" ;
$strApproved .= " <i class='fa fa-recycle'></i></span>";
echo "<td><a href='".$_SERVER['PHP_SELF']."?approvalId=".$id."&csrf=".$_SESSION['csrf_token']."'>".$strApproved."</a></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><a class='del' href='".$_SERVER['PHP_SELF']."?delid=".$id."&csrf=".$_SESSION['csrf_token']."'>".
"<span data-toggle='tooltip' title='Eintrag löschen'><i class='fa fa-trash'></i></span></a>&nbsp;";
echo "<a class='edit_defect' href='#' id='edit_".$id."' value='".$id."'>".
"<span data-toggle='tooltip' title='Eintrag editieren'><i class='fa fa-pencil'></span></i></a>";
echo "</td>";
echo "</tr>\n";
@ -327,7 +330,6 @@ $( document ).ready(function() {
return result===true;
})
$("#editobjectform").submit(function(event){
event.preventDefault();
@ -369,7 +371,7 @@ $( document ).ready(function() {
$('#close').click(function(e){
$('#dialog_defect').hide();
});
<?= $strScript ?>
});
</script>

View File

@ -26,9 +26,9 @@ $boolLogin=true;
$strPassword = trim($_POST['password']);
$strSQL = "SELECT username,passwordhash,district,role FROM user WHERE username=:user";
$stmt = $db->prepare($strSQL);
$stmt->bindValue(':user',$strUser);
$result=$stmt->execute();
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
$stmt->bindValue(":user",$strUser, PDO::PARAM_STR);
$stmt->execute();
if ($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
$boolOk = $strDistrict==$row['district'] || $row['role']=="admin";
if (password_verify($strPassword,$row['passwordhash']) && $boolOk) {
$_SESSION['user']=$strUser;
@ -62,6 +62,9 @@ $boolLogin=true;
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="../<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?=$strTitle?> <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@ -76,6 +79,17 @@ $boolLogin=true;
</li>
</ul>
</div>
<ul class="navbar-nav mr-auto right">
<li class="nav-item">
<a class="nav-link" href="../impressum.php">Impressum</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../datenschutz.php">Datenschutzerklärung</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="login.php">Login <span class="sr-only">(current)</span></a>
</li>
</ul>
</nav>
<!-- Ende Navbar -->

View File

@ -64,7 +64,9 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
case "boolApprove":
$boolApprove = ($row['value']=="1");
break;
case "boolSidebar":
$boolSidebar = ($row['value']=="1");
break;
default: ;
//echo "Fehler bei ".$row['key'];
// Ende Lokalisierung

View File

@ -97,6 +97,12 @@ i.wa {
color:darkgray;
}
.logo_navbar {
height: 2.5em;
background-color:white;
margin: 0 1em 0 0;
}
.jumbotron {
background-color:orange;
}

View File

@ -21,7 +21,11 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?=$strTitle?> <?=$strDistrictTitle?></a>
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?=$strTitle?> &raquo; <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

View File

@ -21,7 +21,10 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?=$strTitle?> <?=$strDistrictTitle?></a>
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?=$strTitle?> &raquo; <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

View File

@ -85,18 +85,15 @@
<body>
<!-- Navbar -->
<!--
<?php
print_r($_SESSION);
?>
-->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?> <?=$strDistrictTitle?></a>
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?= $strTitle ?> &raquo; <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbars">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="index.php?ref=1">Karte <span class="sr-only">(current)</span></a>
@ -134,29 +131,28 @@
<!-- Ende Navbar -->
<div class="container-fluid" style="margin-top: 4em;">
<?php if ($boolSidebar): ?>
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky">
<a href="start.php"><img class="logo" src="<?=$strLogo?>" alt="Logo" ></a>
<ul class="nav flex-column">
<?php
foreach ($arrTopic as $key=>$topic) {
echo "<li class='nav-item'>";
echo "<label>";
echo "<a class='nav-link'>".$arrIcon[$key]." ";
echo "<input type='checkbox' name='check_".$key."' id='check_".$key."' class='check' checked='checked' > ";
echo $topic."</a></label>";
echo "</li>";
}
?>
<?php foreach ($arrTopic as $key=>$topic): ?>
<li class='nav-item'>
<label>
<a class='nav-link'><?=$arrIcon[$key]?>
<input type='checkbox' name='check_".$key."' id='check_".$key."' class='check' checked='checked'>
<?=$topic?></a></label>
</li>
<?php endforeach; ?>
</ul>
</div>
</nav>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-1">
<?php endif; ?>
<main role="main" class="<?= ($boolSidebar)?"col-md-9 col-lg-10":"col-md-12 col-lg-12"?> ml-sm-auto px-1">
<div id="mapid"></div>
</main>
</div>
<?php if ($boolSidebar) echo "</div>"; ?>
<!-- row -->
</div>
<!-- container-fluid -->

View File

@ -51,7 +51,10 @@
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?> <?=$strDistrictTitle?></a>
<?php if (!$boolSidebar): ?>
<a href="start.php"><img class="logo_navbar" src="<?=$strLogo?>" alt="Logo"></a>
<?php endif; ?>
<a class="navbar-brand" href="#"><?= $strTitle ?> &raquo; <?=$strDistrictTitle?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

View File

@ -129,7 +129,7 @@ exit();
<input type="checkbox" id="userinfo" name="userinfo" <?= ($boolUserinfo) ? "checked=\"checked\"" :"" ?> >
<label for="userinfo">Nutzerinformation (Alter/Verkehrsmittel)</label>
<br>
<label class="leftlabel">Uplaod-Pfad:</label>
<label class="leftlabel">Upload-Pfad:</label>
<input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$strImagePath?>">
</div>
</div>