Added logbook qsos to the scp lookup
这个提交包含在:
父节点
50fc45dd80
当前提交
d6d0e588af
共有 2 个文件被更改,包括 36 次插入 和 8 次删除
|
|
@ -13,22 +13,30 @@ class Lookup extends CI_Controller {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scp($string) {
|
public function scp($call) {
|
||||||
|
|
||||||
|
// SCP results from logbook
|
||||||
|
$this->load->model('logbook_model');
|
||||||
|
|
||||||
|
$log_calls = $this->logbook_model->get_callsigns($call);
|
||||||
|
|
||||||
|
if($log_calls != "") {
|
||||||
|
echo $log_calls."<br><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// SCP results from master scp db
|
||||||
$file = 'updates/masterscp.txt';
|
$file = 'updates/masterscp.txt';
|
||||||
|
|
||||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||||
|
|
||||||
$input = preg_quote($string, '~');
|
$input = preg_quote($call, '~');
|
||||||
|
|
||||||
$result = preg_grep('~' . $input . '~', $lines, 0);
|
$result = preg_grep('~' . $input . '~', $lines, 0);
|
||||||
|
|
||||||
$copy = $result;
|
|
||||||
foreach ($result as &$value) {
|
foreach ($result as &$value) {
|
||||||
echo $value;
|
echo " ".$value. " ";
|
||||||
|
|
||||||
if (next($copy )) {
|
|
||||||
echo ', '; // Add comma for all elements instead of last
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,26 @@ class Logbook_model extends CI_Model {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_callsigns($callsign){
|
||||||
|
$this->db->select('COL_CALL');
|
||||||
|
$this->db->distinct();
|
||||||
|
$this->db->like('COL_CALL', $callsign);
|
||||||
|
|
||||||
|
$query = $this->db->get($this->config->item('table_name'));
|
||||||
|
|
||||||
|
$result = "";
|
||||||
|
|
||||||
|
foreach ($query->result() as $row)
|
||||||
|
{
|
||||||
|
|
||||||
|
$result = $result." ".$row->COL_CALL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function add_qso($data) {
|
function add_qso($data) {
|
||||||
|
|
||||||
if ($data['COL_DXCC'] == "Not Found"){
|
if ($data['COL_DXCC'] == "Not Found"){
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用