From 27a811663821bf1ea92255f55d5cb65c2c617f4b Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 11 Sep 2023 15:57:03 +0000 Subject: [PATCH 1/7] DXCC and Grid confirmations at jsonlookup implemented --- application/controllers/Logbook.php | 108 ++++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 4 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 9603914b..c8f5264b 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -226,8 +226,9 @@ class Logbook extends CI_Controller { function jsonlookupgrid($gridsquare, $type, $band, $mode) { $return = [ "workedBefore" => false, + "confirmed" => false, ]; - + $user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation'); $CI =& get_instance(); $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -251,6 +252,52 @@ class Logbook extends CI_Controller { $return['workedBefore'] = true; } + + $extrawhere=''; + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) { + $extrawhere="COL_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) { + if ($extrawhere!='') { + $extrawhere.=" OR"; + } + $extrawhere.=" COL_LOTW_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { + if ($extrawhere!='') { + $extrawherei.=" OR"; + } + $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; + } + + if($type == "SAT") { + $this->db->where('COL_PROP_MODE', 'SAT'); + if ($extrawhere != '') { + $this->db->where('('.$extrawhere.')'); + } else { + $this->db->where("1=0"); + } + } else { + $CI->load->model('logbook_model'); + $this->db->where('COL_MODE', $CI->logbook_model->get_main_mode_from_mode($mode)); + $this->db->where('COL_BAND', $band); + $this->db->where('COL_PROP_MODE !=','SAT'); + if ($extrawhere != '') { + $this->db->where($extrawhere); + } else { + $this->db->where("1=0"); + } + } + + $this->db->where_in('station_id', $logbooks_locations_array); + + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); + $query = $this->db->get($this->config->item('table_name'), 1, 0); + log_message("error",$this->db->last_query()); + foreach ($query->result() as $workedBeforeRow) { + $return['confirmed']=true; + } + header('Content-Type: application/json'); echo json_encode($return, JSON_PRETTY_PRINT); @@ -261,12 +308,14 @@ class Logbook extends CI_Controller { $return = [ "workedBefore" => false, + "confirmed" => false, ]; + $user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation'); $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $CI->load->model('logbook_model'); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $CI->load->model('logbook_model'); if(!empty($logbooks_locations_array)) { if($type == "SAT") { @@ -287,12 +336,60 @@ class Logbook extends CI_Controller { $return['workedBefore'] = true; } + $extrawhere=''; + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) { + $extrawhere="COL_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) { + if ($extrawhere!='') { + $extrawhere.=" OR"; + } + $extrawhere.=" COL_LOTW_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { + if ($extrawhere!='') { + $extrawherei.=" OR"; + } + $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; + } + + + if($type == "SAT") { + $this->db->where('COL_PROP_MODE', 'SAT'); + if ($extrawhere != '') { + $this->db->where('('.$extrawhere.')'); + } else { + $this->db->where("1=0"); + } + } else { + $CI->load->model('logbook_model'); + $this->db->where('COL_MODE', $CI->logbook_model->get_main_mode_from_mode($mode)); + $this->db->where('COL_BAND', $band); + $this->db->where('COL_PROP_MODE !=','SAT'); + if ($extrawhere != '') { + $this->db->where($extrawhere); + } else { + $this->db->where("1=0"); + } + } + + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->where('COL_COUNTRY', urldecode($country)); + + $query = $this->db->get($this->config->item('table_name'), 1, 0); + log_message("error",$this->db->last_query()); + foreach ($query->result() as $workedBeforeRow) { + $return['confirmed']=true; + } + + header('Content-Type: application/json'); echo json_encode($return, JSON_PRETTY_PRINT); return; } else { $return['workedBefore'] = false; + $return['confirmed'] = false; header('Content-Type: application/json'); echo json_encode($return, JSON_PRETTY_PRINT); @@ -307,8 +404,10 @@ class Logbook extends CI_Controller { $return = [ "workedBefore" => false, + "confirmed" => false, ]; + $user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation'); $CI =& get_instance(); $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -338,6 +437,7 @@ class Logbook extends CI_Controller { return; } else { $return['workedBefore'] = false; + $return['confirmed'] = false; header('Content-Type: application/json'); echo json_encode($return, JSON_PRETTY_PRINT); return; From f4b4b3454eedbb94ba00c6badaaf295926b0fbd4 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 05:01:26 +0000 Subject: [PATCH 2/7] Check QSL for Callsign --- application/controllers/Logbook.php | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index c8f5264b..ea569d28 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -432,6 +432,50 @@ class Logbook extends CI_Controller { $return['workedBefore'] = true; } + $extrawhere=''; + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) { + $extrawhere="COL_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) { + if ($extrawhere!='') { + $extrawhere.=" OR"; + } + $extrawhere.=" COL_LOTW_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { + if ($extrawhere!='') { + $extrawherei.=" OR"; + } + $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; + } + + + if($type == "SAT") { + $this->db->where('COL_PROP_MODE', 'SAT'); + if ($extrawhere != '') { + $this->db->where('('.$extrawhere.')'); + } else { + $this->db->where("1=0"); + } + } else { + $CI->load->model('logbook_model'); + $this->db->where('COL_MODE', $CI->logbook_model->get_main_mode_from_mode($mode)); + $this->db->where('COL_BAND', $band); + $this->db->where('COL_PROP_MODE !=','SAT'); + if ($extrawhere != '') { + $this->db->where($extrawhere); + } else { + $this->db->where("1=0"); + } + } + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->where('COL_CALL', strtoupper($callsign)); + + $query = $this->db->get($this->config->item('table_name'), 1, 0); + foreach ($query->result() as $workedBeforeRow) { + $return['confirmed'] = true; + } + header('Content-Type: application/json'); echo json_encode($return, JSON_PRETTY_PRINT); return; From 744ca514bc064b17375142164174f597b5675e1b Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 05:18:27 +0000 Subject: [PATCH 3/7] Headline for QSL-Methods and lang-files --- application/language/english/account_lang.php | 1 + application/language/german/account_lang.php | 1 + application/views/user/edit.php | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index 54025f59..645f2717 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -95,3 +95,4 @@ $lang['account_user_mastodon'] = 'URL of Mastodonserver'; $lang['account_gridmap_settings'] = 'Settings for Gridsquare Map'; $lang['account_gridmap_default_band'] = 'Default Band'; +$lang['account_qsl_settings'] = 'Default QSL-Method shown in views (Gridsquare and Add-QSO)'; diff --git a/application/language/german/account_lang.php b/application/language/german/account_lang.php index bd9ef7c6..4c853f13 100644 --- a/application/language/german/account_lang.php +++ b/application/language/german/account_lang.php @@ -95,3 +95,4 @@ $lang['account_user_mastodon'] = 'URL des Mastodonservers'; $lang['account_gridmap_settings'] = 'Einstellung der Planquadratkarte'; $lang['account_gridmap_default_band'] = 'Standardband'; +$lang['account_qsl_settings'] = 'QSL-Methoden, die in der Planquadratkarte und beim anlegen eines QSOs angezeigt werden'; diff --git a/application/views/user/edit.php b/application/views/user/edit.php index f833d997..179288b5 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -562,6 +562,11 @@ } ?> + +
+ +
+
From 67731e4c61893c77c4b48c06e5a956b9eabfd6a8 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 05:38:07 +0000 Subject: [PATCH 4/7] Put "OR" in brackets add css for "only worked" --- application/controllers/Logbook.php | 6 +++--- assets/css/general.css | 6 +++++- assets/js/sections/qso.js | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index ea569d28..faddad73 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -283,7 +283,7 @@ class Logbook extends CI_Controller { $this->db->where('COL_BAND', $band); $this->db->where('COL_PROP_MODE !=','SAT'); if ($extrawhere != '') { - $this->db->where($extrawhere); + $this->db->where('('.$extrawhere.')'); } else { $this->db->where("1=0"); } @@ -367,7 +367,7 @@ class Logbook extends CI_Controller { $this->db->where('COL_BAND', $band); $this->db->where('COL_PROP_MODE !=','SAT'); if ($extrawhere != '') { - $this->db->where($extrawhere); + $this->db->where('('.$extrawhere.')'); } else { $this->db->where("1=0"); } @@ -463,7 +463,7 @@ class Logbook extends CI_Controller { $this->db->where('COL_BAND', $band); $this->db->where('COL_PROP_MODE !=','SAT'); if ($extrawhere != '') { - $this->db->where($extrawhere); + $this->db->where('('.$extrawhere.')'); } else { $this->db->where("1=0"); } diff --git a/assets/css/general.css b/assets/css/general.css index 9fd56cb6..6a9794d7 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -144,10 +144,14 @@ thead > tr > td { text-transform: uppercase; } -.workedGrid { +.confirmedGrid { border-color: green; } +.workedGrid { + border-color: yellow; +} + .newGrid { border-color: red; border-width: 2px; diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 96b52ea4..ddf1d648 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -445,8 +445,10 @@ function reset_fields() { $('#locator').val(""); $('#iota_ref').val(""); $('#sota_ref').val(""); + $("#locator").removeClass("confirmedGrid"); $("#locator").removeClass("workedGrid"); $("#locator").removeClass("newGrid"); + $("#callsign").removeClass("confirmedGrid"); $("#callsign").removeClass("workedGrid"); $("#callsign").removeClass("newGrid"); $('#callsign_info').removeClass("badge-secondary"); From db87530f37ee2aa6d0c9212c8129141f8b4f5305 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 06:36:31 +0000 Subject: [PATCH 5/7] removed debug, added setClass for worked/cnfmd --- application/controllers/Logbook.php | 2 - assets/js/sections/qso.js | 59 ++++++++++++++++------------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index faddad73..42fa381e 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -293,7 +293,6 @@ class Logbook extends CI_Controller { $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); $query = $this->db->get($this->config->item('table_name'), 1, 0); - log_message("error",$this->db->last_query()); foreach ($query->result() as $workedBeforeRow) { $return['confirmed']=true; } @@ -377,7 +376,6 @@ class Logbook extends CI_Controller { $this->db->where('COL_COUNTRY', urldecode($country)); $query = $this->db->get($this->config->item('table_name'), 1, 0); - log_message("error",$this->db->last_query()); foreach ($query->result() as $workedBeforeRow) { $return['confirmed']=true; } diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index ddf1d648..095273d8 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -523,11 +523,14 @@ $("#callsign").focusout(function() { { // Reset CSS values before updating $('#callsign').removeClass("workedGrid"); + $('#callsign').removeClass("confirmedGrid"); $('#callsign').removeClass("newGrid"); $('#callsign').attr('title', ''); - if (result.workedBefore) - { + if (result.confirmed) { + $('#callsign').addClass("confirmedGrid"); + $('#callsign').attr('title', 'Callsign was already worked and confirmed in the past on this band and mode!'); + } else if (result.workedBefore) { $('#callsign').addClass("workedGrid"); $('#callsign').attr('title', 'Callsign was already worked in the past on this band and mode!'); } @@ -541,20 +544,22 @@ $("#callsign").focusout(function() { $.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating + $('#callsign').removeClass("confirmedGrid"); $('#callsign').removeClass("workedGrid"); $('#callsign').removeClass("newGrid"); $('#callsign').attr('title', ''); - if (result.workedBefore) - { + if (result.confirmed) { + $('#callsign').addClass("confirmedGrid"); + $('#callsign').attr('title', 'Callsign was already worked and confirmed in the past on this band and mode!'); + } else if (result.workedBefore) { $('#callsign').addClass("workedGrid"); $('#callsign').attr('title', 'Callsign was already worked in the past on this band and mode!'); - } - else - { + } else { $('#callsign').addClass("newGrid"); $('#callsign').attr('title', 'New Callsign!'); } + }) } @@ -634,20 +639,19 @@ $("#callsign").focusout(function() { if (result.callsign_qra != "") { - if (result.workedBefore) - { + if (result.confirmed) { + $('#locator').addClass("confirmedGrid"); + $('#locator').attr('title', 'Grid was already worked and confirmed in the past'); + } else if (result.workedBefore) { $('#locator').addClass("workedGrid"); $('#locator').attr('title', 'Grid was already worked in the past'); - } - else - { + } else { $('#locator').addClass("newGrid"); $('#locator').attr('title', 'New grid!'); } - } - else - { + } else { $('#locator').removeClass("workedGrid"); + $('#locator').removeClass("confirmedGrid"); $('#locator').removeClass("newGrid"); $('#locator').attr('title', ''); } @@ -775,17 +779,18 @@ $("#locator").keyup(function(){ $.getJSON(base_url + 'index.php/logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/SAT/0/0', function(result) { // Reset CSS values before updating + $('#locator').removeClass("confirmedGrid"); $('#locator').removeClass("workedGrid"); $('#locator').removeClass("newGrid"); $('#locator').attr('title', ''); - if (result.workedBefore) - { + if (result.confirmed) { + $('#locator').addClass("confirmedGrid"); + $('#locator').attr('title', 'Grid was already worked and confirmed in the past'); + } else if (result.workedBefore) { $('#locator').addClass("workedGrid"); $('#locator').attr('title', 'Grid was already worked in the past'); - } - else - { + } else { $('#locator').addClass("newGrid"); $('#locator').attr('title', 'New grid!'); } @@ -794,20 +799,22 @@ $("#locator").keyup(function(){ $.getJSON(base_url + 'index.php/logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating + $('#locator').removeClass("confirmedGrid"); $('#locator').removeClass("workedGrid"); $('#locator').removeClass("newGrid"); $('#locator').attr('title', ''); - - if (result.workedBefore) - { + + if (result.confirmed) { + $('#locator').addClass("confirmedGrid"); + $('#locator').attr('title', 'Grid was already worked and confimred in the past'); + } else if (result.workedBefore) { $('#locator').addClass("workedGrid"); $('#locator').attr('title', 'Grid was already worked in the past'); - } - else - { + } else { $('#locator').addClass("newGrid"); $('#locator').attr('title', 'New grid!'); } + }) } } From b21f85106c275a604243b0578e2f2a8936b6a8e0 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 09:57:21 +0000 Subject: [PATCH 6/7] Colorscheme also for DXCC --- assets/js/sections/qso.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 095273d8..ccf96c53 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -386,18 +386,20 @@ function changebadge(entityname) { $.getJSON(base_url + 'index.php/logbook/jsonlookupdxcc/' + convert_case(entityname) + '/SAT/0/0', function(result) { + $('#callsign_info').removeClass("lotw_info_orange"); $('#callsign_info').removeClass("badge-secondary"); $('#callsign_info').removeClass("badge-success"); $('#callsign_info').removeClass("badge-danger"); $('#callsign_info').attr('title', ''); - if (result.workedBefore) - { + if (result.confirmed) { $('#callsign_info').addClass("badge-success"); + $('#callsign_info').attr('title', 'DXCC was already worked and confirmed in the past on this band and mode!'); + } else if (result.workedBefore) { + $('#callsign_info').addClass("badge-success"); + $('#callsign_info').addClass("lotw_info_orange"); $('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!'); - } - else - { + } else { $('#callsign_info').addClass("badge-danger"); $('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!'); } @@ -406,18 +408,20 @@ function changebadge(entityname) { $.getJSON(base_url + 'index.php/logbook/jsonlookupdxcc/' + convert_case(entityname) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating + $('#callsign_info').removeClass("lotw_info_orange"); $('#callsign_info').removeClass("badge-secondary"); $('#callsign_info').removeClass("badge-success"); $('#callsign_info').removeClass("badge-danger"); $('#callsign_info').attr('title', ''); - if (result.workedBefore) - { + if (result.confirmed) { $('#callsign_info').addClass("badge-success"); + $('#callsign_info').attr('title', 'DXCC was already worked and confirmed in the past on this band and mode!'); + } else if (result.workedBefore) { + $('#callsign_info').addClass("badge-success"); + $('#callsign_info').addClass("lotw_info_orange"); $('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!'); - } - else - { + } else { $('#callsign_info').addClass("badge-danger"); $('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!'); } From 7ac08b78f9c94f5f0997f5d3bf48c6267a79fb0e Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 12 Sep 2023 13:05:58 +0000 Subject: [PATCH 7/7] Check also grids found at callbook --- application/controllers/Logbook.php | 66 ++++++++++++++++++++++++++++- assets/js/sections/qso.js | 2 + 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 42fa381e..801fafc0 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -153,6 +153,7 @@ class Logbook extends CI_Controller { $return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign)); $return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign)); $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode); + $return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $type, $band, $mode); if ($this->session->userdata('user_show_profile_image')) { if (isset($callbook)) { @@ -181,7 +182,70 @@ class Logbook extends CI_Controller { return (($val2 ?? "") === "" ? ($val1 ?? "") : ($val2 ?? "")); } - function worked_grid_before($gridsquare, $type, $band, $mode) + function confirmed_grid_before($gridsquare, $type, $band, $mode) { + if (strlen($gridsquare) < 4) + return false; + + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation'); + + if(!empty($logbooks_locations_array)) { + $extrawhere=''; + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) { + $extrawhere="COL_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) { + if ($extrawhere!='') { + $extrawhere.=" OR"; + } + $extrawhere.=" COL_LOTW_QSL_RCVD='Y'"; + } + if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { + if ($extrawhere!='') { + $extrawherei.=" OR"; + } + $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; + } + + + if($type == "SAT") { + $this->db->where('COL_PROP_MODE', 'SAT'); + if ($extrawhere != '') { + $this->db->where('('.$extrawhere.')'); + } else { + $this->db->where("1=0"); + } + } else { + $CI->load->model('logbook_model'); + $this->db->where('COL_MODE', $CI->logbook_model->get_main_mode_from_mode($mode)); + $this->db->where('COL_BAND', $band); + $this->db->where('COL_PROP_MODE !=','SAT'); + if ($extrawhere != '') { + $this->db->where('('.$extrawhere.')'); + } else { + $this->db->where("1=0"); + } + } + + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); + $this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc"); + $this->db->limit(1); + + + $query = $this->db->get($this->config->item('table_name')); + + + foreach ($query->result() as $workedBeforeRow) { + return true; + } + } + return false; + } + +function worked_grid_before($gridsquare, $type, $band, $mode) { if (strlen($gridsquare) < 4) return false; diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index ccf96c53..6d10cc00 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -967,8 +967,10 @@ function resetDefaultQSOFields() { $('#iota_ref').val(""); $('#sota_ref').val(""); $("#locator").removeClass("workedGrid"); + $("#locator").removeClass("confirmedGrid"); $("#locator").removeClass("newGrid"); $("#callsign").removeClass("workedGrid"); + $("#callsign").removeClass("confirmedGrid"); $("#callsign").removeClass("newGrid"); $('#callsign_info').removeClass("badge-secondary"); $('#callsign_info').removeClass("badge-success");