Hopefully fixes possible ADIF import bug

这个提交包含在:
Peter Goodhall 2014-09-25 23:09:44 +01:00
父节点 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'];