From f418778947178d53dd847aa5a0f8847a27029e90 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 19 Aug 2020 16:25:59 +0100 Subject: [PATCH] Revert "Merge pull request #579 from AndreasK79/dxcc_summary_fix" This reverts commit 0365a874760593cc3e9b5e5ddbe4fb8f876d6257, reversing changes made to 87bb8be156c93fc85146fa384bf85c1edc6d4927. --- application/controllers/Awards.php | 1 - application/models/Dxcc.php | 57 -------------------- application/views/awards/dxcc/index.php | 70 +++++++------------------ 3 files changed, 20 insertions(+), 108 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 638d922c..d1e4d9cf 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -128,7 +128,6 @@ class Awards extends CI_Controller { $dxcclist = $this->dxcc->fetchdxcc($postdata); $data['dxcc_array'] = $this->dxcc->get_dxcc_array($dxcclist, $bands, $postdata); - $data['dxcc_summary'] = $this->dxcc->get_dxcc_summary($bands); // Render Page $data['page_title'] = "Awards - DXCC"; diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index adac88f0..6cfd44cc 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -463,62 +463,5 @@ class DXCC extends CI_Model { } return $sql; } - - /* - * Function gets worked and confirmed summary on each band on the active stationprofile - */ - function get_dxcc_summary($bands) - { - $CI =& get_instance(); - $CI->load->model('Stations'); - $station_id = $CI->Stations->find_active(); - - foreach ($bands as $band) { - $worked = $this->getSummaryByBand($band, $station_id); - $confirmed = $this->getSummaryByBandConfirmed($band, $station_id); - $dxccSummary['worked'][$band] = $worked[0]->count; - $dxccSummary['confirmed'][$band] = $confirmed[0]->count; - } - - return $dxccSummary; - } - - function getSummaryByBand($band, $station_id) - { - $sql = "SELECT thcv.col_band, count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv"; - - $sql .= " where station_id = " . $station_id; - - if ($band == 'SAT') { - $sql .= " and thcv.col_prop_mode ='" . $band . "'"; - } else { - $sql .= " and thcv.col_prop_mode !='SAT'"; - $sql .= " and thcv.col_band ='" . $band . "'"; - - } - $query = $this->db->query($sql); - - return $query->result(); - } - - function getSummaryByBandConfirmed($band, $station_id) - { - $sql = "SELECT thcv.col_band, count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv"; - - $sql .= " where station_id = " . $station_id; - - if ($band == 'SAT') { - $sql .= " and thcv.col_prop_mode ='" . $band . "'"; - } else { - $sql .= " and thcv.col_prop_mode !='SAT'"; - $sql .= " and thcv.col_band ='" . $band . "'"; - } - - $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; - - $query = $this->db->query($sql); - - return $query->result(); - } } ?> diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 5f9771b0..ca54f6f9 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -1,9 +1,9 @@
-

- - +

+ + load->view("awards/nav_bar")?>
@@ -93,9 +93,9 @@
@@ -112,7 +112,7 @@ - input->post('includedeleted') || $this->input->method() !== 'post') echo ' Deleted'; - foreach($bands as $band) { - echo '' . $band . ''; - } - echo ' + foreach($bands as $band) { + echo '' . $band . ''; + } + echo ' '; - foreach ($dxcc_array as $dxcc => $value) { // Fills the table with the data - echo ' + foreach ($dxcc_array as $dxcc => $value) { // Fills the table with the data + echo ' '. $i++ .''; - foreach ($value as $key) { - echo '' . $key . ''; - } - echo ''; - } - echo ' -

Summary

- - - - '; - - foreach($bands as $band) { - echo ''; - } - echo ''; - - echo ' - - - - '; - - foreach ($dxcc_summary['worked'] as $dxcc) { // Fills the table with the data - echo ''; - } - - echo ' - '; - foreach ($dxcc_summary['confirmed'] as $dxcc) { // Fills the table with the data - echo ''; - } - - echo ' -
' . $band . '
Total worked' . $dxcc . '
Total confirmed' . $dxcc . '
- '; + foreach ($value as $key) { + echo '' . $key . ''; + } + echo ''; + } + echo ''; } else { echo ''; } - ?> +?>