From a79187c9bee3aae7f80e69f3be31b64335eb13b6 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 4 Dec 2019 20:02:37 +0000 Subject: [PATCH] Fixed issue where map wasn't displayed if it was showing it based on dxcc when gridsquare isn't provided --- application/views/view_log/qso.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 661f9cb3..981253e7 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -203,18 +203,13 @@ $lat = $stn_loc[0]; $lng = $stn_loc[1]; } else { - $query = $this->db->query(' - SELECT * - FROM dxcc_entities - WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) ) - ORDER BY LENGTH( prefix ) DESC - LIMIT 1 - '); - foreach ($query->result() as $dxcc) { - $lat = $dxcc->lat; - $lng = $dxcc->long; - } + $CI =& get_instance(); + $CI->load->model('Logbook_model'); + + $result = $CI->Logbook_model->dxcc_lookup($row->COL_CALL, $row->COL_TIME_ON); + $lat = $result['lat']; + $lng = $result['long']; } ?>