Awards are shown based on the active station profile

pull/355/head
Peter Goodhall 2019-09-25 00:05:45 +01:00
rodzic f638b82005
commit 0a03fa7fbf
6 zmienionych plików z 41 dodań i 5 usunięć

Wyświetl plik

@ -9,10 +9,14 @@ 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
where COL_CQZ is not null and station_id = ".$station_id."
group by COL_CQZ order by COL_CQZ"
);

Wyświetl plik

@ -30,9 +30,13 @@ class DOK extends CI_Model {
}
function get_worked_bands() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
// get all worked slots from database
$data = $this->db->query(
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."` WHERE COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230 "
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."` WHERE station_id = ".$station_id." AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230 "
);
$worked_slots = array();
foreach($data->result() as $row){
@ -51,10 +55,13 @@ class DOK extends CI_Model {
}
function show_stats(){
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$data = $this->db->query(
"select upper(COL_DARC_DOK) as COL_DARC_DOK, COL_MODE, lcase(COL_BAND) as COL_BAND, count(COL_DARC_DOK) as cnt
from ".$this->config->item('table_name')." WHERE COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230
from ".$this->config->item('table_name')." WHERE station_id = ".$station_id." AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230
group by COL_DARC_DOK, COL_MODE, COL_BAND"
);

Wyświetl plik

@ -27,12 +27,17 @@ class DXCC extends CI_Model {
{
// Call the Model constructor
parent::__construct();
}
function get_worked_bands() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
// get all worked slots from database
$data = $this->db->query(
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."`"
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."` WHERE station_id = ".$station_id.""
);
$worked_slots = array();
foreach($data->result() as $row){
@ -51,10 +56,14 @@ class DXCC extends CI_Model {
}
function show_stats(){
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$data = $this->db->query(
"select COL_COUNTRY, COL_MODE, lcase(COL_BAND) as COL_BAND, count(COL_COUNTRY) as cnt
from ".$this->config->item('table_name')."
from ".$this->config->item('table_name')."
where station_id = ".$station_id."
group by COL_COUNTRY, COL_MODE, COL_BAND"
);

Wyświetl plik

@ -8,6 +8,11 @@ class Sota extends CI_Model {
}
function get_all() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$this->db->where("station_id", $station_id);
$this->db->order_by("COL_SOTA_REF", "ASC");
$this->db->where('COL_SOTA_REF !=', '');

Wyświetl plik

@ -5,9 +5,15 @@ class Wab extends CI_Model {
function __construct()
{
parent::__construct();
}
function get_all() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$this->db->where("station_id", $station_id);
$this->db->order_by("COL_COMMENT", "ASC");
$this->db->like('COL_COMMENT', 'WAB:');

Wyświetl plik

@ -13,6 +13,11 @@ class Wacral extends CI_Model {
}
function get_all() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$this->db->where("station_id", $station_id);
$this->db->order_by("COL_COMMENT", "ASC");
$this->db->like('COL_COMMENT', 'WACRAL:');