From 345f5a132025a08aa8d4cd8f8b783e93ace77ffb Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 23 Mar 2025 17:17:08 +0100 Subject: [PATCH] [Quick Lookup] Added POTA --- application/controllers/Lookup.php | 1 + application/models/Lookup_model.php | 28 +++++++++++++++------------- application/views/lookup/index.php | 1 + application/views/lookup/result.php | 1 + assets/js/sections/common.js | 5 +++-- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index cef23c86d..df04eed1e 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -58,6 +58,7 @@ class Lookup extends CI_Controller { $data['dxcc'] = xss_clean($this->input->post('dxcc')); $data['was'] = xss_clean($this->input->post('was')); $data['sota'] = xss_clean($this->input->post('sota')); + $data['pota'] = xss_clean($this->input->post('pota')); $data['grid'] = xss_clean($this->input->post('grid')); $data['iota'] = xss_clean($this->input->post('iota')); $data['cqz'] = xss_clean($this->input->post('cqz')); diff --git a/application/models/Lookup_model.php b/application/models/Lookup_model.php index 538ae7c79..36649c9d2 100644 --- a/application/models/Lookup_model.php +++ b/application/models/Lookup_model.php @@ -51,40 +51,44 @@ class Lookup_model extends CI_Model{ switch ($queryinfo['type']) { case 'dxcc': $sqlquerytypestring .= " and col_dxcc = ?"; - $binds[]=$queryinfo['dxcc']; + $binds[] = $queryinfo['dxcc']; break; case 'iota': $sqlquerytypestring .= " and col_iota = ?"; - $binds[]=$queryinfo['iota']; + $binds[] = $queryinfo['iota']; break; case 'vucc': $sqlquerytypestring .= " and (col_gridsquare like ? or col_vucc_grids like ?)"; - $binds[]='%'.$fixedgrid.'%'; - $binds[]='%'.$fixedgrid.'%'; + $binds[] = '%'.$fixedgrid.'%'; + $binds[] = '%'.$fixedgrid.'%'; break; case 'cq': $sqlquerytypestring .= " and col_cqz = ?"; - $binds[]=$queryinfo['cqz']; + $binds[] = $queryinfo['cqz']; break; case 'was': $sqlquerytypestring .= " and col_state = ? and COL_DXCC in ('291', '6', '110')"; - $binds[]=$queryinfo['was']; + $binds[] = $queryinfo['was']; break; case 'sota': $sqlquerytypestring .= " and col_sota_ref = ?"; - $binds[]=$queryinfo['sota']; + $binds[] = $queryinfo['sota']; + break; + case 'pota': + $sqlquerytypestring .= " and col_pota_ref = ?"; + $binds[] = $queryinfo['pota']; break; case 'wwff': $sqlquerytypestring .= " and col_wwff_ref = ?"; - $binds[]=$queryinfo['wwff']; + $binds[] = $queryinfo['wwff']; break; case 'itu': $sqlquerytypestring .= " and col_ituz = ?"; - $binds[]=$queryinfo['ituz']; + $binds[] = $queryinfo['ituz']; break; case 'continent': $sqlquerytypestring .= " and col_cont = ?"; - $binds[]=$queryinfo['continent']; + $binds[] = $queryinfo['continent']; break; default: break; } @@ -96,12 +100,10 @@ class Lookup_model extends CI_Model{ */ function getQueryData($queryinfo, $confirmedtype) { // If user inputs longer grid than 4 chars, we use only the first 4 - $binds=[]; - + $binds = []; $sqlquerytypestring = ''; - if ($confirmedtype == 'confirmed') { $user_default_confirmation = $this->session->userdata('user_default_confirmation'); $extrawhere=''; diff --git a/application/views/lookup/index.php b/application/views/lookup/index.php index f3e149175..d7bcd6a0b 100644 --- a/application/views/lookup/index.php +++ b/application/views/lookup/index.php @@ -6,6 +6,7 @@ + diff --git a/application/views/lookup/result.php b/application/views/lookup/result.php index cae93a132..25346881b 100644 --- a/application/views/lookup/result.php +++ b/application/views/lookup/result.php @@ -36,6 +36,7 @@ foreach ($result as $mode => $value) { case 'cq': $linkinfo = '' . $val . ''; break; case 'was': $linkinfo = '' . $val . ''; break; case 'sota': $linkinfo = '' . $val . ''; break; + case 'pota': $linkinfo = '' . $val . ''; break; case 'wwff': $linkinfo = '' . $val . ''; break; case 'itu': $linkinfo = '' . $val . ''; break; case 'continent': $linkinfo = '' . $val . ''; break; diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index c613a8b3b..65b2c591a 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -787,7 +787,7 @@ function changeLookupType(type) { $('#quicklookupdxcc').show(); } else if (type == "iota") { $('#quicklookupiota').show(); - } else if (type == "vucc" || type == "sota" || type == "wwff" || type == "lotw") { + } else if (type == "vucc" || type == "sota" || type == "wwff" || type == "lotw" || type == "pota") { $('#quicklookuptext').show(); } else if (type == "cq") { $('#quicklookupcqz').show(); @@ -818,6 +818,7 @@ function getLookupResult() { wwff: $('#quicklookuptext').val(), lotw: $('#quicklookuptext').val(), ituz: $('#quicklookupituz').val(), + pota: $('#quicklookuptext').val(), continent: $('#quicklookupcontinent').val(), }, success: function (html) { @@ -841,7 +842,7 @@ function getDxccResult(dxcc, name) { current_mode: $('#mode').val(), }, success: function (html) { - $('.dxccsummary').remove(); + $('.dxccsummary').remove(); $('.qsopane').append('