From ca8c8108cd671fb01f8244a9d8c2ab69d080db24 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 4 Jul 2022 11:20:57 +0200 Subject: [PATCH] [Custom map] Using already logged dxcc to set position when gridsquare is not present --- application/controllers/Map.php | 9 ++++----- application/models/Logbook_model.php | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 998a8f97..22b7714a 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -174,12 +174,11 @@ class Map extends CI_Controller { echo ","; } - $result = $this->logbook_model->dxcc_lookup($row->COL_CALL, $row->COL_TIME_ON); - - if(isset($result)) { - $lat = $result['lat']; - $lng = $result['long']; + if(isset($row->lat) && isset($row->long)) { + $lat = $row->lat; + $lng = $row->long; } + echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; $count++; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index d0408d85..2023f872 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1292,6 +1292,7 @@ class Logbook_model extends CI_Model { return null; } + $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left'); $this->db->where("COL_TIME_ON BETWEEN '".$start."' AND '".$end."'"); $this->db->where_in("station_id", $logbooks_locations_array);