[Bands] Consolidated get_worked_bands to it's own model. This will make it easier to have everything in one place, and perhaps also move bands to db.

pull/1281/head
Andreas 2021-11-13 15:55:17 +01:00
rodzic 92850e821d
commit 939434090d
21 zmienionych plików z 182 dodań i 649 usunięć

Wyświetl plik

@ -16,9 +16,9 @@ class Accumulated extends CI_Controller {
// Render Page
$data['page_title'] = "Accumulated Statistics";
$this->load->model('Accumulate_model');
$this->load->model('bands');
$data['worked_bands'] = $this->Accumulate_model->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
$this->load->model('modes');

Wyświetl plik

@ -28,8 +28,11 @@ class Awards extends CI_Controller {
public function dok ()
{
$this->load->model('dok');
$this->load->model('bands');
$data['doks'] = $this->dok->show_stats();
$data['worked_bands'] = $this->dok->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands_dok(); // Used in the view for band select
// Render Page
$data['page_title'] = "Awards - DOK";
@ -75,8 +78,9 @@ class Awards extends CI_Controller {
public function dxcc () {
$this->load->model('dxcc');
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
@ -141,7 +145,8 @@ class Awards extends CI_Controller {
public function vucc() {
$this->load->model('vucc');
$data['worked_bands'] = $this->vucc->get_worked_bands();
$this->load->model('bands');
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['vucc_array'] = $this->vucc->get_vucc_array($data);
@ -234,8 +239,9 @@ class Awards extends CI_Controller {
$this->load->model('cq');
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = $this->cq->get_worked_bands($location_list);
$data['worked_bands'] = $this->bands->get_worked_bands($location_list);
$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
@ -284,8 +290,9 @@ class Awards extends CI_Controller {
public function was() {
$this->load->model('was');
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = $this->was->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
@ -334,8 +341,9 @@ class Awards extends CI_Controller {
public function iota () {
$this->load->model('iota');
$this->load->model('modes');
$this->load->model('bands');
$data['worked_bands'] = $this->iota->get_worked_bands(); // Used in the view for band select
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands

Wyświetl plik

@ -16,9 +16,9 @@ class Distances extends CI_Controller {
// Render Page
$data['page_title'] = "Distances Worked";
$this->load->model('Distances_model');
$data['bands_available'] = $this->Distances_model->get_worked_bands();
$data['sats_available'] = $this->Distances_model->get_worked_sats();
$this->load->model('bands');
$data['bands_available'] = $this->bands->get_worked_bands_distances();
$data['sats_available'] = $this->bands->get_worked_sats();
$this->load->view('interface_assets/header', $data);
$this->load->view('distances/index');

Wyświetl plik

@ -8,12 +8,12 @@ class Dxatlas extends CI_Controller {
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$this->load->model('modes');
$this->load->model('dxcc');
$this->load->model('logbook_model');
$this->load->model('stations');
$this->load->model('bands');
$data['station_profile'] = $this->stations->all(); // Used in the view for station location select
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
$data['modes'] = $this->modes->active(); // Used in the view for mode select
$data['dxcc'] = $this->logbook_model->fetchDxcc(); // Used in the view for dxcc select

Wyświetl plik

@ -13,12 +13,12 @@ class Kml extends CI_Controller {
{
$this->load->model('user_model');
$this->load->model('modes');
$this->load->model('dxcc');
$this->load->model('logbook_model');
$this->load->model('bands');
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
$data['modes'] = $this->modes->active(); // Used in the view for mode select
$data['dxcc'] = $this->logbook_model->fetchDxcc(); // Used in the view for dxcc select

Wyświetl plik

@ -34,8 +34,9 @@ class Lookup extends CI_Controller {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$this->load->model('lookup_model');
$this->load->model('bands');
$data['bands'] = $this->lookup_model->get_Worked_Bands($location_list);
$data['bands'] = $this->bands->get_worked_bands();
$data['type'] = xss_clean($this->input->post('type'));
$data['dxcc'] = xss_clean($this->input->post('dxcc'));

Wyświetl plik

@ -34,10 +34,10 @@ class Map extends CI_Controller {
function custom()
{
$this->load->model('dxcc');
$this->load->model('bands');
//$this->load->model('modes');
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
//$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.

Wyświetl plik

@ -40,11 +40,12 @@ class Timeline extends CI_Controller {
}
$this->load->model('modes');
$this->load->model('bands');
$data['modes'] = $this->modes->active();
$data['timeline_array'] = $this->Timeline_model->get_timeline($band, $mode, $award);
$data['worked_bands'] = $this->Timeline_model->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['bandselect'] = $band;
$data['modeselect'] = $mode;

Wyświetl plik

@ -16,9 +16,9 @@ class Timeplotter extends CI_Controller {
// Render Page
$data['page_title'] = "Timeplotter";
$this->load->model('Timeplotter_model');
$this->load->model('bands');
$data['worked_bands'] = $this->Timeplotter_model->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands();
$this->load->model('dxcc');
$data['dxcc_list'] = $this->dxcc->list();

Wyświetl plik

@ -261,60 +261,4 @@ class Accumulate_model extends CI_Model
return $query->result();
}
function get_worked_bands() {
$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)."'";
$data = $this->db->query(
"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();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
}
}

Wyświetl plik

@ -0,0 +1,145 @@
<?php
class Bands extends CI_Model {
public $bandslots = array(
"160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0,
"SAT"=>0,
);
function __construct() {
// Call the Model constructor
parent::__construct();
}
function get_worked_bands() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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){
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_worked_bands_distances() {
$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)."'";
// get all worked slots from database
$sql = "SELECT distinct LOWER(COL_BAND) as COL_BAND FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ")";
$data = $this->db->query($sql);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_worked_sats() {
$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)."'";
// get all worked sats from database
$sql = "SELECT distinct col_sat_name FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_sat_name, '') <> '' ORDER BY col_sat_name";
$data = $this->db->query($sql);
$worked_sats = array();
foreach($data->result() as $row){
array_push($worked_sats, $row->col_sat_name);
}
return $worked_sats;
}
function get_worked_bands_dok() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230 "
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
}
?>

Wyświetl plik

@ -22,58 +22,6 @@ class CQ extends CI_Model{
return $data->result();
}
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
function get_worked_bands($location_list)
{
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_cq_array($bands, $postdata, $location_list) {
$cqZ = array(); // Used for keeping track of which states that are not worked

Wyświetl plik

@ -9,73 +9,6 @@ class Distances_model extends CI_Model
parent::__construct();
}
public $bandslots = array("160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0);
function get_worked_sats() {
$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)."'";
// get all worked sats from database
$sql = "SELECT distinct col_sat_name FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_sat_name, '') <> '' ORDER BY col_sat_name";
$data = $this->db->query($sql);
$worked_sats = array();
foreach($data->result() as $row){
array_push($worked_sats, $row->col_sat_name);
}
return $worked_sats;
}
function get_worked_bands() {
$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)."'";
// get all worked slots from database
$sql = "SELECT distinct LOWER(COL_BAND) as COL_BAND FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ")";
$data = $this->db->query($sql);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_distances($postdata, $measurement_base)
{
$CI =& get_instance();

Wyświetl plik

@ -2,65 +2,19 @@
class DOK extends CI_Model {
public $bandslots = array("160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0);
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function get_worked_bands() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230 "
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function show_stats() {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->load->model('bands');
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$data = $this->db->query(
@ -74,7 +28,7 @@ class DOK extends CI_Model {
foreach($data->result() as $row){
if ($last_dok != $row->COL_DARC_DOK){
// new row
$results[$row->COL_DARC_DOK] = $this->bandslots;
$results[$row->COL_DARC_DOK] = $this->bands->bandslots;
$last_dok = $row->COL_DARC_DOK;
}

Wyświetl plik

@ -2,29 +2,6 @@
class DXCC extends CI_Model {
public $bandslots = array("160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0,
"SAT"=>0,
);
function __construct()
{
// Call the Model constructor
@ -32,42 +9,6 @@ class DXCC extends CI_Model {
}
function get_worked_bands() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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){
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
/**
* Function: mostactive
* Information: Returns the most active band

Wyświetl plik

@ -1,70 +1,13 @@
<?php
class IOTA extends CI_Model {
public $bandslots = array("160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0,
"SAT"=>0,
);
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function get_worked_bands() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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){
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_iota_array($iotaArray, $bands, $postdata) {
$CI =& get_instance();
$CI->load->model('logbooks_model');

Wyświetl plik

@ -124,61 +124,6 @@ class Lookup_model extends CI_Model{
return $query->result();
}
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
/*
* Get's the worked bands from the log
*/
function get_worked_bands($location_list)
{
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
/*
* Get's the worked modes from the log
*/

Wyświetl plik

@ -138,63 +138,5 @@ class Timeline_model extends CI_Model
return $query->result();
}
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
function get_worked_bands()
{
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
}

Wyświetl plik

@ -9,62 +9,6 @@ class Timeplotter_model extends CI_Model
parent::__construct();
}
function get_worked_bands() {
$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)."'";
$data = $this->db->query(
"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();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
function getTimes($postdata) {
$CI =& get_instance();
$CI->load->model('logbooks_model');

Wyświetl plik

@ -2,71 +2,12 @@
class VUCC extends CI_Model
{
public $bandslots = array("160m" => 0,
"80m" => 0,
"60m" => 0,
"40m" => 0,
"30m" => 0,
"20m" => 0,
"17m" => 0,
"15m" => 0,
"12m" => 0,
"10m" => 0,
"6m" => 0,
"4m" => 0,
"2m" => 0,
"70cm" => 0,
"23cm" => 0,
"13cm" => 0,
"9cm" => 0,
"6cm" => 0,
"3cm" => 0,
"1.25cm" => 0,
"SAT" => 0,
);
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function get_worked_bands()
{
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach ($data->result() as $row) {
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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) {
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach (array_keys($this->bandslots) as $slot) {
if (in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
/*
* Fetches worked and confirmed gridsquare on each band and total
*/

Wyświetl plik

@ -4,69 +4,12 @@ class was extends CI_Model {
public $stateString = 'AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY';
public $bandslots = array("160m"=>0,
"80m"=>0,
"60m"=>0,
"40m"=>0,
"30m"=>0,
"20m"=>0,
"17m"=>0,
"15m"=>0,
"12m"=>0,
"10m"=>0,
"6m" =>0,
"4m" =>0,
"2m" =>0,
"70cm"=>0,
"23cm"=>0,
"13cm"=>0,
"9cm"=>0,
"6cm"=>0,
"3cm"=>0,
"1.25cm"=>0,
"SAT"=>0,
);
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function get_worked_bands() {
$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)."'";
// 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 station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\""
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
$SAT_data = $this->db->query(
"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){
array_push($worked_slots, strtoupper($row->COL_PROP_MODE));
}
// bring worked-slots in order of defined $bandslots
$results = array();
foreach(array_keys($this->bandslots) as $slot) {
if(in_array($slot, $worked_slots)) {
array_push($results, $slot);
}
}
return $results;
}
function get_was_array($bands, $postdata) {
$CI =& get_instance();
$CI->load->model('logbooks_model');