diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 71a19756..2e75ccc0 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -58,6 +58,11 @@ class Logbook extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } + $this->load->model('lotw_user'); + + $lotw_member = $this->lotw_user->check($callsign); + + $this->load->model('logbook_model'); $return = [ @@ -67,7 +72,8 @@ class Logbook extends CI_Controller { "callsign_qth" => "", "callsign_iota" => "", "bearing" => "", - "workedBefore" => false + "workedBefore" => false, + "lotw_member" => $lotw_member, ]; $return['dxcc'] = $this->dxcheck($callsign); @@ -91,6 +97,7 @@ class Logbook extends CI_Controller { return; } + if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { // Lookup using QRZ @@ -131,6 +138,7 @@ class Logbook extends CI_Controller { $return['bearing'] = $this->bearing($return['callsign_qra']); echo json_encode($return, JSON_PRETTY_PRINT); + return; } diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 86b806b9..1c9eb771 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -324,6 +324,9 @@ class Lotw extends CI_Controller { */ function lotw_usercheck($callsign) { $this->load->model('lotw_user'); + + + $lotw_user_result = $this->lotw_user->check($callsign); } diff --git a/application/models/Lotw_user.php b/application/models/Lotw_user.php index 66be9158..e145f668 100644 --- a/application/models/Lotw_user.php +++ b/application/models/Lotw_user.php @@ -20,9 +20,18 @@ class Lotw_user extends CI_Model { 'upload_date' => $date ); - - $this->db->insert('lotw_userlist', $data); } + + function check($callsign) { + $this->db->where('callsign', $callsign); + $query = $this->db->get('lotw_userlist'); + + if ($query->num_rows() > 0) { + return "active"; + } else { + return "not found"; + } + } } ?> \ No newline at end of file diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index e2035943..70c003a9 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -203,6 +203,7 @@ $(document).ready(function(){ $('#callsign_info').text(""); $('#locator_info').text(""); $('#country').val(""); + $('#lotw_info').text(""); $('#dxcc_id').val(""); $('#cqz').val(""); $('#name').val(""); @@ -223,9 +224,13 @@ $(document).ready(function(){ /* Find and populate DXCC */ $.getJSON('logbook/json/' + $(this).val(), function(result) { - //$('#country').val(result); + //$('#country').val(result); lotw_info $('#country').val(convert_case(result.dxcc.entity)); $('#callsign_info').text(convert_case(result.dxcc.entity)); + + if(result.lotw_member == "active") { + $('#lotw_info').text("LoTW"); + } $('#dxcc_id').val(result.dxcc.adif); $('#cqz').val(result.dxcc.cqz); diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 84b91a84..9b611b1a 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -60,7 +60,7 @@