Hopefully fixes possible ADIF import bug

pull/170/head
Peter Goodhall 2014-09-25 23:09:44 +01:00
rodzic 8cd03dd563
commit 3f657de322
3 zmienionych plików z 147 dodań i 139 usunięć

Wyświetl plik

@ -70,7 +70,7 @@ class adif extends CI_Controller {
$data['page_title'] = "ADIF Import";
$config['upload_path'] = './uploads/';
$config['upload_path'] = 'uploads/';
$config['allowed_types'] = 'adi|ADI';
$this->load->library('upload', $config);

Wyświetl plik

@ -28,7 +28,7 @@ class DXCC extends CI_Model {
$query = $this->db->query('
SELECT *
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
LIMIT 1
');

Wyświetl plik

@ -694,9 +694,14 @@ class Logbook_model extends CI_Model {
}
// 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']);
$freq = $cleansedstring."000";
} elseif($freqlng >= 7) {
$cleansedstring = preg_replace('#\W#', '', $record['freq']);
$freq = $cleansedstring;
} else {
$freq = "0";
}
@ -743,11 +748,12 @@ class Logbook_model extends CI_Model {
$this->load->model('dxcc');
$dxccinfo = $this->dxcc->info($record['call']);
echo "find dxcc<br>";
if ($dxccinfo->num_rows() > 0)
{
foreach ($dxccinfo->result() as $row1)
{
print_r($row1);
$country = ucfirst(strtolower($row1->name));
}
} else {
@ -755,6 +761,8 @@ class Logbook_model extends CI_Model {
}
}
echo $country;
// Store QTH
if(isset($record['qth'])) {
$qth = $record['qth'];