[Quick Lookup] Added POTA

This commit is contained in:
Andreas Kristiansen
2025-03-23 17:17:08 +01:00
parent 1ae7c5c16b
commit 345f5a1320
5 changed files with 21 additions and 15 deletions

View File

@@ -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'));

View File

@@ -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='';

View File

@@ -6,6 +6,7 @@
<option value="vucc"><?= __("Gridsquare"); ?></option>
<option value="iota"><?= __("IOTA"); ?></option>
<option value="itu"><?= __("ITU Zone"); ?></option>
<option value="pota"><?= __("POTA"); ?></option>
<option value="sota"><?= __("SOTA"); ?></option>
<option value="was"><?= __("US State"); ?></option>
<option value="wwff"><?= __("WWFF"); ?></option>

View File

@@ -36,6 +36,7 @@ foreach ($result as $mode => $value) {
case 'cq': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cqz).'","' . $key . '","All","All","' . $mode . '","CQZone")\'>' . $val . '</a>'; break;
case 'was': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $was).'","' . $key . '","All","All","' . $mode . '","WAS")\'>' . $val . '</a>'; break;
case 'sota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $sota).'","' . $key . '","All","All","' . $mode . '","SOTA")\'>' . $val . '</a>'; break;
case 'pota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $pota).'","' . $key . '","All","All","' . $mode . '","POTA")\'>' . $val . '</a>'; break;
case 'wwff': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wwff).'","' . $key . '","All","All","' . $mode . '","WWFF")\'>' . $val . '</a>'; break;
case 'itu': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $ituz).'","' . $key . '","All","All","' . $mode . '","ITU")\'>' . $val . '</a>'; break;
case 'continent': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $continent).'","' . $key . '","All","All","' . $mode . '","WAC")\'>' . $val . '</a>'; break;

View File

@@ -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('<div class="dxccsummary col-sm-12"><br><div class="card"><div class="card-header dxccsummaryheader" data-bs-toggle="collapse" data-bs-target=".dxccsummarybody">' + lang_dxccsummary_for + name + '</div><div class="card-body collapse dxccsummarybody"></div></div></div>');
$('.dxccsummarybody').append(html);
$('.dxccsummaryheader').click(function(){