diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index 68e21242c..9a4077fbc 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -184,9 +184,9 @@ class Lookup extends CI_Controller { $uppercase_callsign = strtoupper($call); $this->load->model('Pota'); $query = $this->Pota->ham_of_note($uppercase_callsign); - if ($query->row()) { + if ($query->num_rows() > 0) { header('Content-Type: application/json'); - echo json_encode($query->row()); + echo json_encode($query->result()); } else { return null; } diff --git a/application/models/Pota.php b/application/models/Pota.php index 89718fb9b..b7b0c51e1 100644 --- a/application/models/Pota.php +++ b/application/models/Pota.php @@ -27,7 +27,6 @@ class Pota extends CI_Model { function ham_of_note($callsign) { $this->db->where('callsign', $callsign); $this->db->order_by('description asc'); - $this->db->limit(1); return $this->db->get('hams_of_note'); } diff --git a/application/views/qso/index.php b/application/views/qso/index.php index e66188b4b..44f8cc332 100644 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -220,7 +220,7 @@ if (typeof window.DX_WATERFALL_FIELD_MAP === 'undefined') {
- + diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index e4ddc4b2b..440fb2d19 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -1272,10 +1272,7 @@ function reset_fields() { $('#continent').val(""); $('#email').val(""); $('#region').val(""); - $('#ham_of_note_info').text(""); - $('#ham_of_note_link').html(""); - $('#ham_of_note_link').removeAttr('href'); - $('#ham_of_note_line').hide(); + $('#ham_of_note_line').empty().hide(); $('#lotw_info').text(""); $('#lotw_info').attr('data-bs-original-title', ""); $('#lotw_info').removeClass("lotw_info_red"); @@ -1506,10 +1503,7 @@ $("#callsign").on("focusout", function () { $('#callsign').removeClass("confirmedGrid"); $('#callsign').removeClass("newGrid"); $('#callsign').attr('title', ''); - $('#ham_of_note_info').text(""); - $('#ham_of_note_link').html(""); - $('#ham_of_note_link').removeAttr('href'); - $('#ham_of_note_line').hide(); + $('#ham_of_note_line').empty().hide(); if (result.confirmed) { $('#callsign').addClass("confirmedGrid"); @@ -1530,10 +1524,7 @@ $("#callsign").on("focusout", function () { $('#callsign').removeClass("workedGrid"); $('#callsign').removeClass("newGrid"); $('#callsign').attr('title', ''); - $('#ham_of_note_info').text(""); - $('#ham_of_note_link').html(""); - $('#ham_of_note_link').removeAttr('href'); - $('#ham_of_note_line').hide(); + $('#ham_of_note_line').empty().hide(); if (result.confirmed) { $('#callsign').addClass("confirmedGrid"); @@ -1600,15 +1591,18 @@ $("#callsign").on("focusout", function () { } $.getJSON(base_url + 'index.php/lookup/ham_of_note/' + $('#callsign').val().toUpperCase().replaceAll('Ø', '0').replaceAll('/','-'), function (result) { - if (result) { - $('#ham_of_note_info').html(''+result.description+''); - if (result.link != null) { - $('#ham_of_note_link').html(" "+result.linkname); - $('#ham_of_note_link').attr('href', result.link); - } - $('#ham_of_note_line').show("slow"); + if (result && result.length > 0) { + var html = ''; + $.each(result, function(i, entry) { + var linkHtml = ''; + if (entry.link != null) { + linkHtml = ' ' + entry.linkname + ''; + } + html += '' + entry.description + '' + linkHtml + '
'; + }); + $('#ham_of_note_line').html(html).show("slow"); - var minimized_elements = $('span.minimize'); + var minimized_elements = $('#ham_of_note_line span.minimize'); var maxlen = 50; minimized_elements.each(function(){