Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Corby Krick 2013-11-03 13:27:01 -06:00
commit fd7557a4c0
10 changed files with 103 additions and 4427 deletions

View File

@ -66,7 +66,8 @@ class adif extends CI_Controller {
}
}
public function import() {
public function import() {
$data['page_title'] = "ADIF Import";
$config['upload_path'] = './uploads/';

View File

@ -224,6 +224,7 @@ class Logbook extends CI_Controller {
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
$this->db->like('COL_CALL', $id);
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(16);
$query = $this->db->get($this->config->item('table_name'));
@ -270,6 +271,7 @@ class Logbook extends CI_Controller {
$this->db->like('COL_CALL', $id);
$this->db->or_like('COL_GRIDSQUARE', $id);
$this->db->order_by("COL_TIME_ON", "desc");
$query = $this->db->get($this->config->item('table_name'));
if ($query->num_rows() > 0)

View File

@ -218,6 +218,69 @@ class Frequency {
}
}
public function GetBand($Frequency) {
$Band = NULL;
if ($Frequency > 1000000 && $Frequency < 2000000) {
$Band = "160m";
} else if ($Frequency > 3000000 && $Frequency < 4000000) {
$Band = "80m";
} else if ($Frequency > 6000000 && $Frequency < 8000000) {
$Band = "40m";
} else if ($Frequency > 9000000 && $Frequency < 11000000) {
$Band = "30m";
} else if ($Frequency > 13000000 && $Frequency < 15000000) {
$Band = "20m";
} else if ($Frequency > 17000000 && $Frequency < 19000000) {
$Band = "17m";
} else if ($Frequency > 20000000 && $Frequency < 22000000) {
$Band = "15m";
} else if ($Frequency > 23000000 && $Frequency < 25000000) {
$Band = "12m";
} else if ($Frequency > 27000000 && $Frequency < 30000000) {
$Band = "10m";
} else if ($Frequency > 49000000 && $Frequency < 52000000) {
$Band = "6m";
} else if ($Frequency > 69000000 && $Frequency < 71000000) {
$Band = "4m";
} else if ($Frequency > 140000000 && $Frequency < 150000000) {
$Band = "2m";
} else if ($Frequency > 218000000 && $Frequency < 226000000) {
$Band = "1.25m";
} else if ($Frequency > 430000000 && $Frequency < 440000000) {
$Band = "70cm";
} else if ($Frequency > 900000000 && $Frequency < 930000000) {
$Band = "33cm";
} else if ($Frequency > 1200000000 && $Frequency < 1300000000) {
$Band = "23cm";
} else if ($Frequency > 2200000000 && $Frequency < 2600000000) {
$Band = "13cm";
} else if ($Frequency > 3000000000 && $Frequency < 4000000000) {
$Band = "9cm";
} else if ($Frequency > 5000000000 && $Frequency < 6000000000) {
$Band = "6cm";
} else if ($Frequency > 9000000000 && $Frequency < 11000000000) {
$Band = "3cm";
} else if ($Frequency > 23000000000 && $Frequency < 25000000000) {
$Band = "1.2cm";
} else if ($Frequency > 46000000000 && $Frequency < 55000000000) {
$Band = "6mm";
} else if ($Frequency > 75000000000 && $Frequency < 82000000000) {
$Band = "4mm";
} else if ($Frequency > 120000000000 && $Frequency < 125000000000) {
$Band = "2.5mm";
} else if ($Frequency > 133000000000 && $Frequency < 150000000000) {
$Band = "2mm";
} else if ($Frequency > 240000000000 && $Frequency < 250000000000) {
$Band = "1mm";
} else if ($Frequency >= 250000000000) {
$Band = "<1mm";
}
return $Band;
}
}
/* End of file Frequency.php */

View File

@ -678,6 +678,8 @@ class Logbook_model extends CI_Model {
}
function import($record) {
$CI =& get_instance();
$CI->load->library('frequency');
// Join date+time
//$datetime = date('Y-m-d') ." ". $this->input->post('start_time');
//$myDate = date('Y-m-d', $record['qso_date']);
@ -783,7 +785,9 @@ class Logbook_model extends CI_Model {
if(isset($record['band'])) {
$band = $record['band'];
} else {
$band = null;
$myfreq = str_replace(array('.', ','), '' , $record['freq'].'0');
$band = $CI->frequency->GetBand($myfreq);
}
// Store IOTA Ref if available
@ -833,6 +837,16 @@ class Logbook_model extends CI_Model {
} else {
$srx = null;
}
// Filter Modes if not apart of ADIF spec
if($record['mode'] == "RTTY75") {
// Set RTTY75 to just RTTY
$mode = "RTTY";
} else {
// If no other rules just plain mode that adif includes
$mode = $record['mode'];
}
$this->db->where('COL_CALL', $record['call']);
$this->db->where('COL_TIME_ON', $time_on);
@ -845,9 +859,9 @@ class Logbook_model extends CI_Model {
'COL_TIME_ON' => $time_on,
'COL_TIME_OFF' => $time_off,
'COL_CALL' => strtoupper($record['call']),
'COL_BAND' => $record['band'],
'COL_BAND' => $band,
'COL_FREQ' => $freq,
'COL_MODE' => $record['mode'],
'COL_MODE' => $mode,
'COL_RST_RCVD' => $rst_rx,
'COL_RST_SENT' => $rst_tx,
'COL_NAME' => $name,

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?php
header("content-type: plain/text");
header('Content-Disposition: attachment; filename="export_log.adi"')
header('Content-Disposition: attachment; filename="'.$this->session->userdata('user_callsign').'-'.date('dmY-Hi').'.adi"')
?>
<ADIF_VERS:3>2.2
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\n"; ?>

View File

@ -1,6 +1,9 @@
</div> <!-- end wrapper -->
<div id="footer">
<a href="http://www.cloudlog.co.uk">Powered by Cloudlog</a>
<div class="container">
<a href="http://www.cloudlog.co.uk">Powered by Cloudlog</a>
</div>
</div>
</body>

View File

@ -34,7 +34,7 @@
<body>
<!-- Header -->
<div id="wrap">
<div class="topbar">
<div class="fill">
<div class="container">
@ -127,4 +127,3 @@
</div>
<div id="clear" class="clear"></div>
<div id="wrap">

View File

@ -68,3 +68,4 @@
</form>
</div>
</div>

View File

@ -1,14 +1,18 @@
html, body {height: 100%;}
#wrap {min-height: 100%;}
#main {overflow:hidden; padding-bottom: 3em; /* must be same height as the footer */ }
body,html{
height:100%;
}
#wrap {
min-height:100%;
}
#footer{
margin-top:-40px;
text-align: right;
padding-bottom: 10px;
}
#container { padding-top: 50px; width: 940px; margin: 0 auto; }
#footer { width: 940px; margin: -3em auto; text-align: right; position: relative; clear:both; height: 3em;
/* margin-top must be the negative value of footer height */ }
table .titles { font-weight: bold; color: #439BF6; }
table .title { font-weight: bold; color: #439BF6; }