Handle incorrect CQ zones

pull/2971/head
phl0 2024-02-14 08:49:51 +01:00
rodzic 23088e4654
commit 0ae34b51bc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 21 dodań i 24 usunięć

Wyświetl plik

@ -2,21 +2,6 @@
class CQ extends CI_Model{
function get_zones(){
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->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
@ -95,7 +80,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'] . "')";
@ -128,7 +113,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'] . "')";
@ -199,7 +184,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 . "'";
@ -207,9 +192,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 {
@ -229,7 +214,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 . "'";
@ -237,9 +222,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 {

Wyświetl plik

@ -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
*/