Ability to search for QSOs with IOTA refs eg eu-008
这个提交包含在:
父节点
6b3ab6c543
当前提交
bcb01b7423
共有 3 个文件被更改,包括 64 次插入 和 31 次删除
|
|
@ -277,31 +277,44 @@ class Logbook extends CI_Controller {
|
||||||
|
|
||||||
$data['results'] = $query;
|
$data['results'] = $query;
|
||||||
|
|
||||||
$this->load->view('search/result_search.php', $data);
|
$this->load->view('search/result_search.php', $data);
|
||||||
} else {
|
} else {
|
||||||
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) {
|
|
||||||
// Lookup using QRZ
|
|
||||||
|
|
||||||
$this->load->library('qrz');
|
|
||||||
|
|
||||||
if(!$this->session->userdata('qrz_session_key')) {
|
|
||||||
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
|
|
||||||
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'));
|
$this->load->model('search');
|
||||||
|
|
||||||
|
$iota_search = $this->search->callsign_iota($id);
|
||||||
|
|
||||||
|
|
||||||
|
if ($iota_search->num_rows() > 0)
|
||||||
|
{
|
||||||
|
$data['results'] = $iota_search;
|
||||||
|
$this->load->view('search/result_search.php', $data);
|
||||||
} else {
|
} else {
|
||||||
// Lookup using hamio
|
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) {
|
||||||
$this->load->library('hamio');
|
// Lookup using QRZ
|
||||||
|
|
||||||
$data['callsign'] = $this->hamio->callsign($id);
|
$this->load->library('qrz');
|
||||||
}
|
|
||||||
|
if(!$this->session->userdata('qrz_session_key')) {
|
||||||
$data['id'] = strtoupper($id);
|
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
|
||||||
|
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'));
|
||||||
|
|
||||||
$this->load->view('search/result', $data);
|
|
||||||
|
} else {
|
||||||
|
// Lookup using hamio
|
||||||
|
$this->load->library('hamio');
|
||||||
|
|
||||||
|
$data['callsign'] = $this->hamio->callsign($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$data['id'] = strtoupper($id);
|
||||||
|
|
||||||
|
$this->load->view('search/result', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,20 @@ class Search extends CI_Controller {
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->load->model('user_model');
|
// Auth check
|
||||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
|
$this->load->model('user_model');
|
||||||
if($this->user_model->validate_session()) {
|
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
|
||||||
$this->user_model->clear_session();
|
if($this->user_model->validate_session()) {
|
||||||
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403);
|
$this->user_model->clear_session();
|
||||||
} else {
|
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403);
|
||||||
redirect('user/login');
|
} else {
|
||||||
}
|
redirect('user/login');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data['page_title'] = "Search";
|
$data['page_title'] = "Search";
|
||||||
|
|
||||||
$this->load->view('layout/header', $data);
|
$this->load->view('layout/header', $data);
|
||||||
$this->load->view('search/main');
|
$this->load->view('search/main');
|
||||||
$this->load->view('layout/footer');
|
$this->load->view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
application/models/search.php
普通文件
19
application/models/search.php
普通文件
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Search extends CI_Model {
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
function callsign_iota($reference) {
|
||||||
|
$this->db->where('COL_IOTA', $reference);
|
||||||
|
$query = $this->db->get($this->config->item('table_name'));
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
正在加载…
在新工单中引用