kopia lustrzana https://github.com/magicbug/Cloudlog
Added logbook qsos to the scp lookup
rodzic
50fc45dd80
commit
d6d0e588af
|
@ -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';
|
||||
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
|
||||
$input = preg_quote($string, '~');
|
||||
$input = preg_quote($call, '~');
|
||||
|
||||
$result = preg_grep('~' . $input . '~', $lines, 0);
|
||||
|
||||
$copy = $result;
|
||||
foreach ($result as &$value) {
|
||||
echo $value;
|
||||
|
||||
if (next($copy )) {
|
||||
echo ', '; // Add comma for all elements instead of last
|
||||
}
|
||||
echo " ".$value. " ";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
||||
if ($data['COL_DXCC'] == "Not Found"){
|
||||
|
|
Ładowanie…
Reference in New Issue