districts
This commit is contained in:
26
liste.php
26
liste.php
@@ -9,9 +9,11 @@
|
||||
******************************** */
|
||||
|
||||
|
||||
if (!file_exists("config.php")) {
|
||||
if (!file_exists("config.db.php")) {
|
||||
header("Location: setup.php");
|
||||
}
|
||||
|
||||
$strDistrict = (isset($_GET['d'])) ? $_GET['d'] : "hamm";
|
||||
require("config.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -59,11 +61,21 @@
|
||||
<div class="collapse navbar-collapse" id="navbars">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?ref=1">Karte</a>
|
||||
<a class="nav-link" href="index.php?ref=1&d=<?=$strDistrict?>">Karte</a>
|
||||
</li>
|
||||
<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?d=<?=$strDistrict?>">Liste <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<!-- 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()">
|
||||
<?php foreach ($arrDistrict as $key => $strTitle):
|
||||
$strActive = ($strDistrict==$key) ? "selected=\"selected\"" : ""; ?>
|
||||
<option value="<?=$key?>" <?=$strActive?>><?=$strTitle?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</form>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
@@ -84,7 +96,7 @@
|
||||
|
||||
<div class="container-fluid main" style="max-width:1360px;">
|
||||
<p> </p>
|
||||
<h2>Liste der Einträge</h2>
|
||||
<h2>Liste der Einträge für <?=$strTitle?></h2>
|
||||
|
||||
<table id="list" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
@@ -102,9 +114,11 @@
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
require_once("config.php");
|
||||
|
||||
$strSQL="SELECT loc.*,f.filename FROM location loc LEFT JOIN files f ON loc.id=f.loc_id ORDER BY created_at DESC";
|
||||
$strSQL="SELECT loc.*,f.filename
|
||||
FROM location loc LEFT JOIN files f ON loc.id=f.loc_id
|
||||
WHERE district='$strDistrict'
|
||||
ORDER BY created_at DESC";
|
||||
$result = $db->query($strSQL);
|
||||
$numCounter=1;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
Reference in New Issue
Block a user