Cloudlog/application/models/Adif_data.php

191 lines
8.3 KiB
PHP
Raw Normal View History

<?php
class adif_data extends CI_Model {
function export_all($api_key = null) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
if ($api_key != null) {
$CI->load->model('api_model');
if (strpos($this->api_model->access($api_key), 'r') !== false) {
$this->api_model->update_last_used($api_key);
$user_id = $this->api_model->key_userid($api_key);
$logbooks_locations_array = $this->list_station_locations($user_id);
}
} else {
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
}
2023-04-26 10:35:11 +00:00
$this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
$this->db->order_by("COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
2023-04-26 10:35:11 +00:00
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif');
$query = $this->db->get($this->config->item('table_name'));
2020-04-08 13:53:20 +00:00
return $query;
}
2019-04-08 14:36:23 +00:00
function list_station_locations($user_id) {
$this->db->where('user_id', $user_id);
$query = $this->db->get('station_profile');
if ($query->num_rows() == 0) {
return array();
}
$locations_array = array();
foreach ($query->result() as $row) {
array_push($locations_array, $row->station_id);
}
return $locations_array;
}
function export_printrequested($station_id = NULL) {
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
if ($station_id == NULL) {
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
} else if ($station_id != 'All') {
$this->db->where($this->config->item('table_name').'.station_id', $station_id);
}
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif');
// always filter user. this ensures that even if the station_id is from another user no inaccesible QSOs will be returned
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));
$this->db->order_by("COL_TIME_ON", "ASC");
2019-08-28 19:13:24 +00:00
$query = $this->db->get($this->config->item('table_name'));
2019-08-28 19:13:24 +00:00
return $query;
}
2019-04-08 14:47:03 +00:00
function sat_all() {
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
$this->db->where($this->config->item('table_name').'.COL_PROP_MODE', 'SAT');
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer');
return $this->db->get();
2019-04-08 14:36:23 +00:00
}
function satellte_lotw() {
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
$this->db->where($this->config->item('table_name').'.COL_PROP_MODE', 'SAT');
2019-04-08 14:36:23 +00:00
$where = $this->config->item('table_name').".COL_LOTW_QSLRDATE IS NOT NULL";
2019-04-08 14:36:23 +00:00
$this->db->where($where);
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer');
return $this->db->get();
2019-04-08 14:36:23 +00:00
}
function export_custom($from, $to, $station_id, $exportLotw = false) {
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('Stations');
if (!$CI->Stations->check_station_is_accessible($station_id)) {
return;
}
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $station_id);
// If date is set, we format the date and add it to the where-statement
2022-12-23 12:55:58 +00:00
if ($from) {
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) >= '".$from."'");
}
2022-12-23 12:55:58 +00:00
if ($to) {
$this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'");
}
if ($exportLotw) {
2022-09-03 05:27:58 +00:00
$this->db->group_start();
$this->db->where($this->config->item('table_name').".COL_LOTW_QSL_SENT != 'Y'");
$this->db->or_where($this->config->item('table_name').".COL_LOTW_QSL_SENT", NULL);
$this->db->group_end();
}
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer');
return $this->db->get();
}
function export_lotw() {
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
2020-04-08 13:53:20 +00:00
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
2020-04-08 13:53:20 +00:00
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
2022-09-03 05:27:58 +00:00
$this->db->group_start();
2020-04-08 13:53:20 +00:00
$this->db->where($this->config->item('table_name').".COL_LOTW_QSL_SENT != 'Y'");
$this->db->or_where($this->config->item('table_name').".COL_LOTW_QSL_SENT", NULL);
$this->db->group_end();
2020-04-08 13:53:20 +00:00
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer');
2020-04-08 13:53:20 +00:00
return $this->db->get();
}
function mark_lotw_sent($id) {
$data = array(
'COL_LOTW_QSL_SENT' => 'Y'
);
$this->db->set('COL_LOTW_QSLSDATE', 'now()', FALSE);
$this->db->where('COL_PRIMARY_KEY', $id);
$this->db->update($this->config->item('table_name'), $data);
}
function sig_all($type) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
Remove redundant country colum in station_profile Squashed commit of the following: commit 29e5f5118a1c3f8deb623e5948c3b7602241792d Merge: 566b390d e0a04cbe Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:28:31 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 566b390d8b0322b32f4438994354ce902010c0d4 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 23:18:28 2023 +0200 Refactor reassign function to use DXCC name from dxcc_entities commit 2e50b34c1bdb9bb087e0e0d16f13c340c15588fb Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 22:05:12 2023 +0200 Use DXCC name from DXCC entities upon import commit d2b1d895818777747db593848b855819f53ffe6d Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 21:18:53 2023 +0200 Add DB migration script commit 0ecf4b8d9cf0253c1f818a252f7ae83722254544 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 18:16:55 2023 +0200 Fix export function for requests QSLs commit 51d2c5c6175a8e8c69b9edd57d6f1e95c4a03600 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:53:50 2023 +0200 Fix webadif/qrz upload commit 45039a6b1284d1a23f610fc70a39ef25ce720cab Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:32:40 2023 +0200 Fix lotw_export function commit 1306225d027cacbe70e510fd0fc5d3ca5040c35e Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:21:37 2023 +0200 Fix SIG export function commit 082798a80d8bb446500dcbadfa4912c510e4a458 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 17:01:42 2023 +0200 Fix SAT export functions commit 2f035afaa3d3c74ca811c96c66f7bf9726b31a78 Merge: 87555f20 d6139439 Author: phl0 <github@florian-wolters.de> Date: Mon Apr 24 16:52:43 2023 +0200 Merge remote-tracking branch 'upstream/dev' into removeRedundantDxccNames commit 87555f201817fb963be117ab193d42bc03889972 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:54:14 2023 +0200 Use DXCC entity name from dxcc_entities in ADIF export commit e2fd1c5eb9b7e3257ed016814719bc7f9b913587 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:36:16 2023 +0200 Make logbooks use DXCC name from entities table commit 463057523dacbc34a545f0d9f720f2c29c9883a7 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 23:01:58 2023 +0200 Use DXCC name from separate table in QSO view commit 62b8f7aed8c1dca426b055eb7af6360106fc022b Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:21:57 2023 +0200 Add table join to station profile lookup commit 0afe155f46f1fcd227446166b215a98729494dc8 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:13:35 2023 +0200 Remove country name from edit functions commit ecb3689a0a73f0cc9c5ca7eba5dec7df5f9fbcd1 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 18:07:58 2023 +0200 Remove station_country parameter commit 22c350a585a3ff95d1d0b1f49dbe8ca310bdaf85 Author: phl0 <github@florian-wolters.de> Date: Thu Apr 20 17:59:24 2023 +0200 Use DXCC name from dxcc_entitites table
2023-04-24 22:13:49 +00:00
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
$this->db->from($this->config->item('table_name'));
$this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array);
$this->db->where($this->config->item('table_name').'.COL_SIG', $type);
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer');
return $this->db->get();
}
}
?>