From 6ad34e51658a56d166e05a689fff70cfc62206cd Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 10 Feb 2019 23:03:14 +0000 Subject: [PATCH] Fixed error on partial log lookups only using hamli which is now removed. --- application/controllers/Logbook.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 6965aa1a..e262000d 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -283,8 +283,23 @@ class Logbook extends CI_Controller { } echo ""; } else { - $this->load->library('hamli'); - $data['callsign'] = $this->hamli->callsign($id); + if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { + // Lookup using QRZ + $this->load->library('qrz'); + + if(!$this->session->userdata('qrz_session_key')) { + $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + } + + $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key')); + } else { + // Lookup using hamli + $this->load->library('hamli'); + + $data['callsign'] = $this->hamli->callsign($id); + } + $data['id'] = strtoupper($id); $this->load->view('search/result', $data);