Merge pull request #1115 from AndreasK79/quick_lookup_info_enhancement

[Quick lookup] Added clickable links so that you can see the qso info…
pull/1119/head
Peter Goodhall 2021-07-30 13:44:48 +01:00 zatwierdzone przez GitHub
commit 13b9e808f6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 52 dodań i 18 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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);

Wyświetl plik

@ -12,17 +12,33 @@ echo '
<tbody>';
foreach ($result as $mode => $value) {
echo '<tr>
<td>'. strtoupper($mode) .'</td>';
foreach ($value as $key) {
if ($key == 'W') {
echo '<td><div class=\'alert-danger\'>' . $key . '</div></td>';
<td>'. strtoupper($mode) .'</td>';
foreach ($value as $key => $val) {
switch($type) {
case 'dxcc': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $dxcc).'","' . $key . '","' . $mode . '","DXCC2")\'>' . $val . '</a>'; break;
case 'iota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $iota).'","' . $key . '","' . $mode . '","IOTA")\'>' . $val . '</a>'; break;
case 'grid': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $grid).'","' . $key . '","' . $mode . '","VUCC")\'>' . $val . '</a>'; break;
case 'cqz': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cqz).'","' . $key . '","' . $mode . '","CQZone")\'>' . $val . '</a>'; break;
case 'was': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $was).'","' . $key . '","' . $mode . '","WAS")\'>' . $val . '</a>'; break;
case 'sota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $sota).'","' . $key . '","' . $mode . '","SOTA")\'>' . $val . '</a>'; break;
case 'wwff': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wwff).'","' . $key . '","' . $mode . '","WWFF")\'>' . $val . '</a>'; break;
}
else if ($key == 'C') {
echo '<td><div class=\'alert-success\'>' . $key . '</div></td>';
$info = '<td>';
if ($val == 'W') {
$info .= '<div class=\'alert-danger\'>' . $linkinfo . '</div>';
}
else if ($val == 'C') {
$info .= '<div class=\'alert-success\'>' . $linkinfo . '</div>';
}
else {
echo '<td>' . $key . '</td>';
$info .= $val;
}
$info .= '</td>';
echo $info;
}
echo '</tr>';
}