Compare commits
2 Commits
8ba6e62610
...
5fd594a103
Author | SHA1 | Date | |
---|---|---|---|
|
5fd594a103 | ||
|
175d82f911 |
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,14 +1,4 @@
|
||||
# ---> 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
|
||||
exit();
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$db = new SQLite3($dbFilename);
|
||||
require("../config.db.php");
|
||||
|
||||
$db->exec("CREATE TABLE IF NOT EXISTS location(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
@ -6,6 +6,7 @@
|
||||
* E-Mail: info@hupfeld-software.de
|
||||
* Version: 1.0
|
||||
* Datum: 18.05.2021
|
||||
* zuletzt geändert: 18.02.2024
|
||||
******************************** */
|
||||
|
||||
session_start();
|
||||
@ -14,7 +15,8 @@
|
||||
if (!$boolLogin) {
|
||||
header("Location: login.php");
|
||||
}
|
||||
$dbFilename="../db/locations.db";
|
||||
|
||||
require("../config.db.php");
|
||||
require ("../config.php");
|
||||
|
||||
// Set headers to make the browser download the results as a csv file
|
||||
|
@ -6,6 +6,7 @@
|
||||
* E-Mail: info@hupfeld-software.de
|
||||
* Version: 1.0
|
||||
* Datum: 18.05.2021
|
||||
* zuletzt geändert: 18.02.2024
|
||||
******************************** */
|
||||
|
||||
session_start();
|
||||
@ -14,7 +15,6 @@
|
||||
if (!$boolLogin) {
|
||||
header("Location: login.php");
|
||||
}
|
||||
$dbFilename="../db/locations.db";
|
||||
require ("../config.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
@ -1,11 +1,20 @@
|
||||
<?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();
|
||||
$strLoginName=(isset($_SESSION['user'])) ? $_SESSION['user'] : "" ;
|
||||
$boolLogin = (!empty($strLoginName));
|
||||
if (!$boolLogin) {
|
||||
header("Location: login.php");
|
||||
}
|
||||
$dbFilename="../db/locations.db";
|
||||
require_once("../config.db.php");
|
||||
require ("../config.php");
|
||||
require ("../lib/geocoding.php");
|
||||
$boolRefresh = (isset($_GET['refresh']) & $_GET['refresh']==1);
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM files where loc_id = :loc_id");
|
||||
$stmt->bindValue(":loc_id", $numDelete, PDO::PARAM_INT);
|
||||
$result = $stmt->execute();
|
||||
|
||||
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$strFilename = $row['filename'];
|
||||
@ -64,10 +63,11 @@
|
||||
if($_GET['csrf'] !== $_SESSION['csrf_token']) {
|
||||
die("Ungültiger Token");
|
||||
}
|
||||
|
||||
$numDelete=(int)$_GET['delfid'];
|
||||
$stmt = $db->prepare("SELECT * FROM files where id = :id");
|
||||
$stmt->bindValue(":id", $numDelete, SQLITE3_TEXT);
|
||||
$result = $stmt->execute();
|
||||
$stmt->bindParam(':id', $id);
|
||||
//$result = $stmt->execute();
|
||||
if ($row=$result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$strFilename = $row['filename'];
|
||||
$strFilename = $uploaddir . $strFilename;
|
||||
@ -76,6 +76,7 @@
|
||||
$stmt = $db->prepare("DELETE FROM files WHERE id= :id");
|
||||
$stmt->bindValue(":id",$numDelete);
|
||||
$stmt->execute();
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['showmap'])) {
|
||||
|
@ -7,6 +7,8 @@ $db_passwd = "g0r@w@";
|
||||
$db_name = "nrw_melder";
|
||||
$cachetime = 0;
|
||||
|
||||
$location_key="8b0d633d90b501";
|
||||
|
||||
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();}
|
||||
|
14
config.db.php.sample
Normal file
14
config.db.php.sample
Normal file
@ -0,0 +1,14 @@
|
||||
<?
|
||||
|
||||
$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
|
||||
* ----------------------------------------------------- */
|
||||
|
||||
//$dbFilename = "../db/locations.db";
|
||||
//$db = new SQLite3($dbFilename);
|
||||
|
||||
require("../config.db.php");
|
||||
|
||||
function getAddress($lat,$lng) {
|
||||
|
||||
$key="your-key-here";
|
||||
$key = $location_key;
|
||||
$url = "https://us1.locationiq.com/v1/reverse.php?key=".$key."&lat=".$lat."&lon=".$lng."&format=json";
|
||||
|
||||
|
||||
$curl = curl_init($url);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
@ -102,7 +102,6 @@ function fillAddressTable($db,$limit=20) {
|
||||
$lat=$row['lat'];
|
||||
$lng=$row['lng'];
|
||||
$data=getAddress($lat,$lng);
|
||||
|
||||
$strTable .= "<tr><td>$id</td><td>$lat</td><td>$lng</td>";
|
||||
foreach ($arrKeys as $key) {
|
||||
$strTable .= (isset($data[$key])) ? "<td>".$data[$key]."</td>" : "<td></td>";
|
||||
|
Loading…
Reference in New Issue
Block a user