Cloudlog/application/controllers/Lookup.php

44 行
708 B
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Data lookup functions used within Cloudlog
*/
class Lookup extends CI_Controller {
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 != "") {
echo $log_calls."<br><br>";
}
// SCP results from master scp db
$file = 'updates/masterscp.txt';
$lines = file($file, FILE_IGNORE_NEW_LINES);
2019-08-15 18:53:32 +08:00
$input = preg_quote($call, '~');
$result = preg_grep('~' . $input . '~', $lines, 0);
foreach ($result as &$value) {
2019-08-15 18:53:32 +08:00
echo " ".$value. " ";
}
}
2019-08-15 18:54:18 +08:00
}