Compare commits
No commits in common. "5fd594a1033a7b0f64474ad557ab6f951d4b37a7" and "8ba6e6261020a9249e6af213cd68276fd4e1b054" have entirely different histories.
5fd594a103
...
8ba6e62610
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,4 +1,14 @@
|
|||||||
|
# ---> VisualStudioCode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
config.db.php
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
exit();
|
|
||||||
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
require("../config.db.php");
|
|
||||||
|
$db = new SQLite3($dbFilename);
|
||||||
|
|
||||||
$db->exec("CREATE TABLE IF NOT EXISTS location(
|
$db->exec("CREATE TABLE IF NOT EXISTS location(
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* 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 geändert: 18.02.2024
|
|
||||||
******************************** */
|
******************************** */
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
@ -15,8 +14,7 @@
|
|||||||
if (!$boolLogin) {
|
if (!$boolLogin) {
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
}
|
}
|
||||||
|
$dbFilename="../db/locations.db";
|
||||||
require("../config.db.php");
|
|
||||||
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
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* 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 geändert: 18.02.2024
|
|
||||||
******************************** */
|
******************************** */
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
@ -15,6 +14,7 @@
|
|||||||
if (!$boolLogin) {
|
if (!$boolLogin) {
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
}
|
}
|
||||||
|
$dbFilename="../db/locations.db";
|
||||||
require ("../config.php");
|
require ("../config.php");
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/** *****************************
|
|
||||||
* Ideenmelder
|
|
||||||
* Autor: Walter Hupfeld, Hamm
|
|
||||||
* E-Mail: info@hupfeld-software.de
|
|
||||||
* Version: 1.0
|
|
||||||
* Datum: 18.05.2021
|
|
||||||
* zuletzt geändert: 18.02.2024
|
|
||||||
*/
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
|
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
|
||||||
$boolLogin = (!empty($strLoginName));
|
$boolLogin = (!empty($strLoginName));
|
||||||
if (!$boolLogin) {
|
if (!$boolLogin) {
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
}
|
}
|
||||||
require_once("../config.db.php");
|
$dbFilename="../db/locations.db";
|
||||||
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);
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
$stmt = $db->prepare("SELECT * FROM files where loc_id = :loc_id");
|
$stmt = $db->prepare("SELECT * FROM files where loc_id = :loc_id");
|
||||||
$stmt->bindValue(":loc_id", $numDelete, PDO::PARAM_INT);
|
$stmt->bindValue(":loc_id", $numDelete, PDO::PARAM_INT);
|
||||||
|
$result = $stmt->execute();
|
||||||
|
|
||||||
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strFilename = $row['filename'];
|
$strFilename = $row['filename'];
|
||||||
@ -63,11 +64,10 @@
|
|||||||
if($_GET['csrf'] !== $_SESSION['csrf_token']) {
|
if($_GET['csrf'] !== $_SESSION['csrf_token']) {
|
||||||
die("Ungültiger Token");
|
die("Ungültiger Token");
|
||||||
}
|
}
|
||||||
|
|
||||||
$numDelete=(int)$_GET['delfid'];
|
$numDelete=(int)$_GET['delfid'];
|
||||||
$stmt = $db->prepare("SELECT * FROM files where id = :id");
|
$stmt = $db->prepare("SELECT * FROM files where id = :id");
|
||||||
$stmt->bindParam(':id', $id);
|
$stmt->bindValue(":id", $numDelete, SQLITE3_TEXT);
|
||||||
//$result = $stmt->execute();
|
$result = $stmt->execute();
|
||||||
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
|
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$strFilename = $row['filename'];
|
$strFilename = $row['filename'];
|
||||||
$strFilename = $uploaddir . $strFilename;
|
$strFilename = $uploaddir . $strFilename;
|
||||||
@ -76,7 +76,6 @@
|
|||||||
$stmt = $db->prepare("DELETE FROM files WHERE id= :id");
|
$stmt = $db->prepare("DELETE FROM files WHERE id= :id");
|
||||||
$stmt->bindValue(":id",$numDelete);
|
$stmt->bindValue(":id",$numDelete);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['showmap'])) {
|
if (isset($_GET['showmap'])) {
|
||||||
|
@ -7,8 +7,6 @@ $db_passwd = "g0r@w@";
|
|||||||
$db_name = "nrw_melder";
|
$db_name = "nrw_melder";
|
||||||
$cachetime = 0;
|
$cachetime = 0;
|
||||||
|
|
||||||
$location_key="8b0d633d90b501";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db = new PDO('mysql:host='.$db_server.';dbname='.$db_name.';charset=utf8mb4', $db_user, $db_passwd);
|
$db = new PDO('mysql:host='.$db_server.';dbname='.$db_name.';charset=utf8mb4', $db_user, $db_passwd);
|
||||||
} catch (PDOException $e) {echo "Fehler: ".$e->getMessage(); die();}
|
} catch (PDOException $e) {echo "Fehler: ".$e->getMessage(); die();}
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
<?
|
|
||||||
|
|
||||||
$db_server = "mariadb";
|
|
||||||
$db_user = "";
|
|
||||||
$db_passwd = "";
|
|
||||||
|
|
||||||
$db_name = "nrw_melder";
|
|
||||||
$cachetime = 0;
|
|
||||||
|
|
||||||
$location_key="";
|
|
||||||
|
|
||||||
try {
|
|
||||||
$db = new PDO('mysql:host='.$db_server.';dbname='.$db_name.';charset=utf8mb4', $db_user, $db_passwd);
|
|
||||||
} catch (PDOException $e) {echo "Fehler: ".$e->getMessage(); die();}
|
|
@ -7,15 +7,15 @@
|
|||||||
* Returns: data-array
|
* Returns: data-array
|
||||||
* ----------------------------------------------------- */
|
* ----------------------------------------------------- */
|
||||||
|
|
||||||
|
//$dbFilename = "../db/locations.db";
|
||||||
|
//$db = new SQLite3($dbFilename);
|
||||||
|
|
||||||
require("../config.db.php");
|
|
||||||
|
|
||||||
function getAddress($lat,$lng) {
|
function getAddress($lat,$lng) {
|
||||||
|
|
||||||
$key = $location_key;
|
$key="your-key-here";
|
||||||
$url="https://us1.locationiq.com/v1/reverse.php?key=".$key."&lat=".$lat."&lon=".$lng."&format=json";
|
$url="https://us1.locationiq.com/v1/reverse.php?key=".$key."&lat=".$lat."&lon=".$lng."&format=json";
|
||||||
|
|
||||||
|
|
||||||
$curl = curl_init($url);
|
$curl = curl_init($url);
|
||||||
|
|
||||||
curl_setopt_array($curl, array(
|
curl_setopt_array($curl, array(
|
||||||
@ -102,6 +102,7 @@ function fillAddressTable($db,$limit=20) {
|
|||||||
$lat=$row['lat'];
|
$lat=$row['lat'];
|
||||||
$lng=$row['lng'];
|
$lng=$row['lng'];
|
||||||
$data=getAddress($lat,$lng);
|
$data=getAddress($lat,$lng);
|
||||||
|
|
||||||
$strTable .= "<tr><td>$id</td><td>$lat</td><td>$lng</td>";
|
$strTable .= "<tr><td>$id</td><td>$lat</td><td>$lng</td>";
|
||||||
foreach ($arrKeys as $key) {
|
foreach ($arrKeys as $key) {
|
||||||
$strTable .= (isset($data[$key])) ? "<td>".$data[$key]."</td>" : "<td></td>";
|
$strTable .= (isset($data[$key])) ? "<td>".$data[$key]."</td>" : "<td></td>";
|
||||||
|
Loading…
Reference in New Issue
Block a user