diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index e333599dc..746be0461 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -314,7 +314,7 @@ class Statistics extends CI_Controller { $data['modes'] = $this->modes->active(); - $data['worked_bands'] = $this->bands->get_worked_bands(); + $data['worked_bands'] = $this->bands->get_worked_bands_eme(); // Set Page Title $data['page_title'] = __("EME Initials"); diff --git a/application/models/Bands.php b/application/models/Bands.php index cead11235..e7eabca48 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -391,6 +391,25 @@ class Bands extends CI_Model { return $worked_slots; } + + function get_worked_bands_eme() { + if (!$this->logbooks_locations_array) { + return array(); + } + + $location_list = "'".implode("','",$this->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 = 'EME'" + ); + $worked_slots = array(); + foreach($data->result() as $row){ + array_push($worked_slots, $row->COL_BAND); + } + + return $worked_slots; + } } ?> diff --git a/application/views/statistics/initials.php b/application/views/statistics/initials.php index ec406c1cb..905a3b06b 100644 --- a/application/views/statistics/initials.php +++ b/application/views/statistics/initials.php @@ -7,7 +7,6 @@