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/ /admin/shape/
/images/ /images/
config.db.php config.db.php
.DS_Store

View File

@ -87,7 +87,9 @@
<input type="checkbox" id="defect" name="defect" <?= ($boolDefect) ? "checked=\"checked\"" :"" ?> > <input type="checkbox" id="defect" name="defect" <?= ($boolDefect) ? "checked=\"checked\"" :"" ?> >
<label for="defect">Mängelkategrien einblenden</label><br> <label for="defect">Mängelkategrien einblenden</label><br>
<input type="checkbox" id="userinfo" name="userinfo" <?= ($boolUserinfo) ? "checked=\"checked\"" :"" ?> > <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> <br>
<label class="leftlabel">Uplaod-Pfad:</label> <label class="leftlabel">Uplaod-Pfad:</label>
<input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$uploaddir?>"> <input type="text" class="wide" name="uploaddir" id="uploaddir" value="<?=$uploaddir?>">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,15 @@
<?php <?php
session_start(); 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> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@ -18,7 +27,7 @@
<!-- Navbar --> <!-- Navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> <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"> <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> <span class="navbar-toggler-icon"></span>
</button> </button>

View File

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

View File

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