Hopefully fixes possible ADIF import bug
这个提交包含在:
父节点
8cd03dd563
当前提交
3f657de322
共有 3 个文件被更改,包括 147 次插入 和 139 次删除
|
|
@ -70,7 +70,7 @@ class adif extends CI_Controller {
|
||||||
|
|
||||||
$data['page_title'] = "ADIF Import";
|
$data['page_title'] = "ADIF Import";
|
||||||
|
|
||||||
$config['upload_path'] = './uploads/';
|
$config['upload_path'] = 'uploads/';
|
||||||
$config['allowed_types'] = 'adi|ADI';
|
$config['allowed_types'] = 'adi|ADI';
|
||||||
|
|
||||||
$this->load->library('upload', $config);
|
$this->load->library('upload', $config);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class DXCC extends CI_Model {
|
||||||
$query = $this->db->query('
|
$query = $this->db->query('
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM dxcc
|
FROM dxcc
|
||||||
WHERE prefix = SUBSTRING( \''.$callsign.'\', 1, LENGTH( prefix ) ) AND end_date = "0000-00-00 00:00:00"
|
WHERE prefix = SUBSTRING( \''.$callsign.'\', 1, LENGTH( prefix ) )
|
||||||
ORDER BY LENGTH( prefix ) DESC
|
ORDER BY LENGTH( prefix ) DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
');
|
');
|
||||||
|
|
|
||||||
|
|
@ -694,9 +694,14 @@ class Logbook_model extends CI_Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store Freq
|
// Store Freq
|
||||||
if(isset($record['freq'])) {
|
$cleanfreq = preg_replace('#\W#', '', $record['freq']);
|
||||||
|
$freqlng = strlen($cleanfreq);
|
||||||
|
if(isset($record['freq']) && $freqlng < 7 ) {
|
||||||
$cleansedstring = preg_replace('#\W#', '', $record['freq']);
|
$cleansedstring = preg_replace('#\W#', '', $record['freq']);
|
||||||
$freq = $cleansedstring."000";
|
$freq = $cleansedstring."000";
|
||||||
|
} elseif($freqlng >= 7) {
|
||||||
|
$cleansedstring = preg_replace('#\W#', '', $record['freq']);
|
||||||
|
$freq = $cleansedstring;
|
||||||
} else {
|
} else {
|
||||||
$freq = "0";
|
$freq = "0";
|
||||||
}
|
}
|
||||||
|
|
@ -743,11 +748,12 @@ class Logbook_model extends CI_Model {
|
||||||
$this->load->model('dxcc');
|
$this->load->model('dxcc');
|
||||||
|
|
||||||
$dxccinfo = $this->dxcc->info($record['call']);
|
$dxccinfo = $this->dxcc->info($record['call']);
|
||||||
|
echo "find dxcc<br>";
|
||||||
if ($dxccinfo->num_rows() > 0)
|
if ($dxccinfo->num_rows() > 0)
|
||||||
{
|
{
|
||||||
foreach ($dxccinfo->result() as $row1)
|
foreach ($dxccinfo->result() as $row1)
|
||||||
{
|
{
|
||||||
|
print_r($row1);
|
||||||
$country = ucfirst(strtolower($row1->name));
|
$country = ucfirst(strtolower($row1->name));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -755,6 +761,8 @@ class Logbook_model extends CI_Model {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo $country;
|
||||||
|
|
||||||
// Store QTH
|
// Store QTH
|
||||||
if(isset($record['qth'])) {
|
if(isset($record['qth'])) {
|
||||||
$qth = $record['qth'];
|
$qth = $record['qth'];
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用