Only use CQ zones <= 40

This commit is contained in:
Andreas
2024-02-14 08:20:21 +01:00
parent 01654f0262
commit 168b8b7824
2 changed files with 21 additions and 23 deletions

View File

@@ -2,20 +2,6 @@
class CQ extends CI_Model{
function get_zones(){
$this->load->model('Stations');
$station_id = $this->Stations->find_active();
$data = $this->db->query(
"select COL_CQZ, count(COL_CQZ)
from ".$this->config->item('table_name')."
where COL_CQZ is not null and station_id = ".$station_id."
group by COL_CQZ order by COL_CQZ"
);
return $data->result();
}
function get_cq_array($bands, $postdata, $location_list) {
$cqZ = array(); // Used for keeping track of which states that are not worked
@@ -97,7 +83,7 @@ class CQ extends CI_Model{
*/
function getCQWorked($location_list, $band, $postdata) {
$sql = "SELECT distinct col_cqz FROM " . $this->config->item('table_name') . " thcv
where station_id in (" . $location_list . ") and col_cqz <> ''";
where station_id in (" . $location_list . ") and col_cqz <= 40 and col_cqz <> ''";
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@@ -130,7 +116,7 @@ class CQ extends CI_Model{
*/
function getCQConfirmed($location_list, $band, $postdata) {
$sql = "SELECT distinct col_cqz FROM " . $this->config->item('table_name') . " thcv
where station_id in (" . $location_list . ") and col_cqz <> ''";
where station_id in (" . $location_list . ") and col_cqz <= 40 and col_cqz <> ''";
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@@ -210,7 +196,7 @@ class CQ extends CI_Model{
function getSummaryByBand($band, $postdata, $location_list) {
$sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv";
$sql .= " where station_id in (" . $location_list . ') and col_cqz > 0';
$sql .= " where station_id in (" . $location_list . ') and col_cqz <= 40 and col_cqz > 0';
if ($band == 'SAT') {
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
@@ -218,9 +204,9 @@ class CQ extends CI_Model{
$this->load->model('bands');
$bandslots = $this->bands->get_worked_bands('cq');
$bandslots_list = "'".implode("','",$bandslots)."'";
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
" and thcv.col_prop_mode !='SAT'";
} else {
@@ -240,7 +226,7 @@ class CQ extends CI_Model{
function getSummaryByBandConfirmed($band, $postdata, $location_list){
$sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv";
$sql .= " where station_id in (" . $location_list . ') and col_cqz > 0';
$sql .= " where station_id in (" . $location_list . ') and col_cqz <= 40 and col_cqz > 0';
if ($band == 'SAT') {
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
@@ -248,9 +234,9 @@ class CQ extends CI_Model{
$this->load->model('bands');
$bandslots = $this->bands->get_worked_bands('cq');
$bandslots_list = "'".implode("','",$bandslots)."'";
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
" and thcv.col_prop_mode !='SAT'";
} else {

View File

@@ -194,7 +194,7 @@ class QSO
$this->lotw = $this->getLotwString($data, $custom_date_format);
$this->eqsl = $this->getEqslString($data, $custom_date_format);
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : '<a href="javascript:spawnLookupModal('.$data['COL_CQZ'].',\'cq\');">'.$data['COL_CQZ'].'</a>';
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $this->geCqLink($data['COL_CQZ']);
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
$this->dxcc = (($data['name'] ?? null) === null) ? '- NONE -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['name']), "- (/").'</a>';
$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']);
@@ -209,6 +209,18 @@ class QSO
$this->operator = ($data['COL_OPERATOR'] === null) ? '' :$data['COL_OPERATOR'];
}
/**
* @return string
*/
function geCqLink($cqz): string
{
$cqz_link = '';
if ($cqz <= '40') {
return '<a href="javascript:spawnLookupModal('.$cqz.',\'cq\');">'.$cqz.'</a>';
}
return $cqz;
}
/**
* @return string
*/