kopia lustrzana https://github.com/magicbug/Cloudlog
Refactoring: implemented AdifHelper in Club Log export, satellite export and backup of ADIF.
rodzic
47e8adda89
commit
7952ec76f7
|
@ -11,9 +11,9 @@ class adif_data extends CI_Model {
|
|||
function export_all() {
|
||||
$this->load->model('stations');
|
||||
$active_station_id = $this->stations->find_active();
|
||||
|
||||
$this->db->where('station_id', $active_station_id);
|
||||
$this->db->order_by("COL_TIME_ON", "ASC");
|
||||
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
|
||||
$this->db->order_by("COL_TIME_ON", "ASC");
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query;
|
||||
|
|
|
@ -749,10 +749,11 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
|
||||
function get_clublog_qsos($station_id){
|
||||
$this->db->where('station_id', $station_id);
|
||||
$this->db->where($this->config->item('table_name').'.station_id', $station_id);
|
||||
$this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null);
|
||||
$this->db->or_where("COL_CLUBLOG_QSO_UPLOAD_STATUS", "");
|
||||
$this->db->or_where("COL_CLUBLOG_QSO_UPLOAD_STATUS", "N");
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
<PROGRAMVERSION:<?php echo strlen($this->config->item('app_version')); ?>>Version <?php echo $this->config->item('app_version')."\n"; ?>
|
||||
<EOH>
|
||||
|
||||
<?php foreach ($qsos->result() as $qso) { //print_r($qso);?>
|
||||
<call:<?php echo strlen($qso->COL_CALL); ?>><?php echo $qso->COL_CALL; ?><band:<?php echo strlen($qso->COL_BAND); ?>><?php echo $qso->COL_BAND; ?><mode:<?php echo strlen($qso->COL_MODE); ?>><?php echo $qso->COL_MODE; ?><?php if($qso->COL_SUBMODE) { ?><submode:<?php echo strlen($qso->COL_SUBMODE); ?>><?php echo $qso->COL_SUBMODE; ?><?php } ?><?php if($qso->COL_FREQ != "0") { ?><?php $freq_in_mhz = $qso->COL_FREQ / 1000000; ?><freq:<?php echo strlen($freq_in_mhz); ?>><?php echo $freq_in_mhz; ?><?php } ?><?php $date_on = strtotime($qso->COL_TIME_ON); $new_date = date('Ymd', $date_on); ?><qso_date:<?php echo strlen($new_date); ?>><?php echo $new_date; ?><?php $time_on = strtotime($qso->COL_TIME_ON); $new_on = date('His', $time_on); ?><time_on:<?php echo strlen($new_on); ?>><?php echo $new_on; ?><?php $time_off = strtotime($qso->COL_TIME_OFF); $new_off = date('His', $time_off); ?><time_off:<?php echo strlen($new_off); ?>><?php echo $new_off; ?><rst_rcvd:<?php echo strlen($qso->COL_RST_RCVD); ?>><?php echo $qso->COL_RST_RCVD; ?><rst_sent:<?php echo strlen($qso->COL_RST_SENT); ?>><?php echo $qso->COL_RST_SENT; ?><qsl_rcvd:<?php echo strlen($qso->COL_QSL_RCVD); ?>><?php echo $qso->COL_QSL_RCVD; ?><qsl_sent:<?php echo strlen($qso->COL_QSL_SENT); ?>><?php echo $qso->COL_QSL_SENT; ?><country:<?php echo strlen($qso->COL_COUNTRY); ?>><?php echo $qso->COL_COUNTRY; ?><?php if($qso->COL_VUCC_GRIDS != "") { ?><vucc_grids:<?php echo strlen($qso->COL_VUCC_GRIDS); ?>><?php echo $qso->COL_VUCC_GRIDS; ?><?php } ?><?php if($qso->COL_VUCC_GRIDS == "" && $qso->COL_GRIDSQUARE != "") { ?><gridsquare:<?php echo strlen($qso->COL_GRIDSQUARE); ?>><?php echo $qso->COL_GRIDSQUARE; ?><?php } ?><?php if($qso->COL_SAT_NAME) { ?><sat_mode:<?php echo strlen($qso->COL_SAT_MODE); ?>><?php echo $qso->COL_SAT_MODE; ?><sat_name:<?php echo strlen($qso->COL_SAT_NAME); ?>><?php echo $qso->COL_SAT_NAME; ?><?php } ?><?php if($qso->COL_PROP_MODE) { ?><prop_mode:<?php echo strlen($qso->COL_PROP_MODE); ?>><?php echo $qso->COL_PROP_MODE; ?><?php } ?><?php if($qso->COL_NAME) { ?><name:<?php echo strlen($qso->COL_NAME); ?>><?php echo $qso->COL_NAME; ?><?php } ?><?php if($qso->COL_COMMENT) { ?><comment:<?php echo strlen($qso->COL_COMMENT); ?>><?php echo $qso->COL_COMMENT; ?><?php } ?><?php if($qso->COL_OPERATOR) { ?><operator:<?php echo strlen($qso->COL_OPERATOR); ?>><?php echo $qso->COL_OPERATOR; ?><?php } ?><eor>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('AdifHelper');
|
||||
|
||||
foreach ($qsos->result() as $qso) {
|
||||
echo $CI->adifhelper->getAdifLine($qso);
|
||||
}
|
|
@ -7,7 +7,10 @@
|
|||
<PROGRAMVERSION:<?php echo strlen($this->config->item('app_version')); ?>>Version <?php echo $this->config->item('app_version')."\n"; ?>
|
||||
<EOH>
|
||||
|
||||
<?php foreach ($qsos->result() as $qso) { ?>
|
||||
|
||||
<call:<?php echo strlen($qso->COL_CALL); ?>><?php echo $qso->COL_CALL; ?><band:<?php echo strlen($qso->COL_BAND); ?>><?php echo $qso->COL_BAND; ?><mode:<?php echo strlen($qso->COL_MODE); ?>><?php echo $qso->COL_MODE; ?><?php if($qso->COL_SUBMODE) { ?><SUBMODE:<?php echo strlen($qso->COL_SUBMODE); ?>><?php echo $qso->COL_SUBMODE; ?><?php } ?><?php if($qso->COL_FREQ != "0") { ?><?php $freq_in_mhz = $qso->COL_FREQ / 1000000; ?><freq:<?php echo strlen($freq_in_mhz); ?>><?php echo $freq_in_mhz; ?><?php } ?><?php if($qso->COL_FREQ_RX != "0") { ?><?php $freq_rx_in_mhz = $qso->COL_FREQ_RX / 1000000; ?><FREQ_RX:<?php echo strlen($freq_rx_in_mhz); ?>><?php echo $freq_rx_in_mhz; ?><?php } ?><?php if($qso->COL_BAND_RX) { ?><BAND_RX:<?php echo strlen($qso->COL_BAND_RX); ?>><?php echo $qso->COL_BAND_RX; ?><?php } ?><?php $date_on = strtotime($qso->COL_TIME_ON); $new_date = date('Ymd', $date_on); ?><qso_date:<?php echo strlen($new_date); ?>><?php echo $new_date; ?><?php $time_on = strtotime($qso->COL_TIME_ON); $new_on = date('His', $time_on); ?><time_on:<?php echo strlen($new_on); ?>><?php echo $new_on; ?><?php $time_off = strtotime($qso->COL_TIME_OFF); $new_off = date('His', $time_off); ?><time_off:<?php echo strlen($new_off); ?>><?php echo $new_off; ?><rst_rcvd:<?php echo strlen($qso->COL_RST_RCVD); ?>><?php echo $qso->COL_RST_RCVD; ?><rst_sent:<?php echo strlen($qso->COL_RST_SENT); ?>><?php echo $qso->COL_RST_SENT; ?><qsl_rcvd:<?php echo strlen($qso->COL_QSL_RCVD); ?>><?php echo $qso->COL_QSL_RCVD; ?><qsl_sent:<?php echo strlen($qso->COL_QSL_SENT); ?>><?php echo $qso->COL_QSL_SENT; ?><country:<?php echo strlen($qso->COL_COUNTRY); ?>><?php echo $qso->COL_COUNTRY; ?><?php if($qso->COL_VUCC_GRIDS != "") { ?><vucc_grids:<?php echo strlen($qso->COL_VUCC_GRIDS); ?>><?php echo $qso->COL_VUCC_GRIDS; ?><?php } ?><?php if($qso->COL_VUCC_GRIDS == "" && $qso->COL_GRIDSQUARE != "") { ?><gridsquare:<?php echo strlen($qso->COL_GRIDSQUARE); ?>><?php echo $qso->COL_GRIDSQUARE; ?><?php } ?><?php if($qso->COL_SAT_NAME) { ?><?php if($qso->COL_SAT_MODE != 0 || $qso->COL_SAT_MODE !="") {?><sat_mode:<?php echo strlen($qso->COL_SAT_MODE); ?>><?php echo $qso->COL_SAT_MODE; ?><?php } ?><sat_name:<?php echo strlen($qso->COL_SAT_NAME); ?>><?php echo $qso->COL_SAT_NAME; ?><?php } ?><?php if($qso->COL_PROP_MODE) { ?><prop_mode:<?php echo strlen($qso->COL_PROP_MODE); ?>><?php echo $qso->COL_PROP_MODE; ?><?php } ?><?php if($qso->COL_NAME) { ?><name:<?php echo strlen($qso->COL_NAME); ?>><?php echo $qso->COL_NAME; ?><?php } ?><?php if($qso->COL_STATE) { ?><state:<?php echo strlen($qso->COL_STATE); ?>><?php echo $qso->COL_STATE; ?><?php } ?><?php if($qso->COL_SOTA_REF) { ?><sota_ref:<?php echo strlen($qso->COL_SOTA_REF); ?>><?php echo $qso->COL_SOTA_REF; ?><?php } ?><?php if($qso->COL_OPERATOR) { ?><operator:<?php echo strlen($qso->COL_OPERATOR); ?>><?php echo $qso->COL_OPERATOR; ?><?php } ?><?php if($qso->station_callsign) { ?><STATION_CALLSIGN:<?php echo strlen($qso->station_callsign); ?>><?php echo $qso->station_callsign; ?><?php } ?><?php if($qso->station_city) { ?><MY_CITY:<?php echo strlen($qso->station_city); ?>><?php echo $qso->station_city; ?><?php } ?><?php if($qso->station_country) { ?><MY_COUNTRY:<?php echo strlen($qso->station_country); ?>><?php echo $qso->station_country; ?><?php } ?><?php if($qso->station_dxcc) { ?><MY_DXCC:<?php echo strlen($qso->station_dxcc); ?>><?php echo $qso->station_dxcc; ?><?php } ?><?php if( strpos($qso->station_gridsquare, ',') !== false ) { ?><MY_VUCC_GRIDS:<?php echo strlen($qso->station_gridsquare); ?>><?php echo $qso->station_gridsquare; ?><?php } else { ?><MY_GRIDSQUARE:<?php echo strlen($qso->station_gridsquare); ?>><?php echo $qso->station_gridsquare; ?><?php } ?><?php if($qso->station_iota) { ?><MY_IOTA:<?php echo strlen($qso->station_iota); ?>><?php echo $qso->station_iota; ?><?php } ?><?php if($qso->station_sota) { ?><MY_SOTA_REF:<?php echo strlen($qso->station_sota); ?>><?php echo $qso->station_sota; ?><?php } ?><?php if($qso->station_cq) { ?><MY_CQ_ZONE:<?php echo strlen($qso->station_cq); ?>><?php echo $qso->station_cq; ?><?php } ?><?php if($qso->station_itu) { ?><MY_ITU_ZONE:<?php echo strlen($qso->station_itu); ?>><?php echo $qso->station_itu; ?><?php } ?><?php if($qso->station_cnty) { ?><MY_CNTY:<?php echo strlen($qso->station_cnty); ?>><?php echo $qso->station_cnty; ?><?php } ?><?php if($qso->state) { ?><MY_STATE:<?php echo strlen($qso->state); ?>><?php echo $qso->state; ?><?php } ?><?php if($qso->COL_COMMENT !="") { ?><COMMENT:<?php echo strlen($qso->COL_COMMENT);?>><?php echo $qso->COL_COMMENT; ?><?php } ?><eor>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('AdifHelper');
|
||||
|
||||
foreach ($qsos->result() as $qso) {
|
||||
echo $CI->adifhelper->getAdifLine($qso);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<ADIF_VERS:3>2.2
|
||||
<ADIF_VERS:5>3.1.0
|
||||
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\n"; ?>
|
||||
<PROGRAMVERSION:<?php echo strlen($this->config->item('app_version')); ?>>Version <?php echo $this->config->item('app_version')."\n"; ?>
|
||||
<EOH>
|
||||
|
||||
<?php foreach ($qsos->result() as $qso) { //print_r($qso);?>
|
||||
<call:<?php echo strlen($qso->COL_CALL); ?>><?php echo $qso->COL_CALL; ?><band:<?php echo strlen($qso->COL_BAND); ?>><?php echo $qso->COL_BAND; ?><mode:<?php echo strlen($qso->COL_MODE); ?>><?php echo $qso->COL_MODE; ?><?php if($qso->COL_SUBMODE) { ?><SUBMODE:<?php echo strlen($qso->COL_SUBMODE); ?>><?php echo $qso->COL_SUBMODE; ?><?php } ?><?php if($qso->COL_FREQ != "0") { ?><freq:<?php echo strlen($qso->COL_FREQ); ?>><?php echo $qso->COL_FREQ; ?><?php } ?><?php $date_on = strtotime($qso->COL_TIME_ON); $new_date = date('Ymd', $date_on); ?><qso_date:<?php echo strlen($new_date); ?>><?php echo $new_date; ?><?php $time_on = strtotime($qso->COL_TIME_ON); $new_on = date('Hi', $time_on); ?><time_on:<?php echo strlen($new_on); ?>><?php echo $new_on; ?><?php $time_off = strtotime($qso->COL_TIME_OFF); $new_off = date('Hi', $time_off); ?><time_off:<?php echo strlen($new_off); ?>><?php echo $new_off; ?><rst_rcvd:<?php echo strlen($qso->COL_RST_RCVD); ?>><?php echo $qso->COL_RST_RCVD; ?><rst_sent:<?php echo strlen($qso->COL_RST_SENT); ?>><?php echo $qso->COL_RST_SENT; ?><qsl_rcvd:<?php echo strlen($qso->COL_QSL_RCVD); ?>><?php echo $qso->COL_QSL_RCVD; ?><qsl_sent:<?php echo strlen($qso->COL_QSL_SENT); ?>><?php echo $qso->COL_QSL_SENT; ?><country:<?php echo strlen($qso->COL_COUNTRY); ?>><?php echo $qso->COL_COUNTRY; ?><?php if($qso->COL_GRIDSQUARE != "") { ?><gridsquare:<?php echo strlen($qso->COL_GRIDSQUARE); ?>><?php echo $qso->COL_GRIDSQUARE; ?><?php } ?><?php if($qso->COL_SAT_NAME) { ?><sat_mode:<?php echo strlen($qso->COL_SAT_MODE); ?>><?php echo $qso->COL_SAT_MODE; ?><sat_name:<?php echo strlen($qso->COL_SAT_NAME); ?>><?php echo $qso->COL_SAT_NAME; ?><?php } ?><?php if($qso->COL_PROP_MODE) { ?><prop_mode:<?php echo strlen($qso->COL_PROP_MODE); ?>><?php echo $qso->COL_PROP_MODE; ?><?php } ?><?php if($qso->COL_NAME) { ?><name:<?php echo strlen($qso->COL_NAME); ?>><?php echo $qso->COL_NAME; ?><?php } ?><?php if($qso->COL_COMMENT) { ?><comment:<?php echo strlen($qso->COL_COMMENT); ?>><?php echo $qso->COL_COMMENT; ?><?php } ?><eor>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('AdifHelper');
|
||||
|
||||
foreach ($qsos->result() as $qso) {
|
||||
echo $CI->adifhelper->getAdifLine($qso);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue