diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 2b74ebc8e..93368b715 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -99,66 +99,68 @@ class Awards extends CI_Controller { public function dxcc () { $this->load->model('dxcc'); - $this->load->model('modes'); - $this->load->model('bands'); + $this->load->model('modes'); + $this->load->model('bands'); - $data['worked_bands'] = $this->bands->get_worked_bands('dxcc'); // Used in the view for band select - $data['modes'] = $this->modes->active(); // Used in the view for mode select + $data['worked_bands'] = $this->bands->get_worked_bands('dxcc'); // Used in the view for band select + $data['modes'] = $this->modes->active(); // Used in the view for mode select - if ($this->input->post('band') != NULL) { // Band is not set when page first loads. - if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands - $bands = $data['worked_bands']; - } - else { - $bands[] = $this->security->xss_clean($this->input->post('band')); - } - } - else { - $bands = $data['worked_bands']; - } + if ($this->input->post('band') != NULL) { // Band is not set when page first loads. + if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands + $bands = $data['worked_bands']; + } + else { + $bands[] = $this->security->xss_clean($this->input->post('band')); + } + } + else { + $bands = $data['worked_bands']; + } - $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view + $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view - if($this->input->method() === 'post') { - $postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl')); - $postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw')); - $postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl')); - $postdata['worked'] = $this->security->xss_clean($this->input->post('worked')); - $postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed')); - $postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked')); - $postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted')); - $postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa')); - $postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia')); - $postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe')); - $postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica')); - $postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica')); - $postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania')); - $postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica')); - $postdata['band'] = $this->security->xss_clean($this->input->post('band')); - $postdata['mode'] = $this->security->xss_clean($this->input->post('mode')); - } - else { // Setting default values at first load of page - $postdata['qsl'] = 1; - $postdata['lotw'] = 1; - $postdata['eqsl'] = 0; - $postdata['worked'] = 1; - $postdata['confirmed'] = 1; - $postdata['notworked'] = 1; - $postdata['includedeleted'] = 0; - $postdata['Africa'] = 1; - $postdata['Asia'] = 1; - $postdata['Europe'] = 1; - $postdata['NorthAmerica'] = 1; - $postdata['SouthAmerica'] = 1; - $postdata['Oceania'] = 1; - $postdata['Antarctica'] = 1; - $postdata['band'] = 'All'; - $postdata['mode'] = 'All'; - } + if($this->input->method() === 'post') { + $postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl')); + $postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw')); + $postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl')); + $postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz')); + $postdata['worked'] = $this->security->xss_clean($this->input->post('worked')); + $postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed')); + $postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked')); + $postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted')); + $postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa')); + $postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia')); + $postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe')); + $postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica')); + $postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica')); + $postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania')); + $postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica')); + $postdata['band'] = $this->security->xss_clean($this->input->post('band')); + $postdata['mode'] = $this->security->xss_clean($this->input->post('mode')); + } + else { // Setting default values at first load of page + $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; + $postdata['qrz'] = 0; + $postdata['worked'] = 1; + $postdata['confirmed'] = 1; + $postdata['notworked'] = 1; + $postdata['includedeleted'] = 0; + $postdata['Africa'] = 1; + $postdata['Asia'] = 1; + $postdata['Europe'] = 1; + $postdata['NorthAmerica'] = 1; + $postdata['SouthAmerica'] = 1; + $postdata['Oceania'] = 1; + $postdata['Antarctica'] = 1; + $postdata['band'] = 'All'; + $postdata['mode'] = 'All'; + } $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, $postdata); + $data['dxcc_array'] = $this->dxcc->get_dxcc_array($dxcclist, $bands, $postdata); + $data['dxcc_summary'] = $this->dxcc->get_dxcc_summary($bands, $postdata); // Render Page $data['page_title'] = "Awards - DXCC"; @@ -317,6 +319,9 @@ class Awards extends CI_Controller { if (strpos($qsl, "E") !== false) { $qsltype[] = "eQSL"; } + if (strpos($qsl, "Z") !== false) { + $qsltype[] = "QRZ.com"; + } // Render Page $data['page_title'] = "Log View - " . $type; @@ -1172,6 +1177,7 @@ class Awards extends CI_Controller { $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['qrz'] = $this->input->post('qrz') == 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/Dxcc.php b/application/models/Dxcc.php index b02e940de..933f0e746 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -59,9 +59,8 @@ class DXCC extends CI_Model { } function get_dxcc_array($dxccArray, $bands, $postdata) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if (!$logbooks_locations_array) { return null; @@ -80,6 +79,9 @@ class DXCC extends CI_Model { if ($postdata['eqsl'] != NULL ) { $qsl .= "E"; } + if ($postdata['qrz'] != NULL ) { + $qsl .= "Z"; + } } foreach ($bands as $band) { // Looping through bands and entities to generate the array needed for display @@ -329,7 +331,7 @@ class DXCC extends CI_Model { function addQslToQuery($postdata) { $sql = ''; $qsl = array(); - if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + if ($postdata['qrz'] != NULL || $postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { $sql .= ' and ('; if ($postdata['qsl'] != NULL) { array_push($qsl, "col_qsl_rcvd = 'Y'"); @@ -340,6 +342,9 @@ class DXCC extends CI_Model { if ($postdata['eqsl'] != NULL) { array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); } + if ($postdata['qrz'] != NULL) { + array_push($qsl, "col_qrzcom_qso_download_status = 'Y'"); + } $sql .= implode(' or ', $qsl); $sql .= ')'; } diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 58959d311..e2651c753 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -94,6 +94,10 @@ input->post('eqsl')) echo ' checked="checked"'; ?> > +