melder/config.php

175 lines
4.4 KiB
PHP
Raw Normal View History

2024-02-16 15:35:01 +01:00
<?php
/** *****************************
* Ideenmelder
* Autor: Walter Hupfeld, Hamm
* E-Mail: info@hupfeld-software.de
2024-03-11 16:12:39 +01:00
* Version: 3.0
2024-02-18 16:01:36 +01:00
* Datum: 18.02.2024
2024-03-11 16:12:39 +01:00
* zuletzt bearbeitet: 11.03.2024
2024-02-16 15:35:01 +01:00
******************************** */
2024-02-18 19:16:48 +01:00
require_once("config.db.php");
2024-02-16 15:35:01 +01:00
2024-02-18 19:16:48 +01:00
$strSQL = "select * from config";
$result = $db->query($strSQL);
2024-02-16 15:35:01 +01:00
2024-02-18 19:16:48 +01:00
// Allegemeine Konfiguration
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
switch ($row['key']) {
case "uploaddir" :
$uploaddir=$row['value'];
break;
case "title" :
$strTitle=$row['value'];
break;
case "logo":
$strLogo=$row['value'];
break;
case "contactEmail":
$contactEmail =$row['value'];
break;
case "introText":
$strIntroText =$row['value'];
break;
case "impressum":
$strImpressum =$row['value'];
break;
case "url":
$strUrl =$row['value'];
break;
case "UrlBez":
$strUrlBez =$row['value'];
break;
case "boolRating":
$boolRating = ($row['value']=="1");
break;
case "boolComment":
$boolComment = ($row['value']=="1");
break;
case "boolUpload":
$boolUpload = ($row['value']=="1");
break;
case "boolDefect":
$boolDefect = ($row['value']=="1");
break;
case "boolUserinfo":
$boolUserinfo = ($row['value']=="1");
break;
2024-02-21 07:55:02 +01:00
case "boolDistrictSelection":
$boolDistrictSelection = ($row['value']=="1");
break;
2024-02-18 19:16:48 +01:00
default: ;
//echo "Fehler bei ".$row['key'];
// Ende Lokalisierung
break;
2024-02-16 15:35:01 +01:00
}
2024-02-18 19:16:48 +01:00
}
2024-02-16 15:35:01 +01:00
2024-02-18 19:16:48 +01:00
// Falls der Parameter district fehlt => Hamm
$result= $db->prepare("SELECT count(*) FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
if ($row=$result->fetch(PDO::FETCH_NUM)) {
2024-02-21 11:35:21 +01:00
if ($row[0]==0) {
2024-02-22 10:33:50 +01:00
$strDistrict="unkown"; //default setzten
2024-02-21 11:35:21 +01:00
$strDistrictTitle="Unbekannt";
}
2024-02-18 19:16:48 +01:00
}
2024-02-18 13:37:18 +01:00
2024-02-18 19:46:30 +01:00
// Spezifische Konfiguration für Districtt
$result= $db->prepare("SELECT * FROM district WHERE district=:district");
$result->bindParam(":district",$strDistrict);
$result->execute();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
2024-02-18 13:37:18 +01:00
2024-02-18 19:46:30 +01:00
$boolActive = $row['active']==1;
$strDistrict = $row['district'];
$strDistrictTitle = $row['title'];
$strGeojson = $row['geojson'];
$numULAND=$row['ULAND'];
$numUREGBEZ=$row['UREGBEZ'];
$numUKREIS=$row['UKREIS'];
$numUGEMEINDE=$row['UGEMEINDE'];
$numInfoLat=$row['lat'];
$numInfoLng=$row['lng'];
$numZoom=$row['zoom'];
$strIntroText = ($boolActive) ? $strIntroText : "Dateneingabe nicht möglich";
$fileGeojson ="geojson/$strGeojson";
$strLocation = " AND ULAND=$numULAND AND UREGBEZ=$numUREGBEZ AND UKREIS=$numUKREIS ";
if ($numUGEMEINDE>0) {
$strLocation .= "AND UGEMEINDE=$numUGEMEINDE";
2024-02-18 13:37:18 +01:00
}
2024-02-18 19:46:30 +01:00
}
// Arrax mit allen Distrikten für Auswahl
$arrDisctrict = array ();
$strSQL = "SELECT district,title FROM district WHERE active=1 ORDER BY title ASC";
$result=$db->query($strSQL);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$arrDistrict[$row['district']]=$row['title'];
}
2024-02-16 15:35:01 +01:00
2024-02-18 16:01:36 +01:00
2024-02-16 15:35:01 +01:00
$arrTopic = array (
2 => "Radverkehr",
2024-03-11 16:12:39 +01:00
// 1 => "Fußverkehr",
// 3 => "Bus und Bahn",
2024-02-16 15:35:01 +01:00
// 4 => "Pkw-Verkehr",
// 5 => "Lkw-Verkehr"
);
$arrMarkerType = array (
1=>"pedestrianMarker",
2=>"bicycleMarker",
3=>"trainMarker",
4=>"carMarker",
5=>"truckMarker",
);
2024-02-18 19:46:30 +01:00
$arrIcon = array (
1 => "<i class='wa bg-info fa fa-male'></i>",
2 => "<i class='wa bg-success fa fa-bicycle'></i>",
3 => "<i class='wa bg-primary fa fa-bus'></i>",
4 => "<i class='wa bg-danger fa fa-car'></i>",
5 => "<i class='wa bg-warning fa fa-truck'></i>"
);
2024-02-16 15:35:01 +01:00
$arrAge = array (
1 => "keine Angabe",
2 => "bis 14 Jahre",
3 => "15-17 Jahre",
4 => "18-25 Jahre",
5 => "25-39 Jahre",
6 => "40-64 Jahre",
7 => "65 Jahre und älter",
);
$arrDefect = array (
2024-03-11 16:12:39 +01:00
0 => "Pfosten/Poller",
1 => "Schranke",
2 => "Umlaufsperre/Drängelgitter",
3 => "Laternenmast",
4 => "Litfaßsäule",
5 => "Stromverteilerkasten",
6 => "Sonstiges"
2024-02-16 15:35:01 +01:00
);
$arrTransport = array (
0 => "keine Angabe",
1 => "kein Auto",
2 => "Auto",
3 => "Motorroller/Motorrad",
4 => "Bus/Bahn",
5 => "Fahrrad",
6 => "Zu Fuß"
);