diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 1130810c..4fa7d2ec 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -195,6 +195,14 @@ class Awards extends CI_Controller { $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type); + // This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC. + // We replace the values to make it look a bit nicer + if ($type == 'DXCC2') { + $type = 'DXCC'; + $dxccname = $this->logbook_model->get_entity($searchphrase); + $searchphrase = $dxccname['name']; + } + // Render Page $data['page_title'] = "Log View - " . $type; $data['filter'] = $type . " " . $searchphrase . " and band ".$band . " and mode ".$mode; diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index e2247d16..587fb7da 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -35,18 +35,18 @@ class Lookup extends CI_Controller { $data['bands'] = $this->lookup_model->get_Worked_Bands($station_id); - $queryinfo['type'] = xss_clean($this->input->post('type')); - $queryinfo['dxcc'] = xss_clean($this->input->post('dxcc')); - $queryinfo['was'] = xss_clean($this->input->post('was')); - $queryinfo['sota'] = xss_clean($this->input->post('sota')); - $queryinfo['grid'] = xss_clean($this->input->post('grid')); - $queryinfo['iota'] = xss_clean($this->input->post('iota')); - $queryinfo['cqz'] = xss_clean($this->input->post('cqz')); - $queryinfo['wwff'] = xss_clean($this->input->post('wwff')); - $queryinfo['station_id'] = $station_id; - $queryinfo['bands'] = $data['bands']; + $data['type'] = xss_clean($this->input->post('type')); + $data['dxcc'] = xss_clean($this->input->post('dxcc')); + $data['was'] = xss_clean($this->input->post('was')); + $data['sota'] = xss_clean($this->input->post('sota')); + $data['grid'] = xss_clean($this->input->post('grid')); + $data['iota'] = xss_clean($this->input->post('iota')); + $data['cqz'] = xss_clean($this->input->post('cqz')); + $data['wwff'] = xss_clean($this->input->post('wwff')); + $data['station_id'] = $station_id; + + $data['result'] = $this->lookup_model->getSearchResult($data); - $data['result'] = $this->lookup_model->getSearchResult($queryinfo); $this->load->view('lookup/result', $data); } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index f6d773c2..2a52ba5b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -244,6 +244,9 @@ class Logbook_model extends CI_Model { case 'DXCC': $this->db->where('COL_COUNTRY', $searchphrase); break; + case 'DXCC2': + $this->db->where('COL_DXCC', $searchphrase); + break; case 'IOTA': $this->db->where('COL_IOTA', $searchphrase); break; @@ -257,6 +260,13 @@ class Logbook_model extends CI_Model { $this->db->where('COL_STATE', $searchphrase); $this->db->where_in('COL_DXCC', ['291', '6', '110']); break; + case 'SOTA': + $this->db->where('COL_SOTA_REF', $searchphrase); + break; + case 'WWFF': + $this->db->where('COL_SIG', 'WWFF'); + $this->db->where('COL_SIG_INFO', $searchphrase); + break; } $this->db->where('station_id', $station_id); diff --git a/application/views/lookup/result.php b/application/views/lookup/result.php index fba7869a..0f968ac4 100644 --- a/application/views/lookup/result.php +++ b/application/views/lookup/result.php @@ -12,17 +12,33 @@ echo ' '; foreach ($result as $mode => $value) { echo ' - '. strtoupper($mode) .''; - foreach ($value as $key) { - if ($key == 'W') { - echo '
' . $key . '
'; + '. strtoupper($mode) .''; + foreach ($value as $key => $val) { + switch($type) { + case 'dxcc': $linkinfo = '' . $val . ''; break; + case 'iota': $linkinfo = '' . $val . ''; break; + case 'grid': $linkinfo = '' . $val . ''; break; + case 'cqz': $linkinfo = '' . $val . ''; break; + case 'was': $linkinfo = '' . $val . ''; break; + case 'sota': $linkinfo = '' . $val . ''; break; + case 'wwff': $linkinfo = '' . $val . ''; break; } - else if ($key == 'C') { - echo '
' . $key . '
'; + + $info = ''; + + if ($val == 'W') { + $info .= '
' . $linkinfo . '
'; + } + else if ($val == 'C') { + $info .= '
' . $linkinfo . '
'; } else { - echo '' . $key . ''; + $info .= $val; } + + $info .= ''; + + echo $info; } echo ''; }