Add support for Club Log SCP

Add update_clublog_scp() method for fetching the Club Log SCP file.  Update Lookup to merge masterscp.txt and clublog_scp.txt together when both are available.
This commit is contained in:
Michael Wells
2019-10-09 13:54:07 +01:00
parent 80145b4732
commit 36fce11666
2 changed files with 59 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ class Lookup extends CI_Controller {
echo $log_calls ." ";
}
$arCalls = array();
// SCP results from master scp db
$file = 'updates/masterscp.txt';
@@ -46,10 +46,30 @@ class Lookup extends CI_Controller {
$result = preg_grep('~' . $input . '~', $lines, 0);
foreach ($result as &$value) {
echo " ".$value. " ";
$arCalls[] = $value;
}
}
}
// SCP from Club Log
$file = "updates/clublog_scp.txt";
if (is_readable($file)) {
$lines = file($file, FILE_IGNORE_NEW_LINES);
foreach ($lines as $strCall)
{
if (in_array($strCall, $arCalls) == false)
{
$arCalls[] = $value;
}
}
}
sort($arCalls);
foreach ($arCalls as $strCall)
{
echo " " . $strCall . " ";
}
}
}