[DXCC summary] Fix for bands that are not active

This commit is contained in:
Andreas
2023-02-18 09:58:54 +01:00
parent 1f99efcca3
commit 0ecc5de833
2 changed files with 7 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ class Lookup extends CI_Controller {
$this->load->model('lookup_model');
$this->load->model('bands');
$data['bands'] = $this->bands->get_worked_bands();
$data['bands'] = $this->bands->get_worked_bands('dxcc');
$data['type'] = xss_clean($this->input->post('type'));
$data['dxcc'] = xss_clean($this->input->post('dxcc'));

View File

@@ -19,13 +19,17 @@ class Lookup_model extends CI_Model{
// Populating array with worked band/mode combinations
$worked = $this->getQueryData($queryinfo, 'worked');
foreach ($worked as $w) {
$resultArray[$w->col_mode][$w->col_band] = 'W';
if(in_array($w->col_band, $queryinfo['bands'])) {
$resultArray[$w->col_mode][$w->col_band] = 'W';
}
}
// Populating array with confirmed band/mode combinations
$confirmed = $this->getQueryData($queryinfo, 'confirmed');
foreach ($confirmed as $c) {
$resultArray[$c->col_mode][$c->col_band] = 'C';
if(in_array($c->col_band, $queryinfo['bands'])) {
$resultArray[$c->col_mode][$c->col_band] = 'C';
}
}
return $resultArray;