From cee89b3966e4a0f56b3ed486409801fd01d7b420 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 9 May 2024 15:55:03 +0100 Subject: [PATCH] Added support for the GMDX Summer Challenge --- application/controllers/Awards.php | 63 ++++++++++++- application/models/Gmdxsummer_model.php | 86 ++++++++++++++++++ application/views/awards/gmdxsummer/index.php | 91 +++++++++++++++++++ application/views/interface_assets/header.php | 2 + 4 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 application/models/Gmdxsummer_model.php create mode 100644 application/views/awards/gmdxsummer/index.php diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 649fe31c..68e06755 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -515,12 +515,73 @@ class Awards extends CI_Controller $this->load->view('interface_assets/footer'); } + + public function gmdxsummer() + { + // Load the GMDX Summer Challenge model + $this->load->model('gmdxsummer_model'); + + // Get Week 1 + $data['week1_6m_cw'] = $this->gmdxsummer_model->get_week('2024-05-26 18:00:00', '6m', 'CW'); + $data['week1_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-05-26 18:00:00', '6m'); + $data['week1_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-05-26 18:00:00', '6m'); + $data['week1_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-05-26 18:00:00', '6m'); + + + $data['week1_4m_cw'] = $this->gmdxsummer_model->get_week('2024-05-26 18:00:00', '4m', 'CW'); + $data['week1_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-05-26 18:00:00', '4m'); + $data['week1_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-05-26 18:00:00', '4m'); + $data['week1_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-05-26 18:00:00', '4m'); + + // Get Week 2 + $data['week2_6m_cw'] = $this->gmdxsummer_model->get_week('2024-06-09 18:00:00', '6m', 'CW'); + $data['week2_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-09 18:00:00', '6m'); + $data['week2_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-09 18:00:00', '6m'); + $data['week2_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-09 18:00:00', '6m'); + + + $data['week2_4m_cw'] = $this->gmdxsummer_model->get_week('2024-06-09 18:00:00', '4m', 'CW'); + $data['week2_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-09 18:00:00', '4m'); + $data['week2_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-09 18:00:00', '4m'); + $data['week2_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-09 18:00:00', '4m'); + + + // Get Week 3 + $data['week3_6m_cw'] = $this->gmdxsummer_model->get_week('2024-06-23 18:00:00', '6m', 'CW'); + $data['week3_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-23 18:00:00', '6m'); + $data['week3_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-23 18:00:00', '6m'); + $data['week3_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-23 18:00:00', '6m'); + + $data['week3_4m_cw'] = $this->gmdxsummer_model->get_week('2024-06-23 18:00:00', '4m', 'CW'); + $data['week3_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-23 18:00:00', '4m'); + $data['week3_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-23 18:00:00', '4m'); + $data['week3_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-23 18:00:00', '4m'); + + // Get Week 4 + $data['week4_6m_cw'] = $this->gmdxsummer_model->get_week('2024-07-01 18:00:00', '6m', 'CW'); + $data['week4_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-07-01 18:00:00', '6m'); + $data['week4_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-07-01 18:00:00', '6m'); + $data['week4_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-07-01 18:00:00', '6m'); + + $data['week4_4m_cw'] = $this->gmdxsummer_model->get_week('2024-07-01 18:00:00', '4m', 'CW'); + $data['week4_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-07-01 18:00:00', '4m'); + $data['week4_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-07-01 18:00:00', '4m'); + $data['week4_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-07-01 18:00:00', '4m'); + + + // Render page + $data['page_title'] = "Awards - GMDX Summer Challenge"; + $this->load->view('interface_assets/header', $data); + $this->load->view('awards/gmdxsummer/index'); + $this->load->view('interface_assets/footer'); + } + public function wab_details_ajax() { $this->load->model('logbook_model'); $wab = str_replace('"', "", $this->security->xss_clean($this->input->post("Wab"))); - + $wab = str_replace(["Small Square ", " Boundry Box"], "", $wab); $data['results'] = $this->logbook_model->wab_qso_details($wab); diff --git a/application/models/Gmdxsummer_model.php b/application/models/Gmdxsummer_model.php new file mode 100644 index 00000000..ad9ff67a --- /dev/null +++ b/application/models/Gmdxsummer_model.php @@ -0,0 +1,86 @@ +config->item('table_name'); + + $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) . "'"; + + $query = $this->db->query(" + SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count + FROM " . $table_name . " + WHERE station_id in (" . $location_list . ") AND COL_MODE = '" . $mode . "' AND COL_BAND = '" . $band . "' + AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '. $end_date .') + "); + + return $query->row()->count; + } + + public function get_week_voice($end_date, $band) + { + $table_name = $this->config->item('table_name'); + + $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) . "'"; + + $query = $this->db->query(" + SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count + FROM " . $table_name . " + WHERE station_id in (".$location_list.") AND COL_MODE IN ('SSB', 'AM', 'FM') AND COL_BAND = '" . $band . "' + AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "') + "); + + + return $query->row()->count; + } + + public function get_week_digital($end_date, $band) + { + $table_name = $this->config->item('table_name'); + + $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) . "'"; + + $query = $this->db->query(" + SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count + FROM " . $table_name . " + WHERE station_id in (".$location_list.") AND COL_MODE NOT IN ('CW', 'FM', 'SSB', 'AM') AND COL_BAND = '" . $band . "' + AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "') + "); + + return $query->row()->count; + } + + public function get_week_combined($end_date, $band) + { + $table_name = $this->config->item('table_name'); + + $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) . "'"; + + $query = $this->db->query(" + SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count + FROM " . $table_name . " + WHERE station_id in (".$location_list.") AND COL_BAND = '" . $band . "' + AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "') + "); + + return $query->row()->count; + } +} diff --git a/application/views/awards/gmdxsummer/index.php b/application/views/awards/gmdxsummer/index.php new file mode 100644 index 00000000..98d6592d --- /dev/null +++ b/application/views/awards/gmdxsummer/index.php @@ -0,0 +1,91 @@ +
+ + +
+
+

+
+ + +
+
+ What is the GMDX Summer Challenge? +
+
+

The GMDX Summer Challenge will takes place over 6 weeks beginning 00:00 on Monday 13th May until 2359 on Sunday 30th June.

+

The Summer Challenge is a single event using CW, SSB or Digital Modes on both 4m and 6m. GMDX members are expected not to set up FT8 in automated robot mode. You are trusted to operate your station manually.

+

The overall winner will have worked the most 4 digit maidenhead locator squares (eg IO75) on 4m and 6m to give the highest combined score. DXCC Countries are not counted, only locator squares. In order to have the leading score, it is expected operators would have to make contacts on both 4m and 6m using all modes.

+

All GMDX members worldwide are welcome to enter.

+ Submit your entry +
+
+ +
+
+ Fortnightly Breakdown +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Week6m SSB6m CW6m Digital6m Combined4m SSB4m CW4m Digital4m Combined
18:00 on Sunday 26th May
18:00 on Sunday 9th June
18:00 on Sunday 23th June
18:00 on Monday 1st July
+
+
+
\ No newline at end of file diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index b25a9091..7617ed9a 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -161,6 +161,8 @@ + GMDX Summer Challenge +