[VUCC Award] Updated code to support station logbooks
这个提交包含在:
父节点
a6422fa341
当前提交
9fef439c86
共有 2 个文件被更改,包括 28 次插入 和 20 次删除
|
|
@ -292,11 +292,14 @@ class Logbook_model extends CI_Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vucc_qso_details($gridsquare, $band) {
|
public function vucc_qso_details($gridsquare, $band) {
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->model('Stations');
|
$CI->load->model('logbooks_model');
|
||||||
$station_id = $CI->Stations->find_active();
|
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||||
|
|
||||||
|
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||||
|
|
||||||
$sql = "select * from " . $this->config->item('table_name') .
|
$sql = "select * from " . $this->config->item('table_name') .
|
||||||
" where station_id =" . $station_id .
|
" where station_id in (" . $location_list . ")" .
|
||||||
" and (col_gridsquare like '" . $gridsquare. "%'
|
" and (col_gridsquare like '" . $gridsquare. "%'
|
||||||
or col_vucc_grids like '%" . $gridsquare. "%')";
|
or col_vucc_grids like '%" . $gridsquare. "%')";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,15 @@ class VUCC extends CI_Model
|
||||||
|
|
||||||
function get_worked_bands()
|
function get_worked_bands()
|
||||||
{
|
{
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->model('Stations');
|
$CI->load->model('logbooks_model');
|
||||||
$station_id = $CI->Stations->find_active();
|
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||||
|
|
||||||
|
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||||
|
|
||||||
// get all worked slots from database
|
// get all worked slots from database
|
||||||
$data = $this->db->query(
|
$data = $this->db->query(
|
||||||
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `" . $this->config->item('table_name') . "` WHERE station_id = " . $station_id . " AND COL_PROP_MODE != \"SAT\""
|
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `" . $this->config->item('table_name') . "` WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
|
||||||
);
|
);
|
||||||
$worked_slots = array();
|
$worked_slots = array();
|
||||||
foreach ($data->result() as $row) {
|
foreach ($data->result() as $row) {
|
||||||
|
|
@ -48,7 +50,7 @@ class VUCC extends CI_Model
|
||||||
}
|
}
|
||||||
|
|
||||||
$SAT_data = $this->db->query(
|
$SAT_data = $this->db->query(
|
||||||
"SELECT distinct LOWER(`COL_PROP_MODE`) as `COL_PROP_MODE` FROM `" . $this->config->item('table_name') . "` WHERE station_id = " . $station_id . " AND COL_PROP_MODE = \"SAT\""
|
"SELECT distinct LOWER(`COL_PROP_MODE`) as `COL_PROP_MODE` FROM `" . $this->config->item('table_name') . "` WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE = \"SAT\""
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($SAT_data->result() as $row) {
|
foreach ($SAT_data->result() as $row) {
|
||||||
|
|
@ -159,11 +161,15 @@ class VUCC extends CI_Model
|
||||||
* $confirmationMethod - qsl, lotw or both, use anything else to skip confirmed
|
* $confirmationMethod - qsl, lotw or both, use anything else to skip confirmed
|
||||||
*/
|
*/
|
||||||
function get_vucc_summary_col_vucc($band, $confirmationMethod) {
|
function get_vucc_summary_col_vucc($band, $confirmationMethod) {
|
||||||
$station_id = $this->get_station_id();
|
$CI =& get_instance();
|
||||||
|
$CI->load->model('logbooks_model');
|
||||||
|
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||||
|
|
||||||
|
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||||
|
|
||||||
$sql = "select col_vucc_grids
|
$sql = "select col_vucc_grids
|
||||||
from " . $this->config->item('table_name') .
|
from " . $this->config->item('table_name') .
|
||||||
" where station_id =" . $station_id .
|
" where station_id in (" . $location_list . ")" .
|
||||||
" and col_vucc_grids <> '' ";
|
" and col_vucc_grids <> '' ";
|
||||||
|
|
||||||
if ($confirmationMethod == 'both') {
|
if ($confirmationMethod == 'both') {
|
||||||
|
|
@ -195,10 +201,15 @@ class VUCC extends CI_Model
|
||||||
* $confirmationMethod - qsl, lotw or both, use anything else to skip confirmed
|
* $confirmationMethod - qsl, lotw or both, use anything else to skip confirmed
|
||||||
*/
|
*/
|
||||||
function get_vucc_summary($band, $confirmationMethod) {
|
function get_vucc_summary($band, $confirmationMethod) {
|
||||||
$station_id = $this->get_station_id();
|
$CI =& get_instance();
|
||||||
|
$CI->load->model('logbooks_model');
|
||||||
|
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||||
|
|
||||||
|
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||||
|
|
||||||
$sql = "select distinct upper(substring(col_gridsquare, 1, 4)) gridsquare
|
$sql = "select distinct upper(substring(col_gridsquare, 1, 4)) gridsquare
|
||||||
from " . $this->config->item('table_name') .
|
from " . $this->config->item('table_name') .
|
||||||
" where station_id =" . $station_id .
|
" where station_id in (" . $location_list . ")" .
|
||||||
" and col_gridsquare <> ''";
|
" and col_gridsquare <> ''";
|
||||||
|
|
||||||
if ($confirmationMethod == 'both') {
|
if ($confirmationMethod == 'both') {
|
||||||
|
|
@ -371,11 +382,5 @@ class VUCC extends CI_Model
|
||||||
|
|
||||||
return $workedGridArray;
|
return $workedGridArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_station_id() {
|
|
||||||
$CI =& get_instance();
|
|
||||||
$CI->load->model('Stations');
|
|
||||||
return $CI->Stations->find_active();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用