[DXCC identification] Implemented exception for KG4
这个提交包含在:
父节点
e63f3c8c6f
当前提交
057d851ee0
共有 1 个文件被更改,包括 51 次插入 和 39 次删除
|
|
@ -2086,7 +2086,6 @@ class Logbook_model extends CI_Model {
|
|||
* Check the dxxc_prefixes table and return (dxcc, country)
|
||||
*/
|
||||
public function check_dxcc_table($call, $date){
|
||||
$len = strlen($call);
|
||||
|
||||
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
|
||||
->where('call', $call)
|
||||
|
|
@ -2100,6 +2099,13 @@ class Logbook_model extends CI_Model {
|
|||
$row = $dxcc_exceptions->row_array();
|
||||
return array($row['adif'], $row['entity'], $row['cqz']);
|
||||
}
|
||||
|
||||
if (preg_match('/(^KG4)[A-Z09]{3,}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 6 char, it is USA
|
||||
$call = "K";
|
||||
}
|
||||
|
||||
$len = strlen($call);
|
||||
|
||||
// query the table, removing a character from the right until a match
|
||||
for ($i = $len; $i > 0; $i--){
|
||||
//printf("searching for %s\n", substr($call, 0, $i));
|
||||
|
|
@ -2124,7 +2130,6 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
|
||||
public function dxcc_lookup($call, $date){
|
||||
$len = strlen($call);
|
||||
|
||||
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
|
||||
->where('call', $call)
|
||||
|
|
@ -2139,6 +2144,13 @@ class Logbook_model extends CI_Model {
|
|||
$row = $dxcc_exceptions->row_array();
|
||||
return $row;
|
||||
} else {
|
||||
|
||||
if (preg_match('/(^KG4)[A-Z09]{3,}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 6 char, it is USA
|
||||
$call = "K";
|
||||
}
|
||||
|
||||
$len = strlen($call);
|
||||
|
||||
// query the table, removing a character from the right until a match
|
||||
for ($i = $len; $i > 0; $i--){
|
||||
//printf("searching for %s\n", substr($call, 0, $i));
|
||||
|
|
|
|||
正在加载…
在新工单中引用