kopia lustrzana https://github.com/magicbug/Cloudlog
Improved ADIF code
rodzic
36b89a5463
commit
f09867716c
|
@ -1,19 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
|
||||||
Copyright 2011 Jason Harris KJ4IWX
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ADIF_Parser
|
class ADIF_Parser
|
||||||
{
|
{
|
||||||
|
|
|
@ -438,11 +438,17 @@ class Logbook_model extends CI_Model {
|
||||||
//$datetime = date('Y-m-d') ." ". $this->input->post('start_time');
|
//$datetime = date('Y-m-d') ." ". $this->input->post('start_time');
|
||||||
//$myDate = date('Y-m-d', $record['qso_date']);
|
//$myDate = date('Y-m-d', $record['qso_date']);
|
||||||
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
$time_on = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||||
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_off']));
|
|
||||||
|
if (isset($record['time_off'])) {
|
||||||
|
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_off']));
|
||||||
|
} else {
|
||||||
|
$time_off = date('Y-m-d', strtotime($record['qso_date'])) ." ".date('H:i', strtotime($record['time_on']));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($record['freq'])) {
|
if(isset($record['freq'])) {
|
||||||
$freq = $record['freq'];
|
$cleansedstring = preg_replace('#\W#', '', $record['freq']);
|
||||||
|
$freq = $cleansedstring."000";
|
||||||
} else {
|
} else {
|
||||||
$freq = "0";
|
$freq = "0";
|
||||||
}
|
}
|
||||||
|
@ -451,8 +457,8 @@ class Logbook_model extends CI_Model {
|
||||||
} else {
|
} else {
|
||||||
$name = "";
|
$name = "";
|
||||||
}
|
}
|
||||||
if(isset($record['comment'])) {
|
if(isset($record['NOTES'])) {
|
||||||
$comment = $record['comment'];
|
$comment = $record['NOTES'];
|
||||||
} else {
|
} else {
|
||||||
$comment = "";
|
$comment = "";
|
||||||
}
|
}
|
||||||
|
@ -478,9 +484,19 @@ class Logbook_model extends CI_Model {
|
||||||
if(isset($record['country'])) {
|
if(isset($record['country'])) {
|
||||||
$country = $record['country'];
|
$country = $record['country'];
|
||||||
} else {
|
} else {
|
||||||
|
$this->load->model('dxcc');
|
||||||
|
|
||||||
$country = "";
|
$dxccinfo = $this->dxcc->info($record['call']);
|
||||||
|
|
||||||
|
if ($dxccinfo->num_rows() > 0)
|
||||||
|
{
|
||||||
|
foreach ($dxccinfo->result() as $row1)
|
||||||
|
{
|
||||||
|
$country = ucfirst(strtolower($row1->name));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$country = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($record['qth'])) {
|
if(isset($record['qth'])) {
|
||||||
|
|
Ładowanie…
Reference in New Issue