diff --git a/equipment.php b/equipment.php index 470c60c..69801fb 100644 --- a/equipment.php +++ b/equipment.php @@ -221,31 +221,33 @@ $view .= '
if (!empty($responses->geolocation) || $responses->geolocation != ''){ $geolocation = json_decode($responses->geolocation,true); - $view .= '
-
-
- -
- '; + // show the scale bar on the lower left corner + L.control.scale({imperial: true, metric: true}).addTo(map); + +
+ '; + } } //Get all related service events diff --git a/equipment_manage.php b/equipment_manage.php index 6576273..6fedefd 100644 --- a/equipment_manage.php +++ b/equipment_manage.php @@ -30,7 +30,7 @@ $equipment = [ 'service_date' => $date, 'warranty_date' => $date, 'order_ref' => '', - 'geolocation' => '' + 'geolocation' => [] ]; $equipment_ID = $_GET['equipmentID'] ?? ''; @@ -65,6 +65,8 @@ if (isset($_GET['equipmentID'])) { if ($update_allowed === 1 || $equipment_owner === 1 || $update_allowed_special === 1){ if (isset($_POST['submit'])) { + //GEOLOCATION ARRAY convert to JSON + $_POST['geolocation'] = json_encode($_POST['geolocation'],JSON_UNESCAPED_UNICODE); //GET ALL POST DATA $data = json_encode($_POST, JSON_UNESCAPED_UNICODE); //Secure data @@ -101,6 +103,8 @@ if (isset($_GET['equipmentID'])) { } else { // Create a new equipment if (isset($_POST['submit']) && $create_allowed === 1) { + //GEOLOCATION ARRAY convert to JSON + $_POST['geolocation'] = json_encode($_POST['geolocation'],JSON_UNESCAPED_UNICODE); //GET ALL POST DATA $data = json_encode($_POST, JSON_UNESCAPED_UNICODE); //Secure data @@ -217,7 +221,7 @@ $view .= ' $changelog = showlog('equipment',$equipment_ID)?? ''; //GEOLOCATION -$geo_details = $equipment['geolocation'] ?? ''; +$geo_details = json_decode($equipment['geolocation']) ?? ''; if (is_array($geo_details)) { $geodetails_lat = $geo_details[0]; $geodetails_lon = $geo_details[1];