Gridsquare maps are shown based on the active logbook

这个提交包含在:
Peter Goodhall 2019-09-26 12:30:40 +01:00
父节点 939ef2acb6
当前提交 08a2ad5a30
共有 2 个文件被更改,包括 32 次插入5 次删除

查看文件

@ -48,6 +48,7 @@ class Gridsquares extends CI_Controller {
// Get Confirmed LOTW & Paper Squares (non VUCC)
$query = $this->gridsquares_model->get_confirmed_sat_squares();
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)

查看文件

@ -9,28 +9,50 @@ class Gridsquares_model extends CI_Model {
}
function get_worked_sat_squares() {
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as SAT_SQUARE, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE COL_GRIDSQUARE != "" AND COL_SAT_NAME != ""');
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$this->db->where("station_id", $station_id);
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as SAT_SQUARE, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE != "" AND COL_SAT_NAME != ""');
}
function get_confirmed_sat_squares() {
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as SAT_SQUARE, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE COL_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")');
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as SAT_SQUARE, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")');
}
function get_confirmed_sat_vucc_squares() {
return $this->db->query('SELECT COL_VUCC_GRIDS, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE COL_VUCC_GRIDS != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y") AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")');
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
return $this->db->query('SELECT COL_VUCC_GRIDS, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_VUCC_GRIDS != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y") AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")');
}
function get_worked_sat_vucc_squares() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$this->db->select('COL_PRIMARY_KEY, COL_VUCC_GRIDS, COL_SAT_NAME');
$this->db->where("station_id", $station_id);
$this->db->where('COL_VUCC_GRIDS !=', "");
$this->db->where('COL_SAT_NAME !=', "");
return $this->db->get($this->config->item('table_name'));
}
function get_band($band) {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES, COL_BAND FROM '.$this->config->item('table_name').'
WHERE COL_GRIDSQUARE != ""
WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE != ""
AND COL_BAND = "'.$band.'"
AND COL_PROP_MODE != "SAT"
AND COL_PROP_MODE != "INTERNET"
@ -41,7 +63,11 @@ class Gridsquares_model extends CI_Model {
}
function get_band_confirmed($band) {
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES, COL_BAND FROM '.$this->config->item('table_name').' WHERE COL_GRIDSQUARE != "" AND COL_BAND = "'.$band.'"
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
return $this->db->query('SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES, COL_BAND FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE != "" AND COL_BAND = "'.$band.'"
AND COL_PROP_MODE != "SAT"
AND COL_PROP_MODE != "INTERNET"
AND COL_PROP_MODE != "ECH"