Cloudlog/application/controllers/Lookup.php

56 行
977 B
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Data lookup functions used within Cloudlog
*/
class Lookup extends CI_Controller {
2019-10-06 02:35:55 +08:00
function __construct()
{
parent::__construct();
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}
public function index()
{
}
2019-08-15 18:53:32 +08:00
public function scp($call) {
// SCP results from logbook
$this->load->model('logbook_model');
$log_calls = $this->logbook_model->get_callsigns($call);
if($log_calls != "") {
2019-08-15 18:57:56 +08:00
echo $log_calls ." ";
2019-08-15 18:53:32 +08:00
}
// SCP results from master scp db
$file = 'updates/masterscp.txt';
if (is_readable($file)) {
$lines = file($file, FILE_IGNORE_NEW_LINES);
$input = preg_quote($call, '~');
$result = preg_grep('~' . $input . '~', $lines, 0);
foreach ($result as &$value) {
echo " ".$value. " ";
}
}
}
2019-08-15 18:54:18 +08:00
}