From a657daa1de0ddb7c12e4a1378aa972fa64d10e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Thu, 4 Apr 2024 10:41:41 +0200 Subject: [PATCH] CIM37 -Allow geolocation update in equipment_manage --- api/v1/get/application.php | 4 ++-- equipment_manage.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/api/v1/get/application.php b/api/v1/get/application.php index 063589b..2c289f7 100644 --- a/api/v1/get/application.php +++ b/api/v1/get/application.php @@ -143,9 +143,9 @@ switch ($action) { case 'geolocation': if ($whereclause == ''){ - $whereclause = 'WHERE geolocation is not null'; + $whereclause = 'WHERE geolocation is not null OR geolocation != "["",""]"'; } else { - $whereclause .= ' AND geolocation is not null'; + $whereclause .= ' AND geolocation is not null OR geolocation != "["",""]'; } $sql = 'SELECT distinct(geolocation) FROM equipment e '.$whereclause.''; diff --git a/equipment_manage.php b/equipment_manage.php index 85653cc..6576273 100644 --- a/equipment_manage.php +++ b/equipment_manage.php @@ -216,6 +216,16 @@ $view .= ' $changelog = showlog('equipment',$equipment_ID)?? ''; +//GEOLOCATION +$geo_details = $equipment['geolocation'] ?? ''; +if (is_array($geo_details)) { + $geodetails_lat = $geo_details[0]; + $geodetails_lon = $geo_details[1]; +} else{ + $geodetails_lat = ''; + $geodetails_lon = ''; +} + $view .= '