Merge branch 'dev' of https://github.com/magicbug/Cloudlog into dev
这个提交包含在:
当前提交
287a57e80d
共有 22 个文件被更改,包括 615 次插入 和 87 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 120;
|
||||
$config['migration_version'] = 121;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -20,25 +20,33 @@ class Backup extends CI_Controller {
|
|||
}
|
||||
|
||||
/* Gets all QSOs and Dumps them to logbook.adi */
|
||||
public function adif(){
|
||||
public function adif($key = null){
|
||||
if ($key == null) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
$this->load->helper('file');
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
ini_set('memory_limit', '-1');
|
||||
|
||||
$this->load->model('adif_data');
|
||||
|
||||
$data['qsos'] = $this->adif_data->export_all();
|
||||
$data['qsos'] = $this->adif_data->export_all($key);
|
||||
|
||||
if ( ! write_file('backup/logbook.adi', $this->load->view('backup/exportall', $data, true)))
|
||||
$data['filename'] = 'backup/logbook'. date('_Y_m_d_H_i_s') .'.adi';
|
||||
|
||||
if ( ! write_file($data['filename'], $this->load->view('backup/exportall', $data, true)))
|
||||
{
|
||||
$data['status'] = false;
|
||||
$data['status'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['status'] = true;
|
||||
$data['status'] = true;
|
||||
}
|
||||
|
||||
$data['page_title'] = "ADIF - Backup";
|
||||
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('backup/adif_view');
|
||||
|
|
@ -47,19 +55,26 @@ class Backup extends CI_Controller {
|
|||
}
|
||||
|
||||
/* Export the notes to XML */
|
||||
public function notes() {
|
||||
public function notes($key = null) {
|
||||
if ($key == null) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
$this->load->helper('file');
|
||||
$this->load->model('note');
|
||||
|
||||
$data['list_note'] = $this->note->list_all();
|
||||
$data['list_note'] = $this->note->list_all($key);
|
||||
|
||||
if ( ! write_file('backup/notes.xml', $this->load->view('backup/notes', $data, true)))
|
||||
$data['filename'] = 'backup/notes'. date('_Y_m_d_H_i_s') .'.xml';
|
||||
|
||||
if ( ! write_file($data['filename'], $this->load->view('backup/notes', $data, true)))
|
||||
{
|
||||
$data['status'] = false;
|
||||
$data['status'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['status'] = true;
|
||||
$data['status'] = true;
|
||||
}
|
||||
|
||||
$data['page_title'] = "Notes - Backup";
|
||||
|
|
@ -71,4 +86,4 @@ class Backup extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
/* End of file Backup.php */
|
||||
/* End of file Backup.php */
|
||||
|
|
|
|||
|
|
@ -136,11 +136,11 @@ class QSLPrint extends CI_Controller {
|
|||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
|
||||
// Update Logbook to Mark Paper Card Received
|
||||
// Update Logbook to Mark Paper Card Sent
|
||||
|
||||
$this->qslprint_model->mark_qsos_printed($station_id);
|
||||
|
||||
$this->session->set_flashdata('notice', 'QSOs are marked as sent via buro');
|
||||
$this->session->set_flashdata('notice', 'QSOs are marked as sent');
|
||||
|
||||
redirect('logbook');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,6 +483,15 @@ class QSO extends CI_Controller {
|
|||
echo $this->wwff->info($wwff);
|
||||
}
|
||||
|
||||
public function get_pota_info() {
|
||||
$this->load->library('pota');
|
||||
|
||||
$pota = xss_clean($this->input->post('pota'));
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $this->pota->info($pota);
|
||||
}
|
||||
|
||||
public function get_station_power() {
|
||||
$this->load->model('stations');
|
||||
$stationProfile = xss_clean($this->input->post('stationProfile'));
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class User extends CI_Controller {
|
|||
$data['user_qth_lookup'] = $this->input->post('user_qth_lookup');
|
||||
$data['user_sota_lookup'] = $this->input->post('user_sota_lookup');
|
||||
$data['user_wwff_lookup'] = $this->input->post('user_wwff_lookup');
|
||||
$data['user_pota_lookup'] = $this->input->post('user_pota_lookup');
|
||||
$data['user_show_notes'] = $this->input->post('user_show_notes');
|
||||
$data['user_column1'] = $this->input->post('user_column1');
|
||||
$data['user_column2'] = $this->input->post('user_column2');
|
||||
|
|
@ -105,6 +106,7 @@ class User extends CI_Controller {
|
|||
$this->input->post('user_qth_lookup'),
|
||||
$this->input->post('user_sota_lookup'),
|
||||
$this->input->post('user_wwff_lookup'),
|
||||
$this->input->post('user_pota_lookup'),
|
||||
$this->input->post('user_show_notes'),
|
||||
$this->input->post('user_column1'),
|
||||
$this->input->post('user_column2'),
|
||||
|
|
@ -146,6 +148,7 @@ class User extends CI_Controller {
|
|||
$data['user_qth_lookup'] = $this->input->post('user_qth_lookup');
|
||||
$data['user_sota_lookup'] = $this->input->post('user_sota_lookup');
|
||||
$data['user_wwff_lookup'] = $this->input->post('user_wwff_lookup');
|
||||
$data['user_pota_lookup'] = $this->input->post('user_pota_lookup');
|
||||
$data['user_show_notes'] = $this->input->post('user_show_notes');
|
||||
$data['user_column1'] = $this->input->post('user_column1');
|
||||
$data['user_column2'] = $this->input->post('user_column2');
|
||||
|
|
@ -332,6 +335,12 @@ class User extends CI_Controller {
|
|||
$data['user_wwff_lookup'] = $q->user_wwff_lookup;
|
||||
}
|
||||
|
||||
if($this->input->post('user_pota_lookup')) {
|
||||
$data['user_pota_lookup'] = $this->input->post('user_pota_lookup', true);
|
||||
} else {
|
||||
$data['user_pota_lookup'] = $q->user_pota_lookup;
|
||||
}
|
||||
|
||||
if($this->input->post('user_show_notes')) {
|
||||
$data['user_show_notes'] = $this->input->post('user_show_notes', true);
|
||||
} else {
|
||||
|
|
@ -430,6 +439,7 @@ class User extends CI_Controller {
|
|||
$data['user_qth_lookup'] = $this->input->post('user_qth_lookup');
|
||||
$data['user_sota_lookup'] = $this->input->post('user_sota_lookup');
|
||||
$data['user_wwff_lookup'] = $this->input->post('user_wwff_lookup');
|
||||
$data['user_pota_lookup'] = $this->input->post('user_pota_lookup');
|
||||
$data['user_show_notes'] = $this->input->post('user_show_notes');
|
||||
$data['user_column1'] = $this->input->post('user_column1');
|
||||
$data['user_column2'] = $this->input->post('user_column2');
|
||||
|
|
|
|||
59
application/libraries/Pota.php
普通文件
59
application/libraries/Pota.php
普通文件
|
|
@ -0,0 +1,59 @@
|
|||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
/***
|
||||
* Pota library is a Parks On The Air client
|
||||
*/
|
||||
class Pota
|
||||
{
|
||||
// return summit references matching the provided query
|
||||
public function get($query): array
|
||||
{
|
||||
if (empty($query)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$json = [];
|
||||
$ref = strtoupper($query);
|
||||
|
||||
$file = 'assets/json/pota.txt';
|
||||
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($ref, '~');
|
||||
$reg = '~^' . $input . '(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name" => $value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
// fetches the summit information from POTA
|
||||
public function info($ref) {
|
||||
$url = 'https://api.pota.app/park/'.$ref;
|
||||
|
||||
// Let's use cURL instead of file_get_contents
|
||||
// begin script
|
||||
$ch = curl_init();
|
||||
|
||||
// basic curl options for all requests
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
|
||||
// use the URL we built
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
$summit_info = curl_exec($ch);
|
||||
|
||||
// Close cURL handle
|
||||
curl_close($ch);
|
||||
|
||||
return $summit_info;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
* This adds an option to enable grid and name lookup
|
||||
* for WWFF references
|
||||
*/
|
||||
|
||||
class Migration_add_user_pota_lookup extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->field_exists('user_pota_lookup', 'users')) {
|
||||
$fields = array(
|
||||
'user_pota_lookup integer DEFAULT 0 AFTER user_wwff_lookup',
|
||||
);
|
||||
|
||||
$this->dbforge->add_column('users', $fields);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if ($this->db->field_exists('user_pota_lookup', 'users')) {
|
||||
$this->dbforge->drop_column('users', 'user_pota_lookup');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,13 +2,25 @@
|
|||
|
||||
class adif_data extends CI_Model {
|
||||
|
||||
function export_all() {
|
||||
$this->load->model('stations');
|
||||
$active_station_id = $this->stations->find_active();
|
||||
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);
|
||||
$active_station_logbook = $CI->logbooks_model->find_active_station_logbook_from_userid($user_id);
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($active_station_logbook);
|
||||
}
|
||||
} else {
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
}
|
||||
|
||||
$this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
|
||||
$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');
|
||||
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
|
||||
$this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif');
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class Logbookadvanced_model extends CI_Model {
|
|||
return $qsos;
|
||||
}
|
||||
|
||||
public function getQsosForAdif($ids, $user_id, $sortorder) : object {
|
||||
public function getQsosForAdif($ids, $user_id, $sortorder = null) : object {
|
||||
$binding = [$user_id];
|
||||
$conditions[] = "COL_PRIMARY_KEY in ?";
|
||||
$binding[] = json_decode($ids, true);
|
||||
|
|
@ -122,20 +122,7 @@ class Logbookadvanced_model extends CI_Model {
|
|||
$where = "AND $where";
|
||||
}
|
||||
|
||||
$sortorder = explode(',', $sortorder);
|
||||
|
||||
switch($sortorder[0]) {
|
||||
case 1: $order = 'ORDER BY qsos.COL_TIME_ON ' . $sortorder[1]; break;
|
||||
case 2: $order = 'ORDER BY station_profile.station_callsign ' . $sortorder[1]; break;
|
||||
case 3: $order = 'ORDER BY qsos.COL_CALL ' . $sortorder[1]; break;
|
||||
case 4: $order = 'ORDER BY qsos.COL_MODE' . $sortorder[1] . ', qsos.COL_SUBMODE ' . $sortorder[1]; break;
|
||||
case 7: $order = 'ORDER BY qsos.COL_BAND ' . $sortorder[1] . ', qsos.COL_SAT_NAME ' . $sortorder[1]; break;
|
||||
case 15: $order = 'ORDER BY qsos.COL_COUNTRY ' . $sortorder[1]; break;
|
||||
case 16: $order = 'ORDER BY qso.COL_STATE ' . $sortorder[1]; break;
|
||||
case 17: $order = 'ORDER BY qsos.COL_CQZ ' . $sortorder[1]; break;
|
||||
case 18: $order = 'ORDER BY qsos.COL_IOTA ' . $sortorder[1]; break;
|
||||
default: $order = 'ORDER BY qsos.COL_TIME_ON desc'; break;
|
||||
}
|
||||
$order = $this->getSortorder($sortorder);
|
||||
|
||||
$sql = "
|
||||
SELECT *, dxcc_entities.name AS station_country
|
||||
|
|
@ -150,6 +137,59 @@ class Logbookadvanced_model extends CI_Model {
|
|||
return $this->db->query($sql, $binding);
|
||||
}
|
||||
|
||||
public function getSortOrder($sortorder) {
|
||||
if ($sortorder == null) {
|
||||
return 'ORDER BY qsos.COL_TIME_ON desc';
|
||||
} else {
|
||||
$sortorder = explode(',', $sortorder);
|
||||
|
||||
if ($this->session->userdata('user_lotw_name') != "" && $this->session->userdata('user_eqsl_name') != ""){
|
||||
switch($sortorder[0]) {
|
||||
case 1: return 'ORDER BY qsos.COL_TIME_ON ' . $sortorder[1];
|
||||
case 2: return 'ORDER BY station_profile.station_callsign ' . $sortorder[1];
|
||||
case 3: return 'ORDER BY qsos.COL_CALL ' . $sortorder[1];
|
||||
case 4: return 'ORDER BY qsos.COL_MODE' . $sortorder[1] . ', qsos.COL_SUBMODE ' . $sortorder[1];
|
||||
case 7: return 'ORDER BY qsos.COL_BAND ' . $sortorder[1] . ', qsos.COL_SAT_NAME ' . $sortorder[1];
|
||||
case 16: return 'ORDER BY qsos.COL_COUNTRY ' . $sortorder[1];
|
||||
case 17: return 'ORDER BY qso.COL_STATE ' . $sortorder[1];
|
||||
case 18: return 'ORDER BY qsos.COL_CQZ ' . $sortorder[1];
|
||||
case 19: return 'ORDER BY qsos.COL_IOTA ' . $sortorder[1];
|
||||
default: return 'ORDER BY qsos.COL_TIME_ON desc';
|
||||
}
|
||||
}
|
||||
|
||||
else if (($this->session->userdata('user_eqsl_name') != "" && $this->session->userdata('user_lotw_name') == "") || ($this->session->userdata('user_eqsl_name') == "" && $this->session->userdata('user_lotw_name') != "")) {
|
||||
switch($sortorder[0]) {
|
||||
case 1: return 'ORDER BY qsos.COL_TIME_ON ' . $sortorder[1];
|
||||
case 2: return 'ORDER BY station_profile.station_callsign ' . $sortorder[1];
|
||||
case 3: return 'ORDER BY qsos.COL_CALL ' . $sortorder[1];
|
||||
case 4: return 'ORDER BY qsos.COL_MODE' . $sortorder[1] . ', qsos.COL_SUBMODE ' . $sortorder[1];
|
||||
case 7: return 'ORDER BY qsos.COL_BAND ' . $sortorder[1] . ', qsos.COL_SAT_NAME ' . $sortorder[1];
|
||||
case 15: return 'ORDER BY qsos.COL_COUNTRY ' . $sortorder[1];
|
||||
case 16: return 'ORDER BY qso.COL_STATE ' . $sortorder[1];
|
||||
case 17: return 'ORDER BY qsos.COL_CQZ ' . $sortorder[1];
|
||||
case 18: return 'ORDER BY qsos.COL_IOTA ' . $sortorder[1];
|
||||
default: return 'ORDER BY qsos.COL_TIME_ON desc';
|
||||
}
|
||||
}
|
||||
|
||||
else if ($this->session->userdata('user_eqsl_name') == "" && $this->session->userdata('user_lotw_name') == ""){
|
||||
switch($sortorder[0]) {
|
||||
case 1: return 'ORDER BY qsos.COL_TIME_ON ' . $sortorder[1];
|
||||
case 2: return 'ORDER BY station_profile.station_callsign ' . $sortorder[1];
|
||||
case 3: return 'ORDER BY qsos.COL_CALL ' . $sortorder[1];
|
||||
case 4: return 'ORDER BY qsos.COL_MODE' . $sortorder[1] . ', qsos.COL_SUBMODE ' . $sortorder[1];
|
||||
case 7: return 'ORDER BY qsos.COL_BAND ' . $sortorder[1] . ', qsos.COL_SAT_NAME ' . $sortorder[1];
|
||||
case 14: return 'ORDER BY qsos.COL_COUNTRY ' . $sortorder[1];
|
||||
case 15: return 'ORDER BY qso.COL_STATE ' . $sortorder[1];
|
||||
case 16: return 'ORDER BY qsos.COL_CQZ ' . $sortorder[1];
|
||||
case 17: return 'ORDER BY qsos.COL_IOTA ' . $sortorder[1];
|
||||
default: return 'ORDER BY qsos.COL_TIME_ON desc';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateQsl($ids, $user_id, $method, $sent) {
|
||||
$this->load->model('user_model');
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,19 @@
|
|||
|
||||
class Note extends CI_Model {
|
||||
|
||||
function list_all() {
|
||||
$this->db->where('user_id', $this->session->userdata('user_id'));
|
||||
function list_all($api_key = null) {
|
||||
if ($api_key == null) {
|
||||
$user_id = $this->session->userdata('user_id');
|
||||
} else {
|
||||
$CI =& get_instance();
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->where('user_id', $user_id);
|
||||
return $this->db->get('notes');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,14 +7,10 @@ class Qslprint_model extends CI_Model {
|
|||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
$data = array(
|
||||
'COL_QSLSDATE' => date('Y-m-d'),
|
||||
'COL_QSL_SENT' => "Y",
|
||||
'COL_QSL_SENT_VIA' => "B",
|
||||
);
|
||||
$station_ids = array();
|
||||
|
||||
if ($station_id2 == NULL) {
|
||||
$this->db->where("station_id", $station_id);
|
||||
array_push($station_ids, $station_id);
|
||||
} else if ($station_id2 == 'All') {
|
||||
// get all stations of user
|
||||
$stations = $CI->Stations->all_of_user();
|
||||
|
|
@ -22,18 +18,48 @@ class Qslprint_model extends CI_Model {
|
|||
foreach ($stations->result() as $row) {
|
||||
array_push($station_ids, $row->station_id);
|
||||
}
|
||||
|
||||
// filter by all stations
|
||||
$this->db->where_in("station_id", $station_ids);
|
||||
} else if ($station_id2 != 'All') {
|
||||
} else {
|
||||
// be sure that station belongs to user
|
||||
if (!$CI->Stations->check_station_is_accessible($station_id2)) {
|
||||
return;
|
||||
}
|
||||
$this->db->where("station_id", $station_id2);
|
||||
array_push($station_ids, $station_id2);
|
||||
}
|
||||
|
||||
$this->update_qsos_bureau($station_ids);
|
||||
|
||||
$this->update_qsos($station_ids);
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the QSOs that do not have any COL_QSL_SENT_VIA set
|
||||
*/
|
||||
function update_qsos_bureau($station_ids) {
|
||||
$data = array(
|
||||
'COL_QSLSDATE' => date('Y-m-d'),
|
||||
'COL_QSL_SENT' => "Y",
|
||||
'COL_QSL_SENT_VIA' => "B",
|
||||
);
|
||||
|
||||
$this->db->where_in("station_id", $station_ids);
|
||||
$this->db->where_in("COL_QSL_SENT", array("R","Q"));
|
||||
$this->db->where("coalesce(COL_QSL_SENT_VIA, '') = ''");
|
||||
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the QSOs that do have COL_QSL_SENT_VIA set
|
||||
*/
|
||||
function update_qsos($station_ids) {
|
||||
$data = array(
|
||||
'COL_QSLSDATE' => date('Y-m-d'),
|
||||
'COL_QSL_SENT' => "Y",
|
||||
);
|
||||
|
||||
$this->db->where_in("station_id", $station_ids);
|
||||
$this->db->where_in("COL_QSL_SENT", array("R","Q"));
|
||||
$this->db->where("coalesce(COL_QSL_SENT_VIA, '') != ''");
|
||||
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class User_Model extends CI_Model {
|
|||
// Add a user
|
||||
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone,
|
||||
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
|
||||
$user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
|
||||
$user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
|
||||
$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) {
|
||||
// Check that the user isn't already used
|
||||
if(!$this->exists($username)) {
|
||||
|
|
@ -142,6 +142,7 @@ class User_Model extends CI_Model {
|
|||
'user_qth_lookup' => xss_clean($user_qth_lookup),
|
||||
'user_sota_lookup' => xss_clean($user_sota_lookup),
|
||||
'user_wwff_lookup' => xss_clean($user_wwff_lookup),
|
||||
'user_pota_lookup' => xss_clean($user_pota_lookup),
|
||||
'user_show_notes' => xss_clean($user_show_notes),
|
||||
'user_column1' => xss_clean($user_column1),
|
||||
'user_column2' => xss_clean($user_column2),
|
||||
|
|
@ -197,6 +198,7 @@ class User_Model extends CI_Model {
|
|||
'user_qth_lookup' => xss_clean($fields['user_qth_lookup']),
|
||||
'user_sota_lookup' => xss_clean($fields['user_sota_lookup']),
|
||||
'user_wwff_lookup' => xss_clean($fields['user_wwff_lookup']),
|
||||
'user_pota_lookup' => xss_clean($fields['user_pota_lookup']),
|
||||
'user_show_notes' => xss_clean($fields['user_show_notes']),
|
||||
'user_column1' => xss_clean($fields['user_column1']),
|
||||
'user_column2' => xss_clean($fields['user_column2']),
|
||||
|
|
@ -316,6 +318,7 @@ class User_Model extends CI_Model {
|
|||
'user_qth_lookup' => isset($u->row()->user_qth_lookup) ? $u->row()->user_qth_lookup : 0,
|
||||
'user_sota_lookup' => isset($u->row()->user_sota_lookup) ? $u->row()->user_sota_lookup : 0,
|
||||
'user_wwff_lookup' => isset($u->row()->user_wwff_lookup) ? $u->row()->user_wwff_lookup : 0,
|
||||
'user_pota_lookup' => isset($u->row()->user_pota_lookup) ? $u->row()->user_pota_lookup : 0,
|
||||
'user_show_notes' => isset($u->row()->user_show_notes) ? $u->row()->user_show_notes : 1,
|
||||
'user_show_profile_image' => isset($u->row()->user_show_profile_image) ? $u->row()->user_show_profile_image : 0,
|
||||
'user_column1' => isset($u->row()->user_column1) ? $u->row()->user_column1: 'Mode',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<?php if($status == true) { ?>
|
||||
|
||||
<p>The backup of your log completed successfully. The output can be found at: <a href="<?php echo base_url(); ?>backup/logbook.adi"><?php echo base_url(); ?>backup/logbook.adi</a></a></p>
|
||||
<p>The backup of your log completed successfully. The output can be found at: <a href="<?php echo base_url().$filename; ?>"><?php echo base_url() . $filename; ?></a></p>
|
||||
|
||||
<p>You could automate this process by making it a cronjob.</p>
|
||||
|
||||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
|
||||
<?php if($status == true) { ?>
|
||||
|
||||
<p>The backup of your notes completed successfully. The output can be found at: <a href="<?php echo base_url(); ?>backup/notes.xml"><?php echo base_url(); ?>backup/notes.xml</a></p>
|
||||
|
||||
<p>The backup of your notes completed successfully. The output can be found at: <a href="<?php echo base_url().$filename;?>"><?php echo base_url() . $filename; ?></a></p>
|
||||
|
||||
<p>You could automate this process by making it a cronjob.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -1084,6 +1084,27 @@ $(document).on('keypress',function(e) {
|
|||
});
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->session->userdata('user_pota_lookup') == 1) { ?>
|
||||
$('#pota_ref').change(function() {
|
||||
var pota = $('#pota_ref').val();
|
||||
if (pota.length > 0) {
|
||||
$.ajax({
|
||||
url: base_url+'index.php/qso/get_pota_info',
|
||||
type: 'post',
|
||||
data: {'pota': pota},
|
||||
success: function(res) {
|
||||
$('#qth').val(res.name);
|
||||
$('#locator').val(res.grid6);
|
||||
},
|
||||
error: function() {
|
||||
$('#qth').val('');
|
||||
$('#locator').val('');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
$('#stationProfile').change(function() {
|
||||
var stationProfile = $('#stationProfile').val();
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@
|
|||
<button type="button" class="btn btn-sm btn-success" id="sentDirect">Sent Direct</button>
|
||||
<button type="button" class="btn btn-sm btn-success" id="sentElectronic">Sent Electronic</button>
|
||||
<button type="button" class="btn btn-sm btn-warning" id="dontSend">Don't Send</button>
|
||||
<button type="button" class="btn btn-sm btn-warning" id="notRequired">QSL Not Required</button>
|
||||
<button type="button" class="btn btn-sm btn-info" id="exportAdif">Create ADIF</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" id="deleteQsos">Delete</button>
|
||||
<span id="infoBox"></span>
|
||||
|
|
@ -201,8 +202,13 @@
|
|||
<th>Refs</th>
|
||||
<th>Name</th>
|
||||
<th>QSL Via</th>
|
||||
<th>QSL Sent</th>
|
||||
<th>QSL Received</th>
|
||||
<th>QSL</th>
|
||||
<?php if ($this->session->userdata('user_lotw_name') != ""){
|
||||
echo '<th class="lotwconfirmation">LoTW</th>';
|
||||
} ?>
|
||||
<?php if ($this->session->userdata('user_eqsl_name') != ""){
|
||||
echo '<th class="eqslconfirmation">eQSL</th>';
|
||||
} ?>
|
||||
<th>QSL Msg</th>
|
||||
<th>DXCC</th>
|
||||
<th>State</th>
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ if ($qsos->result() != NULL) {
|
|||
echo '</tbody></table>';
|
||||
?>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportcsv/' . $station_id); ?>" title="Export CSV-file" target="_blank" class="btn btn-primary">Export requested QSLs to CSV-file</a></p>
|
||||
<p><a href="<?php echo site_url('qslprint/exportcsv/' . $station_id); ?>" title="Export CSV-file" class="btn btn-primary">Export requested QSLs to CSV-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/exportadif/' . $station_id); ?>" title="Export ADIF" target="_blank" class="btn btn-primary">Export requested QSLs to ADIF-file</a></p>
|
||||
<p><a href="<?php echo site_url('qslprint/exportadif/' . $station_id); ?>" title="Export ADIF" class="btn btn-primary">Export requested QSLs to ADIF-file</a></p>
|
||||
|
||||
<p><a href="<?php echo site_url('qslprint/qsl_printed/' . $station_id); ?>" title="Mark QSLs as printed" target="_blank" class="btn btn-primary">Mark requested QSLs as sent</a></p>
|
||||
<p><a href="<?php echo site_url('qslprint/qsl_printed/' . $station_id); ?>" title="Mark QSLs as printed" class="btn btn-primary">Mark requested QSLs as sent</a></p>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -267,6 +267,20 @@
|
|||
from the API and filled in location and locator.</div>
|
||||
</td>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="potalookup">POTA auto lookup gridsquare and name for
|
||||
park.</label>
|
||||
<select class="custom-select" id="potalookup" name="user_pota_lookup">
|
||||
<option value="0"><?php echo $this->lang->line('general_word_no'); ?>
|
||||
</option>
|
||||
<option value="1"><?php echo $this->lang->line('general_word_yes'); ?>
|
||||
</option>
|
||||
</select>
|
||||
<div class="small form-text text-muted">If set, name and gridsquare is fetched
|
||||
from the API and filled in location and locator.</div>
|
||||
</td>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -318,13 +318,21 @@
|
|||
<div class="small form-text text-muted">If set, name and gridsquare is fetched from the API and filled in location and locator.</div></td>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="wwfflookup">WWFF auto lookup gridsquare and name for summit.</label>
|
||||
<label for="wwfflookup">WWFF auto lookup gridsquare and name for reference.</label>
|
||||
<select class="custom-select" id="wwfflookup" name="user_wwff_lookup">
|
||||
<option value="1" <?php if ($user_wwff_lookup == 1) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_yes'); ?></option>
|
||||
<option value="0" <?php if ($user_wwff_lookup == 0) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_no'); ?></option>
|
||||
</select>
|
||||
<div class="small form-text text-muted">If set, name and gridsquare is fetched from the API and filled in location and locator.</div></td>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="potalookup">POTA auto lookup gridsquare and name for park.</label>
|
||||
<select class="custom-select" id="potalookup" name="user_pota_lookup">
|
||||
<option value="1" <?php if ($user_pota_lookup == 1) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_yes'); ?></option>
|
||||
<option value="0" <?php if ($user_pota_lookup == 0) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_no'); ?></option>
|
||||
</select>
|
||||
<div class="small form-text text-muted">If set, name and gridsquare is fetched from the API and filled in location and locator.</div></td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -426,7 +426,8 @@ function logQso() {
|
|||
vuccr,
|
||||
]];
|
||||
|
||||
table.rows.add(data).draw();
|
||||
table.rows.add(data);
|
||||
table.draw();
|
||||
|
||||
var formdata = new FormData(document.getElementById("qso_input"));
|
||||
$.ajax({
|
||||
|
|
@ -454,7 +455,8 @@ function logQso() {
|
|||
setSession(formdata);
|
||||
|
||||
var qTable = $('.qsotable').DataTable();
|
||||
qTable.search('').draw();
|
||||
qTable.search('').order([0, 'desc']).draw();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -526,7 +528,8 @@ function restoreContestSession(data) {
|
|||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
"order": [[0, "desc"]]
|
||||
columnDefs: [ { type: 'date', 'targets': [0] } ],
|
||||
order: [0, 'desc']
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,20 @@ function updateRow(qso) {
|
|||
cells.eq(c++).text(qso.dxRefs);
|
||||
cells.eq(c++).text(qso.name);
|
||||
cells.eq(c++).text(qso.qslVia);
|
||||
cells.eq(c++).text(qso.qslSent);
|
||||
cells.eq(c++).text(qso.qslReceived);
|
||||
cells.eq(c++).html(qso.qsl);
|
||||
if ($(".lotwconfirmation")[0]){
|
||||
cells.eq(c++).html(qso.lotw);
|
||||
}
|
||||
if ($(".eqslconfirmation")[0]){
|
||||
cells.eq(c++).html(qso.eqsl);
|
||||
}
|
||||
cells.eq(c++).text(qso.qslMessage);
|
||||
cells.eq(c++).text(qso.dxcc);
|
||||
cells.eq(c++).text(qso.state);
|
||||
cells.eq(c++).text(qso.cqzone);
|
||||
cells.eq(c++).text(qso.iota);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
return row;
|
||||
}
|
||||
|
||||
|
|
@ -60,34 +67,39 @@ function loadQSOTable(rows) {
|
|||
|
||||
for (i = 0; i < rows.length; i++) {
|
||||
let qso = rows[i];
|
||||
|
||||
var data = [
|
||||
'<div class="form-check"><input class="form-check-input" type="checkbox" /></div>',
|
||||
qso.qsoDateTime,
|
||||
qso.de,
|
||||
'<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>',
|
||||
qso.mode,
|
||||
qso.rstS,
|
||||
qso.rstR,
|
||||
qso.band,
|
||||
qso.deRefs,
|
||||
qso.dxRefs,
|
||||
qso.name,
|
||||
qso.qslVia,
|
||||
qso.qslSent,
|
||||
qso.qslReceived,
|
||||
qso.qslMessage,
|
||||
qso.dxcc+(qso.end == null ? '' : ' <span class="badge badge-danger">Deleted DXCC</span>'),
|
||||
qso.state,
|
||||
qso.cqzone,
|
||||
qso.iota,
|
||||
];
|
||||
|
||||
var data = [];
|
||||
data.push('<div class="form-check"><input class="form-check-input" type="checkbox" /></div>');
|
||||
data.push(qso.qsoDateTime);
|
||||
data.push(qso.de);
|
||||
data.push('<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>');
|
||||
data.push(qso.mode);
|
||||
data.push(qso.rstS);
|
||||
data.push(qso.rstR);
|
||||
data.push(qso.band);
|
||||
data.push(qso.deRefs);
|
||||
data.push(qso.dxRefs);
|
||||
data.push(qso.name);
|
||||
data.push(qso.qslVia);
|
||||
data.push(qso.qsl);
|
||||
if ($(".lotwconfirmation")[0]){
|
||||
data.push(qso.lotw);
|
||||
}
|
||||
if ($(".eqslconfirmation")[0]){
|
||||
data.push(qso.eqsl);
|
||||
}
|
||||
data.push(qso.qslMessage);
|
||||
data.push(qso.dxcc+(qso.end == null ? '' : ' <span class="badge badge-danger">Deleted DXCC</span>'));
|
||||
data.push(qso.state);
|
||||
data.push(qso.cqzone);
|
||||
data.push(qso.iota);
|
||||
|
||||
let createdRow = table.row.add(data).index();
|
||||
table.rows(createdRow).nodes().to$().data('qsoID', qso.qsoID);
|
||||
table.row(createdRow).node().id = 'qsoID-' + qso.qsoID;
|
||||
}
|
||||
table.draw();
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
}
|
||||
|
||||
function processNextCallbookItem() {
|
||||
|
|
@ -262,12 +274,12 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
$('#exportAdif').click(function (event) {
|
||||
$('#exportAdif').prop("disabled", true);
|
||||
var elements = $('#qsoList tbody input:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
}
|
||||
$('#exportAdif').prop("disabled", true);
|
||||
var id_list=[];
|
||||
elements.each(function() {
|
||||
let id = $(this).first().closest('tr').data('qsoID')
|
||||
|
|
@ -324,6 +336,9 @@ $(document).ready(function () {
|
|||
$('#dontSend').click(function (event) {
|
||||
handleQsl('N','', 'dontSend');
|
||||
});
|
||||
$('#notRequired').click(function (event) {
|
||||
handleQsl('I','', 'notRequired');
|
||||
});
|
||||
|
||||
$('#searchForm').on('reset', function(e) {
|
||||
setTimeout(function() {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ class QSO
|
|||
private string $QSLSentVia;
|
||||
private string $QSLVia;
|
||||
private ?DateTime $end;
|
||||
/** QSL **/
|
||||
private string $qsl;
|
||||
private string $lotw;
|
||||
private string $eqsl;
|
||||
|
||||
/**
|
||||
* @param array $data Does no validation, it's assumed to be a row from the database in array format
|
||||
|
|
@ -164,6 +168,20 @@ class QSO
|
|||
$this->QSLSentVia = ($data['COL_QSL_SENT_VIA'] === null) ? '' : $data['COL_QSL_SENT_VIA'];
|
||||
$this->QSLVia = ($data['COL_QSL_VIA'] === null) ? '' : $data['COL_QSL_VIA'];
|
||||
|
||||
$CI =& get_instance();
|
||||
// Get Date format
|
||||
if($CI->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $CI->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/cloudlog.php
|
||||
$custom_date_format = $CI->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$this->qsl = $this->getQslString($data, $custom_date_format);
|
||||
$this->lotw = $this->getLotwString($data, $custom_date_format);
|
||||
$this->eqsl = $this->getEqslString($data, $custom_date_format);
|
||||
|
||||
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $data['COL_CQZ'];
|
||||
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
|
||||
$this->dxcc = ($data['name'] === null) ? '- NONE -' :$data['name'];
|
||||
|
|
@ -174,6 +192,210 @@ class QSO
|
|||
$this->end = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getQSLString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$qslstring = '<span ';
|
||||
|
||||
if ($data['COL_QSL_SENT'] != "N") {
|
||||
switch ($data['COL_QSL_SENT']) {
|
||||
case "Y":
|
||||
$qslstring .= "class=\"qsl-green\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_sent');
|
||||
break;
|
||||
case "Q":
|
||||
$qslstring .= "class=\"qsl-yellow\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_queued');
|
||||
break;
|
||||
case "R":
|
||||
$qslstring .= "class=\"qsl-yellow\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_requested');
|
||||
break;
|
||||
case "I":
|
||||
$qslstring .= "class=\"qsl-grey\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_invalid_ignore');
|
||||
break;
|
||||
default:
|
||||
$qslstring .= "class=\"qsl-red";
|
||||
break;
|
||||
}
|
||||
if ($data['COL_QSLSDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_QSLSDATE']);
|
||||
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
|
||||
}
|
||||
} else {
|
||||
$qslstring .= "class=\"qsl-red";
|
||||
}
|
||||
|
||||
if ($data['COL_QSL_SENT_VIA'] != "") {
|
||||
switch ($data['COL_QSL_SENT_VIA']) {
|
||||
case "B":
|
||||
$qslstring .= " (" . $CI->lang->line('general_word_qslcard_bureau') . ")";
|
||||
break;
|
||||
case "D":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_direct').")";
|
||||
break;
|
||||
case "M":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_via').": ".($data['COL_QSL_VIA'] !="" ? $data['COL_QSL_VIA']:"n/a").")";
|
||||
break;
|
||||
case "E":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_electronic').")";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$qslstring .= '">▲</span><span ';
|
||||
|
||||
if ($data['COL_QSL_RCVD'] != "N") {
|
||||
switch ($data['COL_QSL_RCVD']) {
|
||||
case "Y":
|
||||
$qslstring .= "class=\"qsl-green\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_received');
|
||||
break;
|
||||
case "Q":
|
||||
$qslstring .= "class=\"qsl-yellow\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_queued');
|
||||
break;
|
||||
case "R":
|
||||
$qslstring .= "class=\"qsl-yellow\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_requested');
|
||||
break;
|
||||
case "I":
|
||||
$qslstring .= "class=\"qsl-grey\" data-toggle=\"tooltip\" data-original-title=\"".$CI->lang->line('general_word_invalid_ignore');
|
||||
break;
|
||||
default:
|
||||
$qslstring .= "class=\"qsl-red";
|
||||
break;
|
||||
}
|
||||
if ($data['COL_QSLRDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_QSLRDATE']);
|
||||
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
|
||||
}
|
||||
} else {
|
||||
$qslstring .= "class=\"qsl-red"; }
|
||||
if ($data['COL_QSL_RCVD_VIA'] != "") {
|
||||
switch ($data['COL_QSL_RCVD_VIA']) {
|
||||
case "B":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_bureau').")";
|
||||
break;
|
||||
case "D":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_direct').")";
|
||||
break;
|
||||
case "M":
|
||||
$qslstring .= " (Manager)";
|
||||
break;
|
||||
case "E":
|
||||
$qslstring .= " (".$CI->lang->line('general_word_qslcard_electronic').")";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$qslstring .= '">▼</span>';
|
||||
return $qslstring;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getLotwString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$lotwstring = '<span ';
|
||||
|
||||
if ($data['COL_LOTW_QSL_SENT'] == "Y") {
|
||||
$lotwstring .= "data-original-title=\"" . $CI->lang->line('lotw_short')." ".$CI->lang->line('general_word_sent');
|
||||
if ($data['COL_LOTW_QSLSDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_LOTW_QSLSDATE']);
|
||||
$lotwstring .= " ". ($timestamp != '' ? date($custom_date_format, $timestamp) : '');
|
||||
}
|
||||
$lotwstring .= "\" data-toggle=\"tooltip\"";
|
||||
}
|
||||
|
||||
$lotwstring .= ' class="lotw-' . (($data['COL_LOTW_QSL_SENT']=='Y') ? 'green' : 'red') . '">▲</span>';
|
||||
$lotwstring .= '<span ';
|
||||
|
||||
if ($data['COL_LOTW_QSL_RCVD'] == "Y") {
|
||||
$lotwstring .= "data-original-title=\"". $CI->lang->line('lotw_short') ." ". $CI->lang->line('general_word_received');
|
||||
|
||||
if ($data['COL_LOTW_QSLRDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_LOTW_QSLRDATE']);
|
||||
$lotwstring .= " ". ($timestamp != '' ? date($custom_date_format, $timestamp) : '');
|
||||
}
|
||||
|
||||
$lotwstring .= "\" data-toggle=\"tooltip\"";
|
||||
}
|
||||
|
||||
$lotwstring .= ' class="lotw-' . (($data['COL_LOTW_QSL_RCVD']=='Y') ? 'green':'red') . '">▼</span>';
|
||||
|
||||
return $lotwstring;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getEqslString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$eqslstring = '<span ';
|
||||
|
||||
if ($data['COL_EQSL_QSL_SENT'] == "Y") {
|
||||
$eqslstring .= "data-original-title=\"".$CI->lang->line('eqsl_short')." ".$CI->lang->line('general_word_sent');
|
||||
|
||||
if ($data['COL_EQSL_QSLSDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_EQSL_QSLSDATE']);
|
||||
$eqslstring .= " ".($timestamp!=''?date($custom_date_format, $timestamp):'');
|
||||
}
|
||||
|
||||
$eqslstring .= "\" data-toggle=\"tooltip\"";
|
||||
}
|
||||
|
||||
$eqslstring .= ' class="eqsl-' . (($data['COL_EQSL_QSL_SENT'] =='Y') ? 'green':'red') . '">▲</span><span';
|
||||
|
||||
if ($data['COL_EQSL_QSL_RCVD'] == "Y") {
|
||||
$eqslstring .= "data-original-title=\"".$CI->lang->line('eqsl_short')." ".$CI->lang->line('general_word_received');
|
||||
|
||||
if ($data['COL_EQSL_QSLRDATE'] != null) {
|
||||
$timestamp = strtotime($data['COL_EQSL_QSLRDATE']);
|
||||
$eqslstring .= " ".($timestamp!=''?date($custom_date_format, $timestamp):'');
|
||||
}
|
||||
$eqslstring .= "\" data-toggle=\"tooltip\"";
|
||||
}
|
||||
|
||||
$eqslstring .= ' class="eqsl-' . (($data['COL_EQSL_QSL_RCVD'] =='Y')?'green':'red') . '">';
|
||||
|
||||
if($data['COL_EQSL_QSL_RCVD'] =='Y') {
|
||||
$eqslstring .= '<a class="eqsl-green" href="' . site_url("eqsl/image/".$data['COL_PRIMARY_KEY']) . '" data-fancybox="images" data-width="528" data-height="336">▼</a>';
|
||||
} else {
|
||||
$eqslstring .= '▼';
|
||||
}
|
||||
|
||||
$eqslstring .= '</span>';
|
||||
|
||||
return $eqslstring;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
|
@ -471,6 +693,30 @@ class QSO
|
|||
return $this->QSLSentVia;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getqsl(): string
|
||||
{
|
||||
return $this->qsl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getlotw(): string
|
||||
{
|
||||
return $this->lotw;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function geteqsl(): string
|
||||
{
|
||||
return $this->eqsl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -513,8 +759,9 @@ class QSO
|
|||
'deRefs' => $this->getFormattedDeRefs(),
|
||||
'dxRefs' => $this->getFormattedDxRefs(),
|
||||
'qslVia' => $this->QSLVia,
|
||||
'qslSent' => $this->getFormattedQSLSent(),
|
||||
'qslReceived' => $this->getFormattedQSLReceived(),
|
||||
'qsl' => $this->getqsl(),
|
||||
'lotw' => $this->getlotw(),
|
||||
'eqsl' => $this->geteqsl(),
|
||||
'qslMessage' => $this->getQSLMsg(),
|
||||
'name' => $this->getName(),
|
||||
'dxcc' => $this->getDXCC(),
|
||||
|
|
|
|||
正在加载…
在新工单中引用