Compare commits

...

2 Commits

Author SHA1 Message Date
Walter Hupfeld
b746e13d3a fix 2024-02-21 07:58:01 +01:00
Walter Hupfeld
183c570444 District Selection 2024-02-21 07:55:02 +01:00
11 changed files with 55 additions and 29 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
/admin/shape/
/images/
config.db.php
.DS_Store

View File

@ -87,7 +87,9 @@
<input type="checkbox" id="defect" name="defect" <?= ($boolDefect) ? "checked=\"checked\"" :"" ?> >
<label for="defect">Mängelkategrien einblenden</label><br>
<input type="checkbox" id="userinfo" name="userinfo" <?= ($boolUserinfo) ? "checked=\"checked\"" :"" ?> >
<label for="userinfo">Nutzerinformation (Alter/Verkehrsmittel)</label>
<label for="userinfo">Nutzerinformation (Alter/Verkehrsmittel)</label><br>
<input type="checkbox" id="districtSelection" name="districtSelection" <?= ($boolDistrictSelection) ? "checked=\"checked\"" :"" ?> >
<label for="districtSelection">Auswahl Kreise in Navigation</label>
<br>
<label class="leftlabel">Uplaod-Pfad:</label>
<input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$uploaddir?>">

View File

@ -16,6 +16,7 @@
$boolUpload = (isset($_POST['fileupload'])) ? "1" : "0";
$boolUserinfo = (isset($_POST['userinfo'])) ? "1" : "0";
$boolDefect = (isset($_POST['defect'])) ? "1" : "0";
$boolDistrictSelection = (isset($_POST['districtSelection'])) ? "1" : "0";
$strUploaddir = $_POST['uploaddir'];
@ -43,7 +44,7 @@
$db->query("UPDATE `config` SET `value`= '$boolUserinfo' WHERE `key`='boolUserinfo'");
$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`= '$boolDistrictSelection' WHERE `key`='boolDistrictSelection'");
header("Location: configuration.php");

View File

@ -15,8 +15,7 @@
if (!$boolLogin) {
header("Location: login.php");
}
$dbFilename = "../db/locations.db";
$strDistrict=$_SESSION['district'];
include("../config.php");
$boolShowmap=false;
@ -126,7 +125,7 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Administration NRW Meldeportal</a>
<a class="navbar-brand" href="#">Administration <?=$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>
</button>

View File

@ -6,11 +6,18 @@
* E-Mail: info@hupfeld-software.de
* Version: 1.0
* Datum: 18.05.2021
* zuletzt bearbeitet: 21.02.2024
******************************** */
// Starte die Session
session_start();
if (isset($_SESSION['district'])) {
$strDistrict=$_SESSION['district'];
}
else {
$strDistrict="";
}
$dbFilename = "../db/locations.db";
require_once("../config.php");
$boolLogin=true;
@ -22,7 +29,6 @@ $boolLogin=true;
$result = $db->query($strSQL);
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
if (password_verify($strPassword,$row['passwordhash'])) {
session_start();
$_SESSION['user']=$strUser;
$_SESSION['csrf_token'] = uniqid('', true);
header ("Location: index.php");
@ -60,6 +66,9 @@ $boolLogin=true;
<li class="nav-item">
<a class="nav-link" href="../index.php?ref=1">Karte</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../liste.php">Liste</a>
</li>
</ul>
</div>
</nav>
@ -89,6 +98,7 @@ $boolLogin=true;
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" class="form-control" id="password" placeholder="Passwort" required>
<input type="hidden" name="district" value="<?=$strDistrict?>">
</div>
<button type="submit" class="btn btn-primary">Absenden</button>
</form>

View File

@ -20,21 +20,9 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
case "uploaddir" :
$uploaddir=$row['value'];
break;
case "stadt" :
$strStadt=$row['value'];
break;
case "title" :
$strTitle=$row['value'];
break;
case "fileGeojson":
$fileGeojson=$row['value'];
break;
case "InfoLat":
$numInfoLat=$row['value'];
break;
case "InfoLng":
$numInfoLng=$row['value'];
break;
case "logo":
$strLogo=$row['value'];
break;
@ -68,7 +56,9 @@ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
case "boolUserinfo":
$boolUserinfo = ($row['value']=="1");
break;
case "boolDistrictSelection":
$boolDistrictSelection = ($row['value']=="1");
break;
default: ;
//echo "Fehler bei ".$row['key'];
// Ende Lokalisierung

View File

@ -1,6 +1,15 @@
<?php
session_start();
require ("config.php")
if (isset($_SESSION['district']))
{
$strDistrict=$_SESSION['district'];
}
else {
header("Location: start.php");
}
echo $strDistrict;
require("config.php");
?>
<!DOCTYPE html>
<html lang="de">
@ -18,7 +27,7 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?=$strTitle?></a>
<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>
</button>

View File

@ -1,6 +1,15 @@
<?php
session_start();
require_once("config.php");
session_start();
if (isset($_SESSION['district']))
{
$strDistrict=$_SESSION['district'];
}
else {
header("Location: start.php");
}
echo $strDistrict;
require("config.php");
?>
<!DOCTYPE html>
<html lang="de">
@ -18,7 +27,7 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?=$strTitle?></a>
<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>
</button>

View File

@ -98,8 +98,8 @@
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
<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>
</button>
<div class="collapse navbar-collapse" id="navbars">
@ -111,6 +111,7 @@
<li class="nav-item">
<a class="nav-link" href="liste.php">Liste</a>
</li>
<?php if ($boolDistrictSelection): ?>
<!-- District -->
<form method="GET" action="index.php">
<select name="d" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
@ -120,6 +121,7 @@
<?php endforeach; ?>
</select>
</form>
<?php endif; ?>
</ul>

View File

@ -65,7 +65,7 @@
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><?= $strTitle ?></a>
<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>
</button>
@ -77,7 +77,8 @@
<li class="nav-item active">
<a class="nav-link" href="liste.php">Liste <span class="sr-only">(current)</span></a>
</li>
<!-- District -->
<!-- District -->
<?php if ($boolDistrictSelection): ?>
<form method="GET" action="index.php">
<select name="d" style="float:left;margin-top:0.5em;margin-right:0.5em;" onchange="this.form.submit()">
<?php foreach ($arrDistrict as $key => $strMTitle):
@ -86,6 +87,7 @@
<?php endforeach; ?>
</select>
</form>
<?php endif; ?>
</ul>
</ul>