Compare commits

..

19 Commits

Author SHA1 Message Date
Walter Hupfeld
f4a8cef3f8 readme 2024-03-11 13:01:11 +01:00
Walter Hupfeld
34af6b6f75 fixes 2024-03-11 12:55:17 +01:00
Walter Hupfeld
824aa44fe2 District in admin list 2024-02-22 18:31:48 +01:00
Walter Hupfeld
bb53850c3e lastlogin 2024-02-22 17:18:18 +01:00
Walter Hupfeld
7c658e28f9 role 2024-02-22 17:07:36 +01:00
Walter Hupfeld
c2f8c93ef3 adfc color, start 2024-02-22 16:53:10 +01:00
Walter Hupfeld
8b6632d36f fix and layout 2024-02-22 16:34:43 +01:00
Walter Hupfeld
f8b8feee5b district select 2024-02-22 14:30:28 +01:00
Walter Hupfeld
f695c98fc3 fix 2024-02-22 12:01:59 +01:00
Walter Hupfeld
29496004dc fix 2024-02-22 10:36:46 +01:00
Walter Hupfeld
0a7db03af1 unkown district 2024-02-22 10:33:50 +01:00
Walter Hupfeld
c1c4151300 Admin User 2024-02-21 19:42:20 +01:00
Walter Hupfeld
11575edc75 fixes 2024-02-21 17:31:41 +01:00
Walter Hupfeld
1f44c21d69 disctrict 2024-02-21 14:31:28 +01:00
Walter Hupfeld
d918e97203 debug 2024-02-21 12:09:20 +01:00
Walter Hupfeld
1fec7c7710 session 2024-02-21 11:35:21 +01:00
Walter Hupfeld
b8671a54a8 fixes 2024-02-21 10:29:10 +01:00
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
29 changed files with 263 additions and 202 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

@@ -23,15 +23,23 @@ Folgende Funktionalitäten können an- bzw. abgeschaltet werden:
* Hochladen von Bildern (erlaubt jpg/gif/png) * Hochladen von Bildern (erlaubt jpg/gif/png)
* Kommentare * Kommentare
### Karten
Als Tile-Server für die Karten wird Mapbox (https://mapbox.com) verwendet. Hierfür ist eine Api-Key notwendig. Bis zu 200.000 Tile können pro Monate kostenlos benutzt werden.
### Reverse Georeferenzierung ### Reverse Georeferenzierung
Aus den übermittelten Geodaten wird die Adresse ermittelt. Dazu wird der Dienst https://locationiq.com verwendet. Die Adressen werden nur im Backend angezeigt, um die Auswertung der Daten zu erleichtern. Aus den übermittelten Geodaten wird die Adresse ermittelt. Dazu wird der Dienst https://locationiq.com verwendet. Die Adressen werden nur im Backend angezeigt, um die Auswertung der Daten zu erleichtern.
Für locationiq.com muss ein Api-Key beantragt werden. Dieser ist in der Datei /config.db.php einzutragen. Für locationiq.com muss ein Api-Key beantragt werden. Dieser ist in der Datei /config.db.php einzutragen.
--- ---
## Versionen ## Versionen
### Version 3.0
* Erweiterung auf NRW-Kreise und kreisfreie Städte
### Version 2.2 ### Version 2.2
* Behandlung der Eingaben mit Zeilenumbruch, Anführungszeichen und Hochkommas * Behandlung der Eingaben mit Zeilenumbruch, Anführungszeichen und Hochkommas

View File

@@ -1,4 +1,6 @@
<?php <?php
exit();
// ist veraltet, muss noch angepasst werden.
session_start(); session_start();
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ; $strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
$boolLogin = (!empty($strLoginName)); $boolLogin = (!empty($strLoginName));
@@ -7,8 +9,6 @@
} }
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
const DB_FILENAME = "../db/locations.db";
$db = new SQLite3(DB_FILENAME);
$strSQL="ALTER TABLE location ADD COLUMN defect INTEGER"; $strSQL="ALTER TABLE location ADD COLUMN defect INTEGER";
$db->exec($strSQL); $db->exec($strSQL);
@@ -21,4 +21,11 @@ $db->exec("CREATE TABLE IF NOT EXISTS user(
created_at TEXT DEFAULT CURRENT_TIMESTAMP created_at TEXT DEFAULT CURRENT_TIMESTAMP
)"); )");
header("Location: configuration.php"); header("Location: configuration.php");
INSERT INTO user (username, passwordhash, district)
SELECT district, "$2y$10$W9CE8IOOfnfi3XTMEVByZeDIrZo1VPxCHz2CfCe.sOH87V/AdaUG2", district
FROM district;

View File

@@ -6,7 +6,13 @@
header("Location: login.php"); header("Location: login.php");
} }
$dbFilename = "../db/locations.db"; if (isset($_SESSION['superadmin'])) {
$boolSuperAdmin = $_SESSION['superadmin']==true;
} else {
$boolSuperAdmin=false;
}
require_once("../config.php"); require_once("../config.php");
$boolError=false; $boolError=false;
?> ?>
@@ -72,7 +78,7 @@
<div class="row"> <div class="row">
<div class="col-md-7 col-lg-7"> <div class="col-md-7 col-lg-7">
<?php if ($boolSuperAdmin): ?>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3>Konfiguration</h3> <h3>Konfiguration</h3>
@@ -87,7 +93,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?>">
@@ -128,7 +136,26 @@
<input type="hidden" name="csrf" value="<?=$_SESSION['csrf_token']?>"> <input type="hidden" name="csrf" value="<?=$_SESSION['csrf_token']?>">
<input type="submit" class="btn btn-primary" value="Konfiguration ändern"> <input type="submit" class="btn btn-primary" value="Konfiguration ändern">
</form> </form>
<br><br><br> <?php endif; ?>
<br><br><br>
<h2>Auswahl Kreise und kreisfreie Städte</h2>
<form method="post" id="districtform" action="district_chk.php">
<?php
$strSQL="select * from district order by district";
$result = $db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$strChecked= ($row['active']==1) ? "checked='checked'" : "";
$strValue=$row['active'];
$strDistrict=$row['district'];
echo "<input type='checkbox' $strChecked id='$strDistrict' name='$strDistrict' value='$strValue'> ";
echo "<label for='$strDistrict'>".$row['title']."</label><br>\n";
}
?>
<br>
<input type="hidden" name="csrf" value="<?=$_SESSION['csrf_token']?>">
<input type="submit" class="btn btn-primary" value="Auswahl ändern">
</form>
</div> </div>
</div> <!-- row --> </div> <!-- row -->
</div> </div>

View File

@@ -5,7 +5,6 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
$dbFilename="../db/locations.db";
require("../config.php"); require("../config.php");
if($_POST['csrf'] !== $_SESSION['csrf_token']) { if($_POST['csrf'] !== $_SESSION['csrf_token']) {
@@ -16,6 +15,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 +43,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");

29
admin/district_chk.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
session_start();
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
$boolLogin = (!empty($strLoginName));
if (!$boolLogin) {
header("Location: login.php");
}
require("../config.php");
if($_POST['csrf'] !== $_SESSION['csrf_token']) {
die("Ungültiger Token");
}
$strSQL="SELECT * FROM district";
$result = $db->query($strSQL);
$numCounter=1;
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$strDistrict=$row['district'];
if (isset($_POST[$strDistrict])) {
$db->query("UPDATE `district` SET `active`= '1' WHERE `district`='$strDistrict'");
} else {
$db->query("UPDATE `district` SET `active`= '0' WHERE `district`='$strDistrict'");
}
}
header("Location: configuration.php");
//print_r($_POST);
?>

View File

@@ -15,8 +15,14 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
$strDistrict=$_SESSION['district'];
require("../config.db.php"); if (isset($_SESSION['superadmin'])) {
$boolSuperAdmin = $_SESSION['superadmin']==true;
} else {
$boolSuperAdmin=false;
}
$sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'";
require ("../config.php"); require ("../config.php");
// Set headers to make the browser download the results as a csv file // Set headers to make the browser download the results as a csv file
@@ -28,7 +34,9 @@
// Query // Query
$strSQL="SELECT l.id as lid,l.*,adr.* $strSQL="SELECT l.id as lid,l.*,adr.*
FROM location l LEFT JOIN address adr ON l.id=adr.loc_id ORDER BY created_at ASC"; FROM location l LEFT JOIN address adr ON l.id=adr.loc_id
WHERE $sqlDistrict
ORDER BY created_at ASC";
$query = $db->query($strSQL); $query = $db->query($strSQL);
// Fetch the first row // Fetch the first row

View File

@@ -15,6 +15,13 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
$strDistrict=$_SESSION['district'];
$sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'";
require ("../config.php"); require ("../config.php");
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -37,7 +44,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="#">Administration <?= $strTitle ?></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

@@ -14,7 +14,7 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
require_once("../config.db.php"); $strDistrict=$_SESSION['district'];
require ("../config.php"); require ("../config.php");
require ("../lib/geocoding.php"); require ("../lib/geocoding.php");
$boolRefresh = (isset($_GET['refresh']) & $_GET['refresh']==1); $boolRefresh = (isset($_GET['refresh']) & $_GET['refresh']==1);

View File

@@ -6,6 +6,7 @@
* 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
* zuletzte bearbeitet: 21.02.2024
******************************** */ ******************************** */
@@ -15,19 +16,31 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
$strDistrict=$_SESSION['district'];
$dbFilename = "../db/locations.db";
if (isset($_SESSION['superadmin'])) {
$boolSuperAdmin = $_SESSION['superadmin']==true;
} else {
$boolSuperAdmin=false;
}
include("../config.php"); include("../config.php");
$boolShowmap=false; $boolShowmap=false;
$sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'";
// Eintag löschen
if (isset($_GET['delid'])) { if (isset($_GET['delid'])) {
if($_GET['csrf'] !== $_SESSION['csrf_token']) { if($_GET['csrf'] !== $_SESSION['csrf_token']) {
die("Ungültiger Token"); die("Ungültiger Token");
} }
$numDelete = (int)$_GET['delid']; $numDelete = (int)$_GET['delid'];
$stmt = $db->prepare("DELETE FROM location WHERE id = :id");
$stmt = $db->prepare("DELETE FROM location WHERE id = :id AND district=:district");
$stmt->bindValue(":id",$numDelete); $stmt->bindValue(":id",$numDelete);
$stmt->bindValue(":district",$strDistrict);
$stmt->execute(); $stmt->execute();
$stmt = $db->prepare("DELETE FROM comment WHERE loc_id= :loc_id"); $stmt = $db->prepare("DELETE FROM comment WHERE loc_id= :loc_id");
@@ -47,7 +60,8 @@
$stmt->bindValue(":loc_id",$numDelete); $stmt->bindValue(":loc_id",$numDelete);
$stmt->execute(); $stmt->execute();
} }
// Kommentar löschen
if (isset($_GET['delcid'])) { if (isset($_GET['delcid'])) {
if($_GET['csrf'] !== $_SESSION['csrf_token']) { if($_GET['csrf'] !== $_SESSION['csrf_token']) {
die("Ungültiger Token"); die("Ungültiger Token");
@@ -58,7 +72,7 @@
$stmt->execute(); $stmt->execute();
} }
// Bild löschen
if (isset($_GET['delfid'])) { if (isset($_GET['delfid'])) {
if($_GET['csrf'] !== $_SESSION['csrf_token']) { if($_GET['csrf'] !== $_SESSION['csrf_token']) {
die("Ungültiger Token"); die("Ungültiger Token");
@@ -78,7 +92,8 @@
$stmt->execute(); $stmt->execute();
} }
// Karte zeigen
if (isset($_GET['showmap'])) { if (isset($_GET['showmap'])) {
$numShowmap=(int)$_GET['showmap']; $numShowmap=(int)$_GET['showmap'];
$boolShowmap=$numShowmap==1; $boolShowmap=$numShowmap==1;
@@ -126,7 +141,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>
@@ -163,7 +178,9 @@
<div class="container-fluid" style="margin-top:5em;"> <div class="container-fluid" style="margin-top:5em;">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr><th>id</th><th>Username</th> <tr><th>id</th>
<?= ($boolSuperAdmin) ? "<th>Kreis</th>" : "" ?>
<th>Username</th>
<?= ($boolUserinfo) ? "<th>Alter</th><th>Transport</th>" : "" ?> <?= ($boolUserinfo) ? "<th>Alter</th><th>Transport</th>" : "" ?>
<th>Topic</th> <th>Topic</th>
<th>Beschreibung</th> <th>Beschreibung</th>
@@ -181,12 +198,16 @@
<?php <?php
$strScript=""; $strScript="";
//$strSQL="SELECT * FROM location ORDER BY created_at DESC"; //$strSQL="SELECT * FROM location ORDER BY created_at DESC";
$strSQL="SELECT l.id as lid,l.*,adr.* FROM location l LEFT JOIN address adr ON l.id=adr.loc_id ORDER BY created_at ASC"; $strSQL="SELECT l.id as lid,l.*,adr.*
FROM location l LEFT JOIN address adr ON l.id=adr.loc_id
WHERE $sqlDistrict
ORDER BY created_at ASC";
$result = $db->query($strSQL); $result = $db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$id = $row['lid']; $id = $row['lid'];
echo "<tr>"; echo "<tr>";
echo "<td>".$id."</td>"; echo "<td>".$id."</td>";
echo ($boolSuperAdmin) ? "<td>".$row['district']."</td>" : "";
echo "<td>". stripslashes($row['username']) ."</td>"; echo "<td>". stripslashes($row['username']) ."</td>";
echo ($boolUserinfo) ? "<td>".$row['age']."</td><td>".$row['transport']."</td>" : ""; echo ($boolUserinfo) ? "<td>".$row['age']."</td><td>".$row['transport']."</td>" : "";
echo "<td>".$arrIcon[$row['topic']]." ".$arrTopic[$row['topic']]."</td>"; echo "<td>".$arrIcon[$row['topic']]." ".$arrTopic[$row['topic']]."</td>";

View File

@@ -6,11 +6,17 @@
* 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();
$dbFilename = "../db/locations.db"; if (isset($_SESSION['district'])) {
$strDistrict=$_SESSION['district'];
}
else {
$strDistrict="";
}
require_once("../config.php"); require_once("../config.php");
$boolLogin=true; $boolLogin=true;
@@ -18,13 +24,15 @@ $boolLogin=true;
if (isset($_POST['login']) && isset($_POST['password'])) { if (isset($_POST['login']) && isset($_POST['password'])) {
$strUser = trim($_POST['login']); $strUser = trim($_POST['login']);
$strPassword = trim($_POST['password']); $strPassword = trim($_POST['password']);
$strSQL = "SELECT username,passwordhash FROM user WHERE username='$strUser'"; $strSQL = "SELECT username,passwordhash,district,role FROM user WHERE username='$strUser'";
$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'])) { $boolOk = $strDistrict==$row['district'] || $row['role']=="admin";
session_start(); if (password_verify($strPassword,$row['passwordhash']) && $boolOk) {
$_SESSION['user']=$strUser; $_SESSION['user']=$strUser;
$_SESSION['csrf_token'] = uniqid('', true); $_SESSION['csrf_token'] = uniqid('', true);
$_SESSION['superadmin'] = $row['role']=="admin";
$db->query("UPDATE `user` SET `lastlogin`= NOW() WHERE `username`='$strUser'");
header ("Location: index.php"); header ("Location: index.php");
} else { } else {
$boolLogin=false; $boolLogin=false;
@@ -34,8 +42,6 @@ $boolLogin=true;
$boolLogin=false; $boolLogin=false;
} }
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@@ -51,7 +57,7 @@ $boolLogin=true;
<!-- 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="#">ADFC Meldeportal</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>
@@ -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>
@@ -75,7 +84,6 @@ $boolLogin=true;
</div> <br> </div> <br>
<?php endif; ?> <?php endif; ?>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h2>Login</h2> <h2>Login</h2>
@@ -89,6 +97,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>
@@ -97,12 +106,9 @@ $boolLogin=true;
</div> </div>
</div> </div>
</div> </div>
<div style="margin-top:5em;">
<div style="margin-top:5em;"> <a class="btn btn-primary text-white" href="../index.php?ref=1">zurück</a>
<a class="btn btn-primary text-white" href="../index.php?ref=1">zurück</a> </div>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,5 +1,11 @@
<?php <?php
session_start(); session_start();
if (isset($_SESSION['district'])) {
$strDistrict=$_SESSION['district'];
}
session_destroy(); session_destroy();
session_start();
$_SESSION['district']=$strDistrict;
header ("Location: ../index.php"); header ("Location: ../index.php");

View File

@@ -6,27 +6,16 @@
if (!$boolLogin) { if (!$boolLogin) {
header("Location: login.php"); header("Location: login.php");
} }
$strDistrict=$_SESSION['district'];
$dbFilename = "../db/locations.db"; if (isset($_SESSION['superadmin'])) {
$boolSuperAdmin = $_SESSION['superadmin']==true;
} else {
$boolSuperAdmin=false;
}
include("../config.php"); include("../config.php");
$sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'";
$arrTopic = array (
1 => "Fußverkehr",
2 => "Radverkehr",
3 => "Bus und Bahn",
4 => "Pkw-Verkehr",
5 => "Lkw-Verkehr"
);
$arrIcon = array (
1 => "<i class='fa fa-male'></i>",
2 => "<i class='fa fa-bicycle'></i>",
3 => "<i class='fa fa-train'></i>",
4 => "<i class='fa fa-car'></i>",
5 => "<i class='fa fa-truck'></i>"
);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@@ -50,12 +39,11 @@
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr><th>id</th><th>Username</th> <tr><th>id</th>
<th>Username</th>
<?= ($boolUserinfo) ? "<th>Alter</th><th>Transport</th>" : ""; ?> <?= ($boolUserinfo) ? "<th>Alter</th><th>Transport</th>" : ""; ?>
<th>Topic</th> <th>Topic</th>
<th>Beschreibung</th> <th>Beschreibung</th>
@@ -70,7 +58,10 @@
<?php <?php
$strScript=""; $strScript="";
$strSQL="SELECT l.id as lid,l.*,adr.* FROM location l LEFT JOIN address adr ON l.id=adr.loc_id ORDER BY city,postcode,suburb,hamlet,road ASC"; $strSQL="SELECT l.id as lid,l.*,adr.*
FROM location l LEFT JOIN address adr ON l.id=adr.loc_id
WHERE $sqlDistrict
ORDER BY city,postcode,suburb,hamlet,road ASC";
$result = $db->query($strSQL); $result = $db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$id = $row['lid']; $id = $row['lid'];
@@ -114,7 +105,6 @@
$strScript.="var mymap_".$id." = L.map(map_".$id.").setView([".$row['lat'].", ".$row['lng']."], 16);\n"; $strScript.="var mymap_".$id." = L.map(map_".$id.").setView([".$row['lat'].", ".$row['lng']."], 16);\n";
$strScript.="L.tileLayer(url, {maxZoom: 18,minZoom:12,attribution: attribution,id: 'mapbox/streets-v11',tileSize: 512,zoomOffset: -1}).addTo(mymap_".$id.")\n"; $strScript.="L.tileLayer(url, {maxZoom: 18,minZoom:12,attribution: attribution,id: 'mapbox/streets-v11',tileSize: 512,zoomOffset: -1}).addTo(mymap_".$id.")\n";
$strScript.="L.marker([".$row['lat'].", ".$row['lng']."], { icon: infoMarker } ).addTo(mymap_".$id.")\n\n"; $strScript.="L.marker([".$row['lat'].", ".$row['lng']."], { icon: infoMarker } ).addTo(mymap_".$id.")\n\n";
} }
?> ?>
</tbody> </tbody>
@@ -122,17 +112,15 @@
<a class="btn btn-primary" href="../index.php?ref=1">zurück</a> <a class="btn btn-primary" href="../index.php?ref=1">zurück</a>
</div> </div>
</body> </body>
<script> <script>
$( document ).ready(function() { $( document ).ready(function() {
var url = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?=$mapbox_key?>'; var url = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=<?=$mapbox_key?>';
var attribution = 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' + var attribution = 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>'; 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';
var infoMarker = L.AwesomeMarkers.icon({icon: 'info', prefix: 'fa', markerColor: 'orange'}); var infoMarker = L.AwesomeMarkers.icon({icon: 'info', prefix: 'fa', markerColor: 'orange'});
<?= $strScript ?> <?= $strScript ?>

View File

@@ -1,5 +1,5 @@
<?php <?php
$dbFilename="../db/locations.db";
require ("../config.php"); require ("../config.php");
if ($boolComment){ if ($boolComment){

View File

@@ -1,5 +1,5 @@
<?php <?php
$dbFilename="../db/locations.db";
require_once("../config.php"); require_once("../config.php");
$mode = trim($_POST['mode']); $mode = trim($_POST['mode']);

View File

@@ -1,6 +1,5 @@
<?php <?php
$dbFilename="../db/locations.db";
require_once("../config.php"); require_once("../config.php");
require_once("../lib/functions.php"); require_once("../lib/functions.php");

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
@@ -82,7 +72,10 @@ $result= $db->prepare("SELECT count(*) FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict); $result->bindParam(":district",$strDistrict);
$result->execute(); $result->execute();
if ($row=$result->fetch(PDO::FETCH_NUM)) { if ($row=$result->fetch(PDO::FETCH_NUM)) {
if ($row[0]==0) $strDistrict=""; //default setzten if ($row[0]==0) {
$strDistrict="unkown"; //default setzten
$strDistrictTitle="Unbekannt";
}
} }
// Spezifische Konfiguration für Districtt // Spezifische Konfiguration für Districtt

View File

@@ -92,4 +92,9 @@ i.wa {
left: 50%; left: 50%;
z-index: 1000; z-index: 1000;
display:none; display:none;
} }
.jumbotron {
background-color:orange;
}
a, a:active, a:visited, a:active {color:orange;}

View File

@@ -1,6 +1,9 @@
<?php <?php
session_start(); session_start();
require ("config.php") if (!isset($_SESSION['district'])) { header("Location: start.php");}
$strDistrict=$_SESSION['district'];
require("config.php");
if ($strDistict=="unkown") { header("Location: start.php");}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@@ -18,7 +21,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,29 +1,29 @@
version: '3' version: '3'
services: services:
dev-unfallkarte: dev-ideenmelder:
image: php81:v1 image: php81:v1
container_name: dev-unfallkarte container_name: dev-ideenmelder
volumes: volumes:
- ./:/var/www/html - ./:/var/www/html
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.dev-unfallkarte.entrypoints=https" - "traefik.http.routers.dev-ideenmelder.entrypoints=https"
- "traefik.http.routers.dev-unfallkarte.rule=Host(`unfallkarte.hpadm.de`)" - "traefik.http.routers.dev-ideenmelder.rule=Host(`nrw-ideenmelder.hpadm.de`)"
- "traefik.http.routers.dev-unfallkarte.tls=true" - "traefik.http.routers.dev-ideenmelder.tls=true"
- "traefik.http.routers.dev-unfallkarte.tls.certresolver=http" - "traefik.http.routers.dev-ideenmelder.tls.certresolver=http"
- "traefik.http.routers.dev-unfallkarte.middlewares=default@file" - "traefik.http.routers.dev-ideenmelder.middlewares=default@file"
- "traefik.http.routers.dev-unfallkarte.service=dev-unfallkarte" - "traefik.http.routers.dev-ideenmelder.service=dev-ideenmelder"
- "traefik.http.services.dev-unfallkarte.loadbalancer.server.port=80" - "traefik.http.services.dev-ideenmelder.loadbalancer.server.port=80"
- "traefik.docker.network=proxy" - "traefik.docker.network=proxy"
networks: networks:
- default - default
- proxy - proxy
restart: always restart: always
dev-unfallkarte-db: dev-ideenmelder-db:
image: mariadb image: mariadb
container_name: dev-unfallkarte-db container_name: dev-ideenmelder-db
restart: unless-stopped restart: unless-stopped
environment: environment:
- MYSQL_ROOT_PASSWORD=geheim #SQL root Passwort eingeben - MYSQL_ROOT_PASSWORD=geheim #SQL root Passwort eingeben

View File

@@ -1,6 +1,9 @@
<?php <?php
session_start(); session_start();
require_once("config.php"); if (!isset($_SESSION['district'])) { header("Location: start.php");}
$strDistrict=$_SESSION['district'];
require("config.php");
if ($strDistict=="unkown") { header("Location: start.php");}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@@ -18,7 +21,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,5 @@
<?php <?php
/*******************************
/** *****************************
* Ideenmelder * Ideenmelder
* Autor: Walter Hupfeld, Hamm * Autor: Walter Hupfeld, Hamm
* E-Mail: info@hupfeld-software.de * E-Mail: info@hupfeld-software.de
@@ -8,11 +7,6 @@
* Datum: 16.02.2024 * Datum: 16.02.2024
******************************** */ ******************************** */
/*
if (!file_exists("db/locations.db")) {
header("Location: setup.php");
}
*/
// Starte die Session // Starte die Session
session_start(); session_start();
if (isset($_GET['d'])) { if (isset($_GET['d'])) {
@@ -24,8 +18,8 @@
else { else {
header("Location: start.php"); header("Location: start.php");
} }
require("config.php");
require("config.php"); if ($strDistrict=="unkown") { header("Location: start.php");}
require_once("lib/functions.php"); require_once("lib/functions.php");
$ref=(isset($_GET['ref']) && ($_GET['ref']==1)); $ref=(isset($_GET['ref']) && ($_GET['ref']==1));
@@ -33,17 +27,16 @@
$strIntro ="<h4>".$strTitle."</h4>"; $strIntro ="<h4>".$strTitle."</h4>";
$strIntro .= nl2br2($strIntroText); $strIntro .= nl2br2($strIntroText);
$result= $db->prepare("SELECT loc.*,f.filename
$strSQL="SELECT loc.*,f.filename FROM location loc LEFT JOIN files f ON loc.id=f.loc_id
FROM location loc LEFT JOIN files f ON loc.id=f.loc_id WHERE loc.district=:district");
WHERE loc.district='$strDistrict'"; $result->bindParam(":district",$strDistrict);
$result->execute();
/* Für die Auswertung nur bestimmte Kategorien anzeigen /* Für die Auswertung nur bestimmte Kategorien anzeigen
$numDefect="(6,8,21)"; $numDefect="(6,8,21)";
$strSQL="SELECT loc.*,f.filename FROM location loc LEFT JOIN files f ON loc.id=f.loc_id WHERE defect in ".$numDefect; $strSQL="SELECT loc.*,f.filename FROM location loc LEFT JOIN files f ON loc.id=f.loc_id WHERE defect in ".$numDefect;
*/ */
$result = $db->query($strSQL);
$arrMarker = array(); $arrMarker = array();
$arrDescription = array(); $arrDescription = array();
$id=0; $id=0;
@@ -91,15 +84,15 @@
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/lightbox.css" /> <link rel="stylesheet" href="css/lightbox.css" />
<title>Ideenmelder</title> <title><?=$strTitle?></title>
</head> </head>
<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>
<div class="collapse navbar-collapse" id="navbars"> <div class="collapse navbar-collapse" id="navbars">
@@ -111,6 +104,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 +114,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</form> </form>
<?php endif; ?>
</ul> </ul>
@@ -132,7 +127,7 @@
<a class="nav-link" href="datenschutz.php">Datenschutzerklärung</a> <a class="nav-link" href="datenschutz.php">Datenschutzerklärung</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="admin/login.php?d=".$strDistrict>Login</a> <a class="nav-link" href="admin/login.php">Login</a>
</li> </li>
</ul> </ul>
</div> </div>
@@ -142,10 +137,9 @@
<div class="container-fluid" style="margin-top: 4em;"> <div class="container-fluid" style="margin-top: 4em;">
<div class="row"> <div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar"> <nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky"> <div class="sidebar-sticky">
<img class="logo" src="<?=$strLogo?>" alt="Logo" > <a href="start.php"><img class="logo" src="<?=$strLogo?>" alt="Logo" ></a>
<ul class="nav flex-column"> <ul class="nav flex-column">
<?php <?php
foreach ($arrTopic as $key=>$topic) { foreach ($arrTopic as $key=>$topic) {
@@ -177,8 +171,6 @@
?> ?>
<div id="loader"><img src="css/images/ajax-loader.gif"></div> <div id="loader"><img src="css/images/ajax-loader.gif"></div>
<script> <script>
// Map ---------------------------------------------------------------------- // Map ----------------------------------------------------------------------
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>); var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
@@ -489,7 +481,6 @@
} }
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -109,7 +109,7 @@ function fillAddressTable($db,$limit=20) {
} }
$strTable .= "</tr>"; $strTable .= "</tr>";
sleep(0.5); //api restriction sleep(1); //api restriction
writeAddress($db,$id,$data); writeAddress($db,$id,$data);
} }
} }

View File

@@ -8,19 +8,12 @@
* Datum: 18.05.2021 * Datum: 18.05.2021
******************************** */ ******************************** */
session_start(); session_start();
if (isset($_GET['d'])) { if (!isset($_SESSION['district'])) { header("Location: start.php");}
$strDistrict=$_GET['d']; $strDistrict=$_SESSION['district'];
$_SESSION['district'] = $strDistrict; require("config.php");
} else if (isset($_SESSION['district'])) if ($strDistrict=="unkown") { header("Location: start.php");}
{ ?>
$strDistrict=$_SESSION['district'];
}
else {
header("Location: start.php");
}
echo $strDistrict;
require("config.php");
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
@@ -65,7 +58,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 +70,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 +80,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</form> </form>
<?php endif; ?>
</ul> </ul>
</ul> </ul>

View File

@@ -1,5 +1,5 @@
FROM php:8.1-apache FROM php:8.1-apache
RUN apt-get update && docker-php-ext-install pdo_mysql calendar mysqli RUN apt-get update && docker-php-ext-install pdo_mysql calendar mysqli zip
RUN a2enmod rewrite headers RUN a2enmod rewrite headers

View File

@@ -8,18 +8,12 @@
* Datum: 18.05.2021 * Datum: 18.05.2021
******************************** */ ******************************** */
exit();
$dbFilename = "db/locations.db"; // noch nicht vollständig angepasst
require("config.db.php");
$boolError=false; $boolError=false;
if (file_exists("db/locations.php")) {
die ("Datenbank existiert bereits.");
}
?> ?>
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@@ -29,10 +23,9 @@
<title>Setup</title> <title>Setup</title>
<style> <style>
.leftlabel { width: 10em;} .leftlabel { width: 10em;}
input[type="text"] { width: 18em;} input[type="text"] { width: 18em;}
input.wide {width: 24em;} input.wide {width: 24em;}
</style> </style>
</head> </head>
<body> <body>
@@ -79,9 +72,9 @@
* Datenbank anlegen * Datenbank anlegen
* *
************************************************** */ ************************************************** */
$boolError=true;
echo "Datenbank anlegen: "; echo "Datenbank anlegen: ";
if (!$boolError && !file_exists("db/locations.db")) { if (!$boolError) {
require("admin/create_database.php"); require("admin/create_database.php");
echo "Datenbank angelegt"; echo "Datenbank angelegt";
} else { } else {
@@ -108,7 +101,7 @@ require("config.php");
</div> </div>
</div> </div>
<br> <br>
<!--
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3>Dateneingabe aktivieren</h3> <h3>Dateneingabe aktivieren</h3>
@@ -119,7 +112,7 @@ require("config.php");
</div> </div>
</div> </div>
<br> <br>
-->
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3>Konfiguration</h3> <h3>Konfiguration</h3>
@@ -142,35 +135,6 @@ require("config.php");
</div> </div>
<br> <br>
<div class="card">
<div class="card-header">
<h3>Karteninfo</h3>
</div>
<div class="card-body">
<h4>Stadt oder Kreis</h4>
<label class="leftlabel">Stadt/Kreis: </label>
<input type="text" name="district" id="district" value="<?=$strStadt?>" required >
<h4>Kartenzentrum</h4>
<div class="small">Hier liegt das Zentrum der Karte und es erscheint der Info-Marker.</div>
<label class="leftlabel">Latitude:</label><input type="text" name="lat" id="lat" value="<?=$numInfoLat?>" required><br>
<label class="leftlabel">Longitude:</label><input type="text" name="lng" id="lng" value="<?=$numInfoLng?>" required><br>
<div class="small">Zoom-Faktor beim Start der Karte.</div>
<label class="leftlabel">Startzoom:</label><input type="text" name="zoom" id="zoom" value="<?=$numZoom?>" required>
<h4>GeoJson</h4>
<p>Die Datei kann man von folgender Adresse laden und ins Vezeichnis /geojson kopieren:
<a href="https://public.opendatasoft.com/explore/dataset/landkreise-in-germany/export/">public.opendatasoft.com</a>
</p>
<label class="leftlabel">GeoJson-Datei: </label><input type="text" name="geojson" id="geojson" value="<?=$fileGeojson?>" required>
</div>
</div>
<br>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3>Anbieterinformation</h3> <h3>Anbieterinformation</h3>
@@ -225,5 +189,4 @@ require("config.php");
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -8,7 +8,7 @@
* Datum: 18.05.2021 * Datum: 18.05.2021
******************************** */ ******************************** */
exit();
require("config.db.php"); require("config.db.php");
$db->query("TRUNCATE config"); $db->query("TRUNCATE config");

View File

@@ -14,17 +14,8 @@
<link rel="stylesheet" href="css/bootstrap.min.css" /> <link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="vendor/DataTables/datatable.min.css">
<link rel="stylesheet" href="vendor/DataTables/DataTables-1.10.21/css/dataTables.bootstrap4.min.css">
<title><?=$strTitle?></title> <title><?=$strTitle?></title>
<script src="js/jquery.min.js"></script> <script src="js/jquery.min.js"></script>
<script src="vendor/DataTables/datatables.js"></script>
<script src="vendor/DataTables/DataTables-1.10.21/js/dataTables.bootstrap4.min.js"></script>
<style> <style>
</style> </style>
@@ -47,13 +38,22 @@
</form> </form>
</div> </div>
<p style="clear:both";> <p style="clear:both";>
<h3>Kreise und kreisfreie Städte</h3> <h3>Teilnehmende Kreise und kreisfreie Städte</h3>
<div>
<div class="row">
<div class="col-4">
<?php <?php
$i=0;
foreach ($arrDistrict as $key => $strTitle):?> foreach ($arrDistrict as $key => $strTitle):?>
<a href="<?php echo "./".$key ?>"><?=$strTitle?></a><br> <a href="<?php echo "./".$key ?>"><?=$strTitle?></a><br>
<?php endforeach; ?> <?php
$i++;
if ($i%20==0) echo "</div><div class='col-4'>";
endforeach; ?>
</div>
</div> </div>
<hr>
© ADFC NRW
</div> </div>
</body> </body>