diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index cd7d9290..ac7ab5ec 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -359,8 +359,9 @@ class Awards extends CI_Controller { $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view if($this->input->method() === 'post') { - $postdata['lotw'] = $this->input->post('lotw'); $postdata['qsl'] = $this->input->post('qsl'); + $postdata['lotw'] = $this->input->post('lotw'); + $postdata['eqsl'] = $this->input->post('eqsl'); $postdata['worked'] = $this->input->post('worked'); $postdata['confirmed'] = $this->input->post('confirmed'); $postdata['notworked'] = $this->input->post('notworked'); @@ -368,8 +369,9 @@ class Awards extends CI_Controller { $postdata['mode'] = $this->input->post('mode'); } else { // Setting default values at first load of page - $postdata['lotw'] = 1; $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; @@ -639,8 +641,9 @@ class Awards extends CI_Controller { $bands[] = $this->input->post('band'); - $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; $postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1; + $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; + $postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1; $postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1; $postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1; $postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1; diff --git a/application/models/Cq.php b/application/models/Cq.php index 03915fa1..b4fecee5 100644 --- a/application/models/Cq.php +++ b/application/models/Cq.php @@ -24,6 +24,19 @@ class CQ extends CI_Model{ $cqZ[$i]['count'] = 0; // Inits each cq zone's count } + $qsl = ""; + if ($postdata['confirmed'] != NULL) { + if ($postdata['qsl'] != NULL ) { + $qsl .= "Q"; + } + if ($postdata['lotw'] != NULL ) { + $qsl .= "L"; + } + if ($postdata['eqsl'] != NULL ) { + $qsl .= "E"; + } + } + foreach ($bands as $band) { for ($i = 1; $i <= 40; $i++) { $bandCq[$i][$band] = '-'; // Sets all to dash to indicate no result @@ -32,14 +45,14 @@ class CQ extends CI_Model{ if ($postdata['worked'] != NULL) { $cqBand = $this->getCQWorked($location_list, $band, $postdata); foreach ($cqBand as $line) { - $bandCq[$line->col_cqz][$band] = '
col_cqz) . '","' . $band . '","'. $postdata['mode'] . '","CQZone")\'>W
'; + $bandCq[$line->col_cqz][$band] = '
col_cqz) . '","' . $band . '","'. $postdata['mode'] . '","CQZone","")\'>W
'; $cqZ[$line->col_cqz]['count']++; } } if ($postdata['confirmed'] != NULL) { $cqBand = $this->getCQConfirmed($location_list, $band, $postdata); foreach ($cqBand as $line) { - $bandCq[$line->col_cqz][$band] = '
col_cqz) . '","' . $band . '","'. $postdata['mode'] . '","CQZone")\'>C
'; + $bandCq[$line->col_cqz][$band] = '
col_cqz) . '","' . $band . '","'. $postdata['mode'] . '","CQZone","'.$qsl.'")\'>C
'; $cqZ[$line->col_cqz]['count']++; } } @@ -132,16 +145,20 @@ class CQ extends CI_Model{ function addQslToQuery($postdata) { $sql = ''; - if ($postdata['lotw'] != NULL and $postdata['qsl'] == NULL) { - $sql .= " and col_lotw_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL and $postdata['lotw'] == NULL) { - $sql .= " and col_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL && $postdata['lotw'] != NULL) { - $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; + $qsl = array(); + if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + $sql .= ' and ('; + if ($postdata['qsl'] != NULL) { + array_push($qsl, "col_qsl_rcvd = 'Y'"); + } + if ($postdata['lotw'] != NULL) { + array_push($qsl, "col_lotw_qsl_rcvd = 'Y'"); + } + if ($postdata['eqsl'] != NULL) { + array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); + } + $sql .= implode(' or ', $qsl); + $sql .= ')'; } return $sql; } diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index e5cd4476..23c64037 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -57,7 +57,7 @@
-
QSL / LoTW
+
QSL Type
input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > @@ -67,6 +67,10 @@ input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
+
+ input->post('eqsl')) echo ' checked="checked"'; ?> > + +
@@ -201,4 +205,4 @@ - \ No newline at end of file +