From 1f44c21d695e033263d4f656c80af95f7f5445c9 Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Wed, 21 Feb 2024 14:31:28 +0100 Subject: [PATCH] disctrict --- admin/alter_table.php | 3 +-- admin/dump.php | 7 ++++++- admin/export.php | 5 ++++- admin/geocoding.php | 2 +- admin/index.php | 1 + admin/print_html.php | 7 ++++--- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/admin/alter_table.php b/admin/alter_table.php index 53be938..a6610c4 100644 --- a/admin/alter_table.php +++ b/admin/alter_table.php @@ -1,4 +1,5 @@ exec($strSQL); diff --git a/admin/dump.php b/admin/dump.php index 27e6ce8..47129dd 100644 --- a/admin/dump.php +++ b/admin/dump.php @@ -15,6 +15,9 @@ if (!$boolLogin) { header("Location: login.php"); } + $strDistrict=$_SESSION['district']; + $sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'"; + require("../config.db.php"); require ("../config.php"); @@ -28,7 +31,9 @@ // Query $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); // Fetch the first row diff --git a/admin/export.php b/admin/export.php index 6fa6931..e67ae6c 100644 --- a/admin/export.php +++ b/admin/export.php @@ -15,6 +15,9 @@ if (!$boolLogin) { header("Location: login.php"); } + $strDistrict=$_SESSION['district']; + $sqlDistrict = ($boolSuperAdmin) ? "1" : "l.district='$strDistrict'"; + require ("../config.php"); ?> @@ -37,7 +40,7 @@