From 390a9e5e06676545048a0b09a6c770f16781e3f1 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 14:58:41 +0100 Subject: [PATCH 1/6] Retain selected checkboxes so that you know what you filtered --- application/views/awards/dxcc/index.php | 34 +++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index eadf2616..07e2fe26 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -10,10 +10,10 @@
-
Deleted dxcc
+
Deleted DXCC
- + input->post('includedeleted') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
@@ -24,15 +24,15 @@
Worked / confirmed
- + input->post('worked') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('confirmed') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('notworked') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
@@ -42,11 +42,11 @@
QSL / LoTW
- + input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
@@ -56,31 +56,31 @@
Continents
- + input->post('Antarctica') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('Africa') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('Asia') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('Europe') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('NorthAmerica') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('SouthAmerica') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
- + input->post('Oceania') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
@@ -91,9 +91,11 @@
From 3f036e91d4c024b33d9918370f9a513bd0a3fb2e Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 15:16:46 +0100 Subject: [PATCH 2/6] Fix error if nothing is selected at all in Awards --- application/models/Dxcc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 1d677793..162fa45e 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -223,7 +223,7 @@ class DXCC extends CI_Model { } } - if ($dxccMatrix) { + if (isset($dxccMatrix)) { return $dxccMatrix; } else { From 1aa2741351b97c074c1aa5768d65c354ecf15d14 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 15:22:36 +0100 Subject: [PATCH 3/6] Do not store div design in array --- application/models/Dxcc.php | 2 +- application/views/awards/dxcc/index.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 162fa45e..90b3d3d6 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -182,7 +182,7 @@ class DXCC extends CI_Model { foreach ($dxccArray as $dxcc) { $dxccMatrix[$dxcc->adif]['name'] = $dxcc->name; $dxccMatrix[$dxcc->adif]['Dxccprefix'] = $dxcc->prefix; - $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "
Y
" : ''; + $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "Y" : ''; $dxccMatrix[$dxcc->adif][$band] = '-'; } diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 07e2fe26..07b8ba71 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -134,7 +134,10 @@ echo ' '. $i++ .''; foreach ($value as $key) { - echo '' . $key . ''; + echo ''; + if ($key == "Y") + echo '
'; + echo $key . ''; } echo ''; } From 8cd5c690d68404164cb1ffdb16ced0a806916f40 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 15:48:50 +0100 Subject: [PATCH 4/6] Fix nasty bug with deleted vs. includedeleted --- application/controllers/Awards.php | 6 +++--- application/models/Dxcc.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 7c59467f..ff6a5117 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -99,7 +99,7 @@ class Awards extends CI_Controller { $postdata['worked'] = $this->input->post('worked'); $postdata['confirmed'] = $this->input->post('confirmed'); $postdata['notworked'] = $this->input->post('notworked'); - $postdata['deleted'] = $this->input->post('deleted'); + $postdata['includedeleted'] = $this->input->post('includedeleted'); $postdata['Africa'] = $this->input->post('Africa'); $postdata['Asia'] = $this->input->post('Asia'); $postdata['Europe'] = $this->input->post('Europe'); @@ -115,7 +115,7 @@ class Awards extends CI_Controller { $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; - $postdata['deleted'] = 1; + $postdata['includedeleted'] = 1; $postdata['Africa'] = 1; $postdata['Asia'] = 1; $postdata['Europe'] = 1; @@ -259,4 +259,4 @@ class Awards extends CI_Controller { $this->load->view('interface_assets/footer'); } -} \ No newline at end of file +} diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 90b3d3d6..b845c574 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -250,7 +250,7 @@ class DXCC extends CI_Model { $sql .= " group by col_dxcc ) x on dxcc_entities.adif = x.col_dxcc"; - if ($postdata['deleted'] == NULL) { + if ($postdata['includedeleted'] == NULL) { $sql .= " and dxcc_entities.end is null"; } @@ -278,7 +278,7 @@ class DXCC extends CI_Model { $sql .= " group by col_dxcc ) x on dxcc_entities.adif = x.col_dxcc";; - if ($postdata['deleted'] == NULL) { + if ($postdata['includedeleted'] == NULL) { $sql .= " and dxcc_entities.end is null"; } @@ -314,7 +314,7 @@ class DXCC extends CI_Model { $sql .= " where 1 = 1"; - if ($postdata['deleted'] == NULL) { + if ($postdata['includedeleted'] == NULL) { $sql .= " and end is null"; } @@ -362,7 +362,7 @@ class DXCC extends CI_Model { ) ll on dxcc_entities.adif = ll.col_dxcc where 1=1"; - if ($postdata['deleted'] == 'false') { + if ($postdata['includedeleted'] == 'false') { $sql .= " and dxcc_entities.end is null"; } @@ -396,7 +396,7 @@ class DXCC extends CI_Model { ) ll on dxcc_entities.adif = ll.col_dxcc where 1=1"; - if ($postdata['deleted'] == 'false') { + if ($postdata['includedeleted'] == 'false') { $sql .= " and dxcc_entities.end is null"; } From fe286bd74c254ee5813e4341b87665be55d639fb Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 17:03:55 +0100 Subject: [PATCH 5/6] Revert "Do not store div design in array" This reverts commit 1aa2741351b97c074c1aa5768d65c354ecf15d14. --- application/models/Dxcc.php | 2 +- application/views/awards/dxcc/index.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index b845c574..e82cee7e 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -182,7 +182,7 @@ class DXCC extends CI_Model { foreach ($dxccArray as $dxcc) { $dxccMatrix[$dxcc->adif]['name'] = $dxcc->name; $dxccMatrix[$dxcc->adif]['Dxccprefix'] = $dxcc->prefix; - $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "Y" : ''; + $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "
Y
" : ''; $dxccMatrix[$dxcc->adif][$band] = '-'; } diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 07b8ba71..07e2fe26 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -134,10 +134,7 @@ echo ' '. $i++ .''; foreach ($value as $key) { - echo ''; - if ($key == "Y") - echo '
'; - echo $key . ''; + echo '' . $key . ''; } echo ''; } From 5accdc248f7c757db79cff32497ad29008c1a4f5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 5 Mar 2020 17:09:53 +0100 Subject: [PATCH 6/6] Omit "Deleted" columen if deleted DXCCs are not included --- application/models/Dxcc.php | 3 ++- application/views/awards/dxcc/index.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index e82cee7e..63c3fb1a 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -182,7 +182,8 @@ class DXCC extends CI_Model { foreach ($dxccArray as $dxcc) { $dxccMatrix[$dxcc->adif]['name'] = $dxcc->name; $dxccMatrix[$dxcc->adif]['Dxccprefix'] = $dxcc->prefix; - $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "
Y
" : ''; + if ($postdata['includedeleted']) + $dxccMatrix[$dxcc->adif]['Deleted'] = isset($dxcc->Enddate) ? "
Y
" : ''; $dxccMatrix[$dxcc->adif][$band] = '-'; } diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 07e2fe26..ca54f6f9 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -122,7 +122,9 @@ # DXCCName - Prefix + Prefix'; + if ($this->input->post('includedeleted') || $this->input->method() !== 'post') + echo ' Deleted'; foreach($bands as $band) { echo '' . $band . '';