Merge branch 'dev' of https://github.com/magicbug/Cloudlog into dev
这个提交包含在:
当前提交
5c70f1bece
共有 32 个文件被更改,包括 773 次插入 和 210 次删除
|
|
@ -10,3 +10,5 @@ RewriteRule ^(.*)$ /index.php?/$1 "[L,QSA,B= ?,BNP]"
|
|||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ /index.php?/$1 "[L,QSA,B= ?,BNP]"
|
||||
|
||||
RedirectMatch 404 ^/\.git
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 124;
|
||||
$config['migration_version'] = 125;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ class eqsl extends CI_Controller {
|
|||
|
||||
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
|
||||
$q = $query->row();
|
||||
$username = $q->user_eqsl_name;
|
||||
$username = $qso->COL_STATION_CALLSIGN;
|
||||
$password = $q->user_eqsl_password;
|
||||
|
||||
$image_url = $this->electronicqsl->card_image($username, urlencode($password), $callsign, $band, $mode, $year, $month, $day, $hour, $minute);
|
||||
|
|
@ -559,7 +559,7 @@ class eqsl extends CI_Controller {
|
|||
|
||||
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
|
||||
$q = $query->row();
|
||||
$username = $q->user_eqsl_name;
|
||||
$username = $qso->COL_STATION_CALLSIGN;
|
||||
$password = $q->user_eqsl_password;
|
||||
$error = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ class Gridmap extends CI_Controller {
|
|||
|
||||
$this->load->model('bands');
|
||||
$this->load->model('gridmap_model');
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['homegrid'] = explode(',', $this->stations->find_gridsquare());
|
||||
|
||||
$data['modes'] = $this->gridmap_model->get_worked_modes();
|
||||
$data['bands'] = $this->bands->get_worked_bands();
|
||||
|
|
@ -27,6 +30,7 @@ class Gridmap extends CI_Controller {
|
|||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/leaflet/geocoding.js',
|
||||
'assets/js/leaflet/L.MaidenheadColouredGridMap.js',
|
||||
'assets/js/sections/gridmap.js?'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -87,22 +87,27 @@ class Labels extends CI_Controller {
|
|||
|
||||
}
|
||||
|
||||
public function printids() {
|
||||
$ids = xss_clean(json_decode($this->input->post('id')));
|
||||
$this->load->model('labels_model');
|
||||
$result = $this->labels_model->export_printrequestedids($ids);
|
||||
|
||||
$this->prepareLabel($result, true);
|
||||
}
|
||||
|
||||
public function print($station_id) {
|
||||
$clean_id = xss_clean($station_id);
|
||||
|
||||
$this->load->model('labels_model');
|
||||
$result = $this->labels_model->export_printrequested($clean_id);
|
||||
|
||||
$this->prepareLabel($result);
|
||||
}
|
||||
|
||||
function prepareLabel($qsos, $jscall = false) {
|
||||
$this->load->model('labels_model');
|
||||
$label = $this->labels_model->getDefaultLabel();
|
||||
|
||||
// require_once('fpdf.php');
|
||||
// require('PDF_Label.php');
|
||||
// require_once APPPATH."/src/Label/PDF_Label.php";
|
||||
// require_once APPPATH."/src/Label/fpdf.php";
|
||||
|
||||
// Example of custom format
|
||||
// $pdf = new PDF_Label(array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>1, 'marginTop'=>1, 'NX'=>2, 'NY'=>7, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>99, 'height'=>38, 'font-size'=>14));
|
||||
|
||||
try {
|
||||
if ($label) {
|
||||
$pdf = new PDF_Label(array(
|
||||
|
|
@ -118,14 +123,26 @@ class Labels extends CI_Controller {
|
|||
'height' => $label->height,
|
||||
'font-size' => $label->font_size
|
||||
));
|
||||
} else {
|
||||
if ($jscall) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'You need to create a label and set it to be used for print.'));
|
||||
return;
|
||||
} else {
|
||||
$this->session->set_flashdata('error', 'You need to create a label and set it to be used for print.');
|
||||
redirect('labels');
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
if ($jscall) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'Something went wrong! The label could not be generated. Check label size and font size.'));
|
||||
return;
|
||||
} else {
|
||||
$this->session->set_flashdata('error', 'Something went wrong! The label could not be generated. Check label size and font size.');
|
||||
redirect('labels');
|
||||
}
|
||||
}
|
||||
define('FPDF_FONTPATH', './src/Label/font/');
|
||||
|
||||
$pdf->AddPage();
|
||||
|
|
@ -138,12 +155,11 @@ class Labels extends CI_Controller {
|
|||
$pdf->SetFont($label->font);
|
||||
}
|
||||
|
||||
|
||||
if ($result->num_rows() > 0) {
|
||||
if ($qsos->num_rows() > 0) {
|
||||
if ($label->qsos == 1) {
|
||||
$this->makeOneQsoLabel($result->result(), $pdf);
|
||||
$this->makeOneQsoLabel($qsos->result(), $pdf);
|
||||
} else {
|
||||
$this->makeMultiQsoLabel($result->result(), $pdf, $label->qsos);
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos);
|
||||
}
|
||||
} else {
|
||||
$this->session->set_flashdata('message', '0 QSOs found for print!');
|
||||
|
|
|
|||
|
|
@ -772,7 +772,7 @@ class Logbook extends CI_Controller {
|
|||
function querydb($id) {
|
||||
$this->db->from($this->config->item('table_name'));
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC');
|
||||
$this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer');
|
||||
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
|
||||
$this->db->group_start();
|
||||
$this->db->like(''.$this->config->item('table_name').'.COL_CALL', $id);
|
||||
|
|
|
|||
|
|
@ -106,6 +106,10 @@ class Logbookadvanced extends CI_Controller {
|
|||
'state' => xss_clean($this->input->post('state')),
|
||||
'qsoresults' => xss_clean($this->input->post('qsoresults')),
|
||||
'sats' => xss_clean($this->input->post('sats')),
|
||||
'lotwSent' => xss_clean($this->input->post('lotwSent')),
|
||||
'lotwReceived' => xss_clean($this->input->post('lotwReceived')),
|
||||
'eqslSent' => xss_clean($this->input->post('eqslSent')),
|
||||
'eqslReceived' => xss_clean($this->input->post('eqslReceived')),
|
||||
);
|
||||
|
||||
$qsos = [];
|
||||
|
|
@ -184,4 +188,32 @@ class Logbookadvanced extends CI_Controller {
|
|||
header("Content-Type: application/json");
|
||||
print json_encode($q);
|
||||
}
|
||||
|
||||
function update_qsl_received() {
|
||||
$this->load->model('logbookadvanced_model');
|
||||
|
||||
$ids = xss_clean($this->input->post('id'));
|
||||
$user_id = (int)$this->session->userdata('user_id');
|
||||
$method = xss_clean($this->input->post('method'));
|
||||
$sent = xss_clean($this->input->post('sent'));
|
||||
|
||||
$status = $this->logbookadvanced_model->updateQslReceived($ids, $user_id, $method, $sent);
|
||||
|
||||
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $user_id);
|
||||
|
||||
$results = $data->result('array');
|
||||
|
||||
$qsos = [];
|
||||
foreach ($results as $data) {
|
||||
$qsos[] = new QSO($data);
|
||||
}
|
||||
|
||||
$q = [];
|
||||
foreach ($qsos as $qso) {
|
||||
$q[] = $qso->toArray();
|
||||
}
|
||||
|
||||
header("Content-Type: application/json");
|
||||
print json_encode($q);
|
||||
}
|
||||
}
|
||||
|
|
@ -66,11 +66,15 @@ class Qsl extends CI_Controller {
|
|||
if (isset($_FILES['qslcardfront']) && $_FILES['qslcardfront']['name'] != "" && $_FILES['qslcardfront']['error'] == 0)
|
||||
{
|
||||
$result['front'] = $this->uploadQslCardFront($qsoid);
|
||||
} else {
|
||||
$result['front']['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($_FILES['qslcardback']) && $_FILES['qslcardback']['name'] != "" && $_FILES['qslcardback']['error'] == 0)
|
||||
{
|
||||
$result['back'] = $this->uploadQslCardBack($qsoid);
|
||||
} else {
|
||||
$result['back']['status'] = '';
|
||||
}
|
||||
|
||||
header("Content-type: application/json");
|
||||
|
|
@ -170,6 +174,13 @@ class Qsl extends CI_Controller {
|
|||
echo json_encode($result);
|
||||
}
|
||||
|
||||
function viewQsl() {
|
||||
$cleanid = $this->security->xss_clean($this->input->post('id'));
|
||||
$this->load->model('Qsl_model');
|
||||
$data['qslimages'] = $this->Qsl_model->getQslForQsoId($cleanid);
|
||||
$this->load->view('qslcard/qslcarousel', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Functions for storage, these need shifted to a libary to use across Cloudlog
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ $lang['general_word_lotw'] = 'Logbook of the World';
|
|||
$lang['general_edit_qso'] = 'Edit QSO';
|
||||
$lang['general_mark_qsl_rx_bureau'] = 'Mark QSL Received (Bureau)';
|
||||
$lang['general_mark_qsl_rx_direct'] = 'Mark QSL Received (Direct)';
|
||||
$lang['general_mark_qsl_rx_electronic'] = 'Mark QSL Received (Electronic)';
|
||||
$lang['general_mark_qsl_tx_bureau'] = 'Mark QSL Sent (Bureau)';
|
||||
$lang['general_mark_qsl_tx_direct'] = 'Mark QSL Sent (Direct)';
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ $lang['menu_notes'] = 'Notes';
|
|||
$lang['menu_analytics'] = 'Analytics';
|
||||
$lang['menu_statistics'] = 'Statistics';
|
||||
$lang['menu_gridsquares'] = 'Gridsquares';
|
||||
$lang['menu_gridmap'] = 'Gridmap';
|
||||
$lang['menu_gridmap'] = 'Gridsquare Map';
|
||||
$lang['menu_activated_gridsquares'] = 'Activated Gridsquares';
|
||||
$lang['menu_gridsquare_activators'] = 'Gridsquare Activators';
|
||||
$lang['menu_distances_worked'] = 'Distances Worked';
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ $lang['general_word_lotw'] = 'Logbook of the World';
|
|||
$lang['general_edit_qso'] = 'QSO bearbeiten';
|
||||
$lang['general_mark_qsl_rx_bureau'] = 'Markiere QSL erhalten (Büro)';
|
||||
$lang['general_mark_qsl_rx_direct'] = 'Markiere QSL erhalten (Direkt)';
|
||||
$lang['general_mark_qsl_rx_electronic'] = 'Markiere QSL erhalten (Elektronisch)';
|
||||
$lang['general_mark_qsl_tx_bureau'] = 'Markiere QSL gesendet (Büro)';
|
||||
$lang['general_mark_qsl_tx_direct'] = 'Markiere QSL gesendet (Direkt)';
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Migration_lotw_enddates extends CI_Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if ($this->db->table_exists('lotw_certs')) {
|
||||
$sql = 'UPDATE lotw_certs SET qso_end_date = DATE_ADD(qso_end_date, INTERVAL 24*60*60 -1 SECOND) WHERE TIME(qso_end_date) = "00:00:00";';
|
||||
$this->db->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if ($this->db->table_exists('lotw_certs')) {
|
||||
$sql = 'UPDATE lotw_certs SET qso_end_date = DATE_SUB(qso_end_date, INTERVAL 24*60*60 -1 SECOND) WHERE TIME(qso_end_date) = "23:59:59";';
|
||||
$this->db->query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,4 +127,16 @@ class Labels_model extends CI_Model {
|
|||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function export_printrequestedids($ids) {
|
||||
$this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');
|
||||
$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');
|
||||
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
|
||||
$this->db->where_in('COL_PRIMARY_KEY', $ids);
|
||||
$this->db->order_by("COL_DXCC", "ASC");
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
@ -694,10 +694,10 @@ class Logbook_model extends CI_Model {
|
|||
$sat_name = '';
|
||||
if ($data['COL_SAT_NAME'] == 'AO-7') {
|
||||
if ($data['COL_BAND'] == '2m' && $data['COL_BAND_RX'] == '10m') {
|
||||
$sat_name = '[A]_AO-7';
|
||||
$sat_name = 'AO-7[A]';
|
||||
}
|
||||
if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
|
||||
$sat_name = '[B]_AO-7';
|
||||
$sat_name = 'AO-7[B]';
|
||||
}
|
||||
} else if ($data['COL_SAT_NAME'] == 'QO-100') {
|
||||
$sat_name = 'QO-100_NB';
|
||||
|
|
|
|||
|
|
@ -56,6 +56,24 @@ class Logbookadvanced_model extends CI_Model {
|
|||
$binding[] = $searchCriteria['qslReceived'];
|
||||
}
|
||||
|
||||
if ($searchCriteria['lotwSent'] !== '') {
|
||||
$conditions[] = "COL_LOTW_QSL_SENT = ?";
|
||||
$binding[] = $searchCriteria['lotwSent'];
|
||||
}
|
||||
if ($searchCriteria['lotwReceived'] !== '') {
|
||||
$conditions[] = "COL_LOTW_QSL_RCVD = ?";
|
||||
$binding[] = $searchCriteria['lotwReceived'];
|
||||
}
|
||||
|
||||
if ($searchCriteria['eqslSent'] !== '') {
|
||||
$conditions[] = "COL_EQSL_QSL_SENT = ?";
|
||||
$binding[] = $searchCriteria['eqslSent'];
|
||||
}
|
||||
if ($searchCriteria['eqslReceived'] !== '') {
|
||||
$conditions[] = "COL_EQSL_QSL_RCVD = ?";
|
||||
$binding[] = $searchCriteria['eqslReceived'];
|
||||
}
|
||||
|
||||
if ($searchCriteria['iota'] !== '') {
|
||||
$conditions[] = "COL_IOTA = ?";
|
||||
$binding[] = $searchCriteria['iota'];
|
||||
|
|
@ -101,6 +119,11 @@ class Logbookadvanced_model extends CI_Model {
|
|||
INNER JOIN station_profile ON qsos.station_id=station_profile.station_id
|
||||
LEFT OUTER JOIN dxcc_entities ON qsos.col_dxcc=dxcc_entities.adif
|
||||
LEFT OUTER JOIN lotw_users ON qsos.col_call=lotw_users.callsign
|
||||
LEFT OUTER JOIN (
|
||||
select count(*) as qslcount, qsoid
|
||||
from qsl_images
|
||||
group by qsoid
|
||||
) x on qsos.COL_PRIMARY_KEY = x.qsoid
|
||||
WHERE station_profile.user_id = ?
|
||||
$where
|
||||
ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
|
||||
|
|
@ -132,10 +155,17 @@ class Logbookadvanced_model extends CI_Model {
|
|||
$order = $this->getSortorder($sortorder);
|
||||
|
||||
$sql = "
|
||||
SELECT *, dxcc_entities.name AS station_country
|
||||
SELECT qsos.*, d2.*, lotw_users.*, station_profile.*, x.qslcount, dxcc_entities.name AS station_country
|
||||
FROM " . $this->config->item('table_name') . " qsos
|
||||
INNER JOIN station_profile ON qsos.station_id = station_profile.station_id
|
||||
LEFT OUTER JOIN dxcc_entities ON qsos.COL_MY_DXCC = dxcc_entities.adif
|
||||
LEFT OUTER JOIN dxcc_entities d2 ON qsos.COL_DXCC = d2.adif
|
||||
LEFT OUTER JOIN lotw_users ON qsos.col_call=lotw_users.callsign
|
||||
LEFT OUTER JOIN (
|
||||
select count(*) as qslcount, qsoid
|
||||
from qsl_images
|
||||
group by qsoid
|
||||
) x on qsos.COL_PRIMARY_KEY = x.qsoid
|
||||
WHERE station_profile.user_id = ?
|
||||
$where
|
||||
$order
|
||||
|
|
@ -215,6 +245,24 @@ class Logbookadvanced_model extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
public function updateQslReceived($ids, $user_id, $method, $sent) {
|
||||
$this->load->model('user_model');
|
||||
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
return array('message' => 'Error');
|
||||
} else {
|
||||
$data = array(
|
||||
'COL_QSLRDATE' => date('Y-m-d H:i:s'),
|
||||
'COL_QSL_RCVD' => $sent,
|
||||
'COL_QSL_RCVD_VIA' => $method
|
||||
);
|
||||
$this->db->where_in('COL_PRIMARY_KEY', json_decode($ids, true));
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
|
||||
return array('message' => 'OK');
|
||||
}
|
||||
}
|
||||
|
||||
public function updateQsoWithCallbookInfo($qsoID, $qso, $callbook) {
|
||||
$updatedData = array();
|
||||
if (!empty($callbook['name']) && empty($qso['COL_NAME'])) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class LotwCert extends CI_Model {
|
|||
'date_created' => $date_created,
|
||||
'date_expires' => $date_expires,
|
||||
'qso_start_date' => $qso_start_date,
|
||||
'qso_end_date' => $qso_end_date,
|
||||
'qso_end_date' => $qso_end_date . ' 23:59:59',
|
||||
'cert_key' => $cert_key,
|
||||
'cert' => $general_cert,
|
||||
);
|
||||
|
|
@ -60,7 +60,7 @@ class LotwCert extends CI_Model {
|
|||
'date_created' => $date_created,
|
||||
'date_expires' => $date_expires,
|
||||
'qso_start_date' => $qso_start_date,
|
||||
'qso_end_date' => $qso_end_date,
|
||||
'qso_end_date' => $qso_end_date . ' 23:59:59',
|
||||
'cert_key' => $cert_key,
|
||||
'cert' => $general_cert
|
||||
);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class Pota extends CI_Model {
|
|||
|
||||
$bandslots = $this->bands->get_worked_bands('pota');
|
||||
|
||||
if(!$bandslots) return null;
|
||||
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
$this->db->where_in("col_band", $bandslots);
|
||||
$this->db->order_by("COL_POTA_REF", "ASC");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class Sota extends CI_Model {
|
|||
|
||||
$bandslots = $this->bands->get_worked_bands('sota');
|
||||
|
||||
if(!$bandslots) return null;
|
||||
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
$this->db->where_in("col_band", $bandslots);
|
||||
$this->db->order_by("COL_SOTA_REF", "ASC");
|
||||
|
|
|
|||
|
|
@ -372,14 +372,14 @@ class Stations extends CI_Model {
|
|||
$sql="
|
||||
SELECT station_profile.station_id, station_profile.station_profile_name, station_profile.station_callsign, notc.c notcount, totc.c totcount
|
||||
FROM station_profile
|
||||
INNER JOIN (
|
||||
LEFT OUTER JOIN (
|
||||
SELECT qsos.station_id, COUNT(qsos.COL_PRIMARY_KEY) c
|
||||
FROM %s qsos
|
||||
LEFT JOIN webadif ON qsos.COL_PRIMARY_KEY = webadif.qso_id
|
||||
WHERE webadif.qso_id IS NULL AND qsos.COL_SAT_NAME = 'QO-100'
|
||||
GROUP BY qsos.station_id
|
||||
) notc ON station_profile.station_id = notc.station_id
|
||||
INNER JOIN (
|
||||
LEFT JOIN (
|
||||
SELECT qsos.station_id, COUNT(qsos.COL_PRIMARY_KEY) c
|
||||
FROM %s qsos
|
||||
WHERE qsos.COL_SAT_NAME = 'QO-100'
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class Wwff extends CI_Model {
|
|||
|
||||
$bandslots = $this->bands->get_worked_bands('wwff');
|
||||
|
||||
if(!$bandslots) return null;
|
||||
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
$this->db->where_in("col_band", $bandslots);
|
||||
$this->db->order_by("COL_WWFF_REF", "ASC");
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
padding: 6px 8px;
|
||||
font: 14px Arial, Helvetica, sans-serif;
|
||||
background: white;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
line-height: 24px;
|
||||
color: #555;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.legend h4 {
|
||||
text-align: center;
|
||||
|
|
@ -25,7 +25,19 @@
|
|||
height: 18px;
|
||||
float: left;
|
||||
margin: 0 8px 0 0;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.coordinates {
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
.cohidden {
|
||||
display:none;
|
||||
}
|
||||
#latDeg, #lngDeg {
|
||||
width: 170px;
|
||||
}
|
||||
#locator, #distance, #bearing {
|
||||
width: 120px;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
|
|
@ -94,10 +106,23 @@
|
|||
<div id="gridmapcontainer">
|
||||
<div id="gridsquare_map" style="width: 100%; height: 800px"></div>
|
||||
</div>
|
||||
<div class="coordinates d-flex">
|
||||
<div class="cohidden">Latitude: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="latDeg"></div>
|
||||
<div class="cohidden">Longitude: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="lngDeg"></div>
|
||||
<div class="cohidden">Gridsquare: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="locator"></div>
|
||||
<div class="cohidden">Distance: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="distance"></div>
|
||||
<div class="cohidden">Bearing: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="bearing"></div>
|
||||
</div>
|
||||
<script>var gridsquaremap = true;
|
||||
<?php
|
||||
echo 'var jslayer ="' . $layer .'";';
|
||||
echo "var jsattribution ='" . $attribution . "';";
|
||||
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
|
||||
|
||||
echo 'var gridsquares_gridsquares = "' . $gridsquares_gridsquares . '";';
|
||||
echo 'var gridsquares_gridsquares_confirmed = "' . $gridsquares_gridsquares_confirmed . '";';
|
||||
|
|
|
|||
|
|
@ -2398,7 +2398,7 @@ function viewEqsl(picture, callsign) {
|
|||
$("#qslcardfront").val(null);
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (data.status.front.status != '') {
|
||||
$("#qslupload").append('<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Front QSL Card:' +
|
||||
data.status.front.error +
|
||||
'</div>');
|
||||
|
|
@ -2436,7 +2436,7 @@ function viewEqsl(picture, callsign) {
|
|||
$(".carouselExampleIndicators").carousel();
|
||||
$("#qslcardback").val(null);
|
||||
}
|
||||
} else {
|
||||
} else if (data.status.back.status != '') {
|
||||
$("#qslupload").append('<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>\nBack QSL Card: ' +
|
||||
data.status.back.error +
|
||||
'</div>');
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@
|
|||
</div>
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
|
||||
<form id="searchForm" name="searchForm" action="<?php echo base_url()."index.php/logbookadvanced/search";?>" method="post">
|
||||
<div class="filterbody collapse">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label class="form-label" for="dateFrom">From</label>
|
||||
|
|
@ -142,6 +144,8 @@
|
|||
<option value="TR">Tropospheric ducting</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="qslSent">QSL Sent</label>
|
||||
<select id="qslSent" name="qslSent" class="form-control form-control-sm">
|
||||
|
|
@ -165,37 +169,89 @@
|
|||
</select>
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="qsoResults"># Results</label>
|
||||
<select id="qsoResults" name="qsoResults" class="form-control form-control-sm">
|
||||
<label for="lotwSent">LoTW Sent</label>
|
||||
<select id="lotwSent" name="lotwSent" class="form-control form-control-sm">
|
||||
<option value="">All</option>
|
||||
<option value="Y">Yes</option>
|
||||
<option value="N">No</option>
|
||||
<option value="R">Requested</option>
|
||||
<option value="Q">Queued</option>
|
||||
<option value="I">Ignore/Invalid</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="lotwReceived">LoTW Received</label>
|
||||
<select id="lotwReceived" name="lotwReceived" class="form-control form-control-sm">
|
||||
<option value="">All</option>
|
||||
<option value="Y">Yes</option>
|
||||
<option value="N">No</option>
|
||||
<option value="R">Requested</option>
|
||||
<option value="I">Ignore/Invalid</option>
|
||||
<option value="V">Verified</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="eqslSent">eQSL Sent</label>
|
||||
<select id="eqslSent" name="eqslSent" class="form-control form-control-sm">
|
||||
<option value="">All</option>
|
||||
<option value="Y">Yes</option>
|
||||
<option value="N">No</option>
|
||||
<option value="R">Requested</option>
|
||||
<option value="Q">Queued</option>
|
||||
<option value="I">Ignore/Invalid</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
|
||||
<label for="eqslReceived">eQSL Received</label>
|
||||
<select id="eqslReceived" name="eqslReceived" class="form-control form-control-sm">
|
||||
<option value="">All</option>
|
||||
<option value="Y">Yes</option>
|
||||
<option value="N">No</option>
|
||||
<option value="R">Requested</option>
|
||||
<option value="I">Ignore/Invalid</option>
|
||||
<option value="V">Verified</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="actionbody collapse">
|
||||
<div class="mb-2">
|
||||
<span class="h6">With selected :</span>
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" id="btnUpdateFromCallbook">Update from Callbook</button>
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" id="queueBureau">Queue Bureau</button>
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" id="queueDirect">Queue Direct</button>
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" id="queueElectronic">Queue Electronic</button>
|
||||
<button type="button" class="btn btn-sm btn-success mr-1" id="sentBureau">Sent Bureau</button>
|
||||
<button type="button" class="btn btn-sm btn-success mr-1" id="sentDirect">Sent Direct</button>
|
||||
<button type="button" class="btn btn-sm btn-success mr-1" id="sentElectronic">Sent Electronic</button>
|
||||
<button type="button" class="btn btn-sm btn-warning mr-1" id="dontSend">Not Sent</button>
|
||||
<button type="button" class="btn btn-sm btn-warning mr-1" id="notRequired">QSL Not Required</button>
|
||||
<button type="button" class="btn btn-sm btn-warning mr-1" id="receivedBureau">Received (bureau)</button>
|
||||
<button type="button" class="btn btn-sm btn-warning mr-1" id="receivedDirect">Received (direct)</button>
|
||||
<button type="button" class="btn btn-sm btn-info mr-1" id="exportAdif">Create ADIF</button>
|
||||
<button type="button" class="btn btn-sm btn-info mr-1" id="printLabel">Print Label</button>
|
||||
<button type="button" class="btn btn-sm btn-danger mr-1" id="deleteQsos">Delete</button>
|
||||
<span id="infoBox"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row pt-2">
|
||||
<div class="form-group form-inline col-lg d-flex flex-row justify-content-center align-items-center">
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".filterbody">Filters</button>
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".actionbody">Actions</button>
|
||||
<label for="qsoResults" class="mr-2"># Results</label>
|
||||
<select id="qsoResults" name="qsoResults" class="form-control form-control-sm mr-2">
|
||||
<option value="250">250</option>
|
||||
<option value="1000">1000</option>
|
||||
<option value="2500">2500</option>
|
||||
<option value="5000">5000</option>
|
||||
</select>
|
||||
<button type="submit" class="btn btn-sm btn-primary mr-1" id="searchButton">Search</button>
|
||||
<button type="reset" class="btn btn-sm btn-danger mr-1" id="resetButton">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-lg col-md-3 col-sm-3 col-xl-1">
|
||||
<label> </label><br>
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="searchButton">Search</button>
|
||||
<button type="reset" class="btn btn-sm btn-danger" id="resetButton">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="mb-2">
|
||||
<span class="h6">With selected :</span>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="btnUpdateFromCallbook">Update from Callbook</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="queueBureau">Queue Bureau</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="queueDirect">Queue Direct</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="queueElectronic">Queue Electronic</button>
|
||||
<button type="button" class="btn btn-sm btn-success" id="sentBureau">Sent Bureau</button>
|
||||
<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">Not Sent</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>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table style="width:100%" class="table-sm table table-bordered table-hover table-striped table-condensed text-center" id="qsoList">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -228,6 +284,4 @@
|
|||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<li data-target="#carouselExampleIndicators" data-slide-to="' . $i . '"';
|
||||
if ($i == 0) {
|
||||
echo 'class="active"';
|
||||
}
|
||||
$i++;
|
||||
echo '></li>';
|
||||
}
|
||||
?>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<div class="text-center carousel-item carouselimageid_' . $image->id;
|
||||
if ($i == 1) {
|
||||
echo ' active';
|
||||
}
|
||||
echo '">';
|
||||
echo '<img class="img-fluid w-qsl" src="' . base_url() . '/assets/qslcard/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -508,6 +508,8 @@
|
|||
<p><div class="alert alert-warning" role="alert"><span class="badge badge-warning">Warning</span> Maximum file upload size is <?php echo $max_upload; ?>B.</div></p>
|
||||
|
||||
<form class="form" id="fileinfo" name="fileinfo" enctype="multipart/form-data">
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<fieldset>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -515,58 +517,45 @@
|
|||
<input class="form-control-file" type="file" id="qslcardfront" name="qslcardfront" accept="image/*" >
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="form-control" id="qsoinputid" name="qsoid" value="<?php echo $row->COL_PRIMARY_KEY; ?>">
|
||||
<button type="button" onclick="uploadQsl();" id="button1id" name="button1id" class="btn btn-primary"><?php echo lang('qslcard_upload_button'); ?></button>
|
||||
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label for="qslcardback"><?php echo lang('qslcard_upload_back'); ?></label>
|
||||
<input class="form-control-file" type="file" id="qslcardback" name="qslcardback" accept="image/*">
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="form-control" id="qsoinputid" name="qsoid" value="<?php echo $row->COL_PRIMARY_KEY; ?>">
|
||||
|
||||
<button type="button" onclick="uploadQsl();" id="button1id" name="button1id" class="btn btn-primary"><?php echo lang('qslcard_upload_button'); ?></button>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<p>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<button type="button" onclick="qsl_rcvd(<?php echo $row->COL_PRIMARY_KEY; ?>, 'B');" id="qslrxb" name="qslrxb" class="btn btn-sm btn-success ld-ext-right ld-ext-right-r-B"><i class="fas fa-envelope"></i> <?php echo lang('general_mark_qsl_rx_bureau'); ?> <div class="ld ld-ring ld-spin"></div></button>
|
||||
|
||||
<button type="button" onclick="qsl_rcvd(<?php echo $row->COL_PRIMARY_KEY; ?>, 'D');" id="qslrxd" name="qslrxd" class="btn btn-sm btn-success ld-ext-right ld-ext-right-r-D"><i class="fas fa-envelope"></i> <?php echo lang('general_mark_qsl_rx_direct'); ?> <div class="ld ld-ring ld-spin"></div></button>
|
||||
|
||||
<button type="button" onclick="qsl_rcvd(<?php echo $row->COL_PRIMARY_KEY; ?>, 'E');" id="qslrxe" name="qslrxe" class="btn btn-sm btn-success ld-ext-right ld-ext-right-r-E"><i class="fas fa-envelope"></i> <?php echo lang('general_mark_qsl_rx_electronic'); ?> <div class="ld ld-ring ld-spin"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<button type="button" onclick="qsl_requested(<?php echo $row->COL_PRIMARY_KEY; ?>, 'B');" id="qsltxb" name="qsltxb" class="btn btn-sm btn-warning ld-ext-right ld-ext-right-t-B"><i class="fas fa-envelope"></i> Mark QSL Card Requested (Bureau) <div class="ld ld-ring ld-spin"></div></button>
|
||||
|
||||
<button type="button" onclick="qsl_requested(<?php echo $row->COL_PRIMARY_KEY; ?>, 'D');" id="qsltxd" name="qsltxd" class="btn btn-sm btn-warning ld-ext-right ld-ext-right-t-D"><i class="fas fa-envelope"></i> Mark QSL Card Requested (Direct) <div class="ld ld-ring ld-spin"></div></button>
|
||||
|
||||
<button type="button" onclick="qsl_ignore(<?php echo $row->COL_PRIMARY_KEY; ?>, 'I');" id="qsltxi" name="qsltxi" class="btn btn-sm btn-warning ld-ext-right ld-ext-right-ignore"><i class="fas fa-envelope"></i> Mark QSL Card Not Required <div class="ld ld-ring ld-spin"></div></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="qslcard" role="tabpanel" aria-labelledby="table-tab">
|
||||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<li data-target="#carouselExampleIndicators" data-slide-to="' . $i . '"';
|
||||
if ($i == 0) {
|
||||
echo 'class="active"';
|
||||
}
|
||||
$i++;
|
||||
echo '></li>';
|
||||
}
|
||||
?>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($qslimages as $image) {
|
||||
echo '<center><div class="carousel-item carouselimageid_' . $image->id;
|
||||
if ($i == 1) {
|
||||
echo ' active';
|
||||
}
|
||||
echo '">';
|
||||
echo '<img class="img-fluid w-qsl" src="' . base_url() . '/assets/qslcard/' . $image->filename .'" alt="QSL picture #'. $i++.'">';
|
||||
echo '</div></center>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
<?php $this->load->view('qslcard/qslcarousel', $qslimages); ?>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="eqslcard" role="tabpanel" aria-labelledby="table-tab">
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@
|
|||
|
||||
<?php
|
||||
if ($station_profile->result()) {
|
||||
$queuedqsos = 0;
|
||||
foreach ($station_profile->result() as $count) { // Fills the table with the data
|
||||
$queuedqsos += $count->notcount;
|
||||
}
|
||||
if ($queuedqsos > 0) {
|
||||
?>
|
||||
<p>You need to set a QO-100 Dx Club API key in your station profile. Only station profiles with an API Key are displayed.</p>
|
||||
<p><span class="badge badge-warning">Warning</span> This might take a while as QSO uploads are processed sequentially.</p>
|
||||
|
|
@ -41,6 +46,7 @@
|
|||
</thead>
|
||||
<tbody>';
|
||||
foreach ($station_profile->result() as $station) { // Fills the table with the data
|
||||
if ($station->notcount != null) {
|
||||
echo '<tr>';
|
||||
echo '<td>' . $station->station_profile_name . '</td>';
|
||||
echo '<td>' . $station->station_callsign . '</td>';
|
||||
|
|
@ -49,7 +55,16 @@
|
|||
echo '<td><button id="webadifUpload" type="button" name="webadifUpload" class="btn btn-primary btn-sm ld-ext-right" onclick="ExportWebADIF('. $station->station_id .')"><i class="fas fa-cloud-upload-alt"></i> Upload<div class="ld ld-ring ld-spin"></div></button></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
echo '</tfoot></table>';
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success">
|
||||
There are currently no outstanding QSOs that need to be uploaded to the QO-100 Dx Club's API.<br />
|
||||
Go ahead and turn on your QO-100 station!
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
127
assets/js/leaflet/geocoding.js
普通文件
127
assets/js/leaflet/geocoding.js
普通文件
|
|
@ -0,0 +1,127 @@
|
|||
const isValidLocatorString = locatorString => locatorString.match(/^[A-Ra-r][A-Ra-r]\d\d[A-Xa-x][A-Xa-x]/) !== null;
|
||||
const charToNumber = char => char.toUpperCase().charCodeAt(0) - CHAR_CODE_OFFSET;
|
||||
const numberToChar = number => String.fromCharCode(number + CHAR_CODE_OFFSET);
|
||||
const CHAR_CODE_OFFSET = 65;
|
||||
const degToRad = deg => (deg % 360) * Math.PI / 180;
|
||||
const radToDeg = rad => (rad / Math.PI *180) % 360;
|
||||
const isValidPoint = (lat, lng) => (lat >= -90 && lat <= 90) && (lng >= -180 && lng <= 180);
|
||||
|
||||
function ConvertDDToDMS(lat, lng) {
|
||||
var LatLng = [];
|
||||
|
||||
if (lng < -180) {
|
||||
lng = lng + 360;
|
||||
}
|
||||
if (lng > 180) {
|
||||
lng = lng - 360;
|
||||
}
|
||||
|
||||
LatLng['latDeg'] = (lat < 0 ? "S" : "N") + " " + pad((0 |(lat < 0 ? (lat = -lat) : lat)), 2) + "° " + pad(0 | (((lat += 1e-9) % 1) * 60),2) + "' " + ((0 | (((lat * 60) % 1) * 6000)) / 100) + "\"";
|
||||
|
||||
LatLng['lngDeg'] = (lng < 0 ? "W" : "E") + " " + pad((0 | (lng < 0 ? (lng = -lng) : lng)), 3) + "° " + pad(0 | (((lng += 1e-9) % 1) * 60),2) + "' " + ((0 | (((lng * 60) % 1) * 6000)) / 100) + "\"";
|
||||
|
||||
return LatLng;
|
||||
}
|
||||
|
||||
function pad(n, width, z) {
|
||||
z = z || '0';
|
||||
n = n + '';
|
||||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||
}
|
||||
|
||||
const latLngToLocator = (lat, lng) => {
|
||||
if (lng < -180) {
|
||||
lng = lng + 360;
|
||||
}
|
||||
if (lng > 180) {
|
||||
lng = lng - 360;
|
||||
}
|
||||
if (!isValidPoint(lat, lng)) {
|
||||
throw new Error('Input is not a valid coordinate');
|
||||
}
|
||||
|
||||
const longitude = lng + 180;
|
||||
const latitude = lat + 90;
|
||||
|
||||
const fieldLng = numberToChar(Math.floor(longitude / 20));
|
||||
const fieldLat = numberToChar(Math.floor(latitude / 10));
|
||||
|
||||
const squareLng = Math.floor(longitude % 20 / 2);
|
||||
const squareLat = Math.floor(latitude % 10);
|
||||
|
||||
const subsquareLng = numberToChar(Math.floor((longitude % 20 % 2) * 12)).toLowerCase();
|
||||
const subsquareLat = numberToChar((latitude % 10 - squareLat) * 24).toLowerCase();
|
||||
|
||||
return fieldLng + fieldLat + squareLng + squareLat + subsquareLng + subsquareLat;
|
||||
};
|
||||
|
||||
function onMapMove(event) {
|
||||
var LatLng = event.latlng;
|
||||
var lat = LatLng.lat;
|
||||
var lng = LatLng.lng;
|
||||
var LatLng2 = ConvertDDToDMS(lat, lng);
|
||||
$('#latDeg').html(LatLng2.latDeg);
|
||||
$('#lngDeg').html(LatLng2.lngDeg);
|
||||
var locator = latLngToLocator(lat,lng);
|
||||
$('#locator').html(locator);
|
||||
var distance = bearingDistance(homegrid, locator);
|
||||
|
||||
$('#bearing').html(distance.deg + ' deg');
|
||||
$('#distance').html(Math.round(distance.km * 10) / 10 + ' km');
|
||||
};
|
||||
|
||||
const bearingDistance = (from, to) => {
|
||||
const fromCoords = locatorToLatLng(from);
|
||||
const toCoords = locatorToLatLng(to);
|
||||
const dLat = degToRad(toCoords[0] - fromCoords[0]);
|
||||
const dLon = degToRad(toCoords[1] - fromCoords[1]);
|
||||
const fromLat = degToRad(fromCoords[0]);
|
||||
const toLat = degToRad(toCoords[0]);
|
||||
const a = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(fromLat) * Math.cos(toLat);
|
||||
const b = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
|
||||
const y = (dLon) * Math.cos(fromLat) * Math.cos(toLat);
|
||||
const x = Math.sin(toLat) - Math.sin(fromLat) * Math.cos(b);
|
||||
|
||||
let az = Math.atan2(y, x);
|
||||
|
||||
if (az < 0) {
|
||||
az += 2 * Math.PI;
|
||||
}
|
||||
|
||||
return {
|
||||
km: b * 6371,
|
||||
deg: calcAngle(fromCoords, toCoords)
|
||||
};
|
||||
};
|
||||
|
||||
var calcAngle = function (p1, p2) {
|
||||
var lat1 = p1[0] / 180 * Math.PI;
|
||||
var lat2 = p2[0] / 180 * Math.PI;
|
||||
var lng1 = p1[1] / 180 * Math.PI;
|
||||
var lng2 = p2[1] / 180 * Math.PI;
|
||||
var y = Math.sin(lng2-lng1) * Math.cos(lat2);
|
||||
var x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(lng2-lng1);
|
||||
var brng = (Math.atan2(y, x) * 180 / Math.PI + 360).toFixed(0);
|
||||
|
||||
return (brng % 360);
|
||||
}
|
||||
|
||||
const locatorToLatLng = (locatorString) => {
|
||||
locatorString += 'll'; // append subsquare in case is 4 chars long... If not, is ignored.
|
||||
if (!isValidLocatorString(locatorString)) {
|
||||
throw new Error('Input is not valid locator string');
|
||||
}
|
||||
|
||||
const fieldLng = charToNumber(locatorString[0]) * 20;
|
||||
const fieldLat = charToNumber(locatorString[1]) * 10;
|
||||
const squareLng = Number.parseInt(locatorString[2]) * 2;
|
||||
const squareLat = Number.parseInt(locatorString[3]);
|
||||
const subsquareLng = (charToNumber(locatorString[4]) + 0.5) / 12;
|
||||
const subsquareLat = (charToNumber(locatorString[5]) + 0.5) / 24;
|
||||
|
||||
return [
|
||||
fieldLat + squareLat + subsquareLat - 90,
|
||||
fieldLng + squareLng + subsquareLng - 180
|
||||
];
|
||||
};
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
function qsl_rcvd(id, method) {
|
||||
$(".ld-ext-right-r-"+method).addClass('running');
|
||||
$(".ld-ext-right-r-"+method).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/qsl_rcvd_ajax',
|
||||
type: 'post',
|
||||
|
|
@ -6,6 +8,8 @@ function qsl_rcvd(id, method) {
|
|||
'method': method
|
||||
},
|
||||
success: function(data) {
|
||||
$(".ld-ext-right-r-"+method).removeClass('running');
|
||||
$(".ld-ext-right-r-"+method).prop('disabled', false);
|
||||
if (data.message == 'OK') {
|
||||
$("#qsl_" + id).find("span:eq(1)").attr('class', 'qsl-green'); // Paints arrow green
|
||||
$(".qsl_rcvd_" + id).remove(); // removes choice from menu
|
||||
|
|
@ -39,6 +43,8 @@ function qsl_sent(id, method) {
|
|||
// Function: qsl_requested
|
||||
// Marks QSL card requested against the QSO.
|
||||
function qsl_requested(id, method) {
|
||||
$(".ld-ext-right-t-"+method).addClass('running');
|
||||
$(".ld-ext-right-t-"+method).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/qsl_requested_ajax',
|
||||
type: 'post',
|
||||
|
|
@ -46,6 +52,8 @@ function qsl_requested(id, method) {
|
|||
'method': method
|
||||
},
|
||||
success: function(data) {
|
||||
$(".ld-ext-right-t-"+method).removeClass('running');
|
||||
$(".ld-ext-right-t-"+method).prop('disabled', false);
|
||||
if (data.message == 'OK') {
|
||||
$("#qsl_" + id).find("span:eq(0)").attr('class', 'qsl-yellow'); // Paints arrow yellow
|
||||
}
|
||||
|
|
@ -59,6 +67,8 @@ function qsl_requested(id, method) {
|
|||
// Function: qsl_ignore
|
||||
// Marks QSL card ignore against the QSO.
|
||||
function qsl_ignore(id, method) {
|
||||
$(".ld-ext-right-ignore").addClass('running');
|
||||
$(".ld-ext-right-ignore").prop('disabled', true);
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/qsl_ignore_ajax',
|
||||
type: 'post',
|
||||
|
|
@ -66,6 +76,8 @@ function qsl_ignore(id, method) {
|
|||
'method': method
|
||||
},
|
||||
success: function(data) {
|
||||
$(".ld-ext-right-ignore").removeClass('running');
|
||||
$(".ld-ext-right-ignore").prop('disabled', false);
|
||||
if (data.message == 'OK') {
|
||||
$("#qsl_" + id).find("span:eq(0)").attr('class', 'qsl-grey'); // Paints arrow grey
|
||||
}
|
||||
|
|
@ -358,7 +370,7 @@ function validateLocator(locator) {
|
|||
}
|
||||
|
||||
// This displays the dialog with the form and it's where the resulttable is displayed
|
||||
function spawnLookupModal() {
|
||||
function spawnLookupModal(searchphrase, searchtype) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/lookup',
|
||||
type: 'post',
|
||||
|
|
@ -372,6 +384,35 @@ function spawnLookupModal() {
|
|||
onshown: function(dialog) {
|
||||
$('#quicklookuptype').change(function(){
|
||||
var type = $('#quicklookuptype').val();
|
||||
changeLookupType(type);
|
||||
});
|
||||
if (searchtype !== undefined) {
|
||||
$('#quicklookuptype').val(searchtype);
|
||||
if (searchtype == 'dxcc') {
|
||||
$("#quicklookupdxcc").val(searchphrase);
|
||||
} else if (searchtype == 'iota') {
|
||||
$("#quicklookupiota").val(searchphrase);
|
||||
} else if (searchtype == 'cq') {
|
||||
$("#quicklookupcqz").val(searchphrase);
|
||||
} else {
|
||||
$("#quicklookuptext").val(searchphrase);
|
||||
}
|
||||
changeLookupType(searchtype);
|
||||
getLookupResult(this.form);
|
||||
}
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Close',
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changeLookupType(type) {
|
||||
if (type == "dxcc") {
|
||||
$('#quicklookupdxcc').show();
|
||||
$('#quicklookupiota').hide();
|
||||
|
|
@ -403,17 +444,6 @@ function spawnLookupModal() {
|
|||
$('#quicklookupdxcc').hide();
|
||||
$('#quicklookuptext').hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Close',
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// This function executes the call to the backend for fetching queryresult and displays the table in the dialog
|
||||
|
|
@ -457,3 +487,31 @@ function getDxccResult(dxcc, name) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function displayQsl(id) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qsl/viewQsl',
|
||||
type: 'post',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
success: function (html) {
|
||||
BootstrapDialog.show({
|
||||
title: 'QSL Card',
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: 'lookup-dialog',
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function(dialog) {
|
||||
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Close',
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ function gridPlot(form) {
|
|||
sat: $("#sats").val(),
|
||||
},
|
||||
success: function (data) {
|
||||
$('.cohidden').show();
|
||||
$(".ld-ext-right").removeClass('running');
|
||||
$(".ld-ext-right").prop('disabled', false);
|
||||
$('#plot').prop("disabled", false);
|
||||
|
|
@ -89,6 +90,7 @@ function gridPlot(form) {
|
|||
legend.addTo(map);
|
||||
|
||||
var maidenhead = L.maidenhead().addTo(map);
|
||||
map.on('mousemove', onMapMove);
|
||||
},
|
||||
error: function (data) {
|
||||
},
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ function updateRow(qso) {
|
|||
let c = 1;
|
||||
cells.eq(c++).text(qso.qsoDateTime);
|
||||
cells.eq(c++).text(qso.de);
|
||||
cells.eq(c++).html('<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>' + (qso.callsign == '' ? '' : ' <small id="lotw_info" class="badge badge-success'+qso.lotw_hint+'" data-toggle="tooltip" data-original-title="LoTW User. Last upload was ' + qso.lastupload + '">L</small>'));
|
||||
cells.eq(c++).html('<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>' + (qso.callsign == '' ? '' : ' <small id="lotw_info" class="badge badge-success'+qso.lotw_hint+'" data-toggle="tooltip" data-original-title="LoTW User. Last upload was ' + qso.lastupload + '">L</small>') + ' <a target="_blank" href="https://www.qrz.com/db/'+qso.dx+'"><img width="16" height="16" src="'+base_url+ 'images/icons/qrz.png" alt="Lookup ' + qso.dx + ' on QRZ.com"></a> <a target="_blank" href="https://www.hamqth.com/'+qso.dx+'"><img width="16" height="16" src="'+base_url+ 'images/icons/hamqth.png" alt="Lookup ' + qso.dx + ' on HamQTH"></a>');
|
||||
cells.eq(c++).text(qso.mode);
|
||||
cells.eq(c++).text(qso.rstS);
|
||||
cells.eq(c++).text(qso.rstR);
|
||||
cells.eq(c++).text(qso.band);
|
||||
cells.eq(c++).text(qso.deRefs);
|
||||
cells.eq(c++).text(qso.dxRefs);
|
||||
cells.eq(c++).html(qso.dxRefs);
|
||||
cells.eq(c++).text(qso.name);
|
||||
cells.eq(c++).text(qso.qslVia);
|
||||
cells.eq(c++).html(qso.qsl);
|
||||
|
|
@ -43,10 +43,10 @@ function updateRow(qso) {
|
|||
cells.eq(c++).html(qso.lotw);
|
||||
}
|
||||
cells.eq(c++).text(qso.qslMessage);
|
||||
cells.eq(c++).text(qso.dxcc);
|
||||
cells.eq(c++).html(qso.dxcc);
|
||||
cells.eq(c++).text(qso.state);
|
||||
cells.eq(c++).text(qso.cqzone);
|
||||
cells.eq(c++).text(qso.iota);
|
||||
cells.eq(c++).html(qso.cqzone);
|
||||
cells.eq(c++).html(qso.iota);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
return row;
|
||||
|
|
@ -81,7 +81,7 @@ function loadQSOTable(rows) {
|
|||
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>' + (qso.callsign == '' ? '' : ' <small id="lotw_info" class="badge badge-success'+qso.lotw_hint+'" data-toggle="tooltip" data-original-title="LoTW User. Last upload was ' + qso.lastupload + ' ">L</small>'));
|
||||
data.push('<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>' + (qso.callsign == '' ? '' : ' <small id="lotw_info" class="badge badge-success'+qso.lotw_hint+'" data-toggle="tooltip" data-original-title="LoTW User. Last upload was ' + qso.lastupload + ' ">L</small>') + ' <a target="_blank" href="https://www.qrz.com/db/'+qso.dx+'"><img width="16" height="16" src="'+base_url+ 'images/icons/qrz.png" alt="Lookup ' + qso.dx + ' on QRZ.com"></a> <a target="_blank" href="https://www.hamqth.com/'+qso.dx+'"><img width="16" height="16" src="'+base_url+ 'images/icons/hamqth.png" alt="Lookup ' + qso.dx + ' on HamQTH"></a>');
|
||||
data.push(qso.mode);
|
||||
data.push(qso.rstS);
|
||||
data.push(qso.rstR);
|
||||
|
|
@ -187,7 +187,11 @@ $(document).ready(function () {
|
|||
gridsquare: this.gridsquare.value,
|
||||
state: this.state.value,
|
||||
qsoresults: this.qsoResults.value,
|
||||
sats: this.sats.value
|
||||
sats: this.sats.value,
|
||||
lotwSent: this.lotwSent.value,
|
||||
lotwReceived: this.lotwReceived.value,
|
||||
eqslSent: this.eqslSent.value,
|
||||
eqslReceived: this.eqslReceived.value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
|
@ -348,6 +352,65 @@ $(document).ready(function () {
|
|||
$('#notRequired').click(function (event) {
|
||||
handleQsl('I','', 'notRequired');
|
||||
});
|
||||
$('#receivedBureau').click(function (event) {
|
||||
handleQslReceived('Y','B', 'receivedBureau');
|
||||
});
|
||||
$('#receivedDirect').click(function (event) {
|
||||
handleQslReceived('Y','D', 'receivedDirect');
|
||||
});
|
||||
|
||||
$('#printLabel').click(function (event) {
|
||||
var elements = $('#qsoList tbody input:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
}
|
||||
$('#printLabel').prop("disabled", true);
|
||||
|
||||
var id_list=[];
|
||||
|
||||
elements.each(function() {
|
||||
let id = $(this).first().closest('tr').data('qsoID')
|
||||
id_list.push(id);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/labels/printids',
|
||||
type: 'post',
|
||||
data: {'id': JSON.stringify(id_list, null, 2) },
|
||||
xhr:function(){
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType= 'blob'
|
||||
return xhr;
|
||||
},
|
||||
success: function(data) {
|
||||
if(data){
|
||||
var file = new Blob([data], {type: 'application/pdf'});
|
||||
var fileURL = URL.createObjectURL(file);
|
||||
window.open(fileURL);
|
||||
}
|
||||
$.each(id_list, function(k, v) {
|
||||
unselectQsoID(this);
|
||||
});
|
||||
$('#printLabel').prop("disabled", false);
|
||||
},
|
||||
error: function (data) {
|
||||
BootstrapDialog.alert({
|
||||
title: 'ERROR',
|
||||
message: 'Something went wrong with label print. Go to labels and check if you have defined a label, and that it is set for print!',
|
||||
type: BootstrapDialog.TYPE_DANGER,
|
||||
closable: false,
|
||||
draggable: false,
|
||||
callback: function (result) {
|
||||
}
|
||||
});
|
||||
$.each(id_list, function(k, v) {
|
||||
unselectQsoID(this);
|
||||
});
|
||||
$('#printLabel').prop("disabled", false);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$('#searchForm').on('reset', function(e) {
|
||||
setTimeout(function() {
|
||||
|
|
@ -386,6 +449,37 @@ $(document).ready(function () {
|
|||
});
|
||||
}
|
||||
|
||||
function handleQslReceived(sent, method, tag) {
|
||||
var elements = $('#qsoList tbody input:checked');
|
||||
var nElements = elements.length;
|
||||
if (nElements == 0) {
|
||||
return;
|
||||
}
|
||||
$('#'+tag).prop("disabled", true);
|
||||
var id_list=[];
|
||||
elements.each(function() {
|
||||
let id = $(this).first().closest('tr').data('qsoID')
|
||||
id_list.push(id);
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/logbookadvanced/update_qsl_received',
|
||||
type: 'post',
|
||||
data: {'id': JSON.stringify(id_list, null, 2),
|
||||
'sent' : sent,
|
||||
'method' : method
|
||||
},
|
||||
success: function(data) {
|
||||
if (data !== []) {
|
||||
$.each(data, function(k, v) {
|
||||
updateRow(this);
|
||||
unselectQsoID(this.qsoID);
|
||||
});
|
||||
}
|
||||
$('#'+tag).prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#checkBoxAll').change(function (event) {
|
||||
if (this.checked) {
|
||||
$('#qsoList tbody tr').each(function (i) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
*/
|
||||
|
||||
$config['app_name'] = "Cloudlog";
|
||||
$config['app_version'] = "2.4.3";
|
||||
$config['app_version'] = "2.4.4";
|
||||
$config['directory'] = "%directory%";
|
||||
$config['callbook'] = "hamqth"; // Options are hamqth or qrz
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ class QSO
|
|||
private string $dxcc;
|
||||
private string $iota;
|
||||
/** @var string[] */
|
||||
private array $deVUCCGridsquares;
|
||||
private string $deVUCCGridsquares;
|
||||
private string $stationGridsquare;
|
||||
private string $dxGridsquare;
|
||||
private string $dxIOTA;
|
||||
private string $dxSig;
|
||||
|
|
@ -45,7 +46,7 @@ class QSO
|
|||
private string $dxDARCDOK;
|
||||
private string $dxSOTAReference;
|
||||
/** @var string[] */
|
||||
private array $dxVUCCGridsquares;
|
||||
private string $dxVUCCGridsquares;
|
||||
private string $QSLMsg;
|
||||
private ?DateTime $QSLReceivedDate;
|
||||
private string $QSLReceived;
|
||||
|
|
@ -159,7 +160,9 @@ class QSO
|
|||
$this->deIOTAIslandID = $data['COL_MY_IOTA_ISLAND_ID'] ?? '';
|
||||
$this->deSOTAReference = $data['COL_MY_SOTA_REF'] ?? '';
|
||||
|
||||
$this->deVUCCGridsquares = ($data['COL_MY_VUCC_GRIDS'] === null) ? [] : explode(",", $data['COL_MY_VUCC_GRIDS'] ?? '');
|
||||
$this->deVUCCGridsquares = $data['COL_MY_VUCC_GRIDS'] ?? '';
|
||||
|
||||
$this->stationGridsquare = $data['station_gridsquare'] ?? '';
|
||||
|
||||
$this->dxGridsquare = $data['COL_GRIDSQUARE'] ?? '';
|
||||
$this->dxIOTA = $data['COL_IOTA'] ?? '';
|
||||
|
|
@ -169,7 +172,7 @@ class QSO
|
|||
|
||||
$this->dxSOTAReference = $data['COL_SOTA_REF'] ?? '';
|
||||
|
||||
$this->dxVUCCGridsquares = ($data['COL_VUCC_GRIDS'] === null) ? [] : explode(",", $data['COL_VUCC_GRIDS'] ?? '');
|
||||
$this->dxVUCCGridsquares = $data['COL_VUCC_GRIDS'] ?? '';
|
||||
|
||||
$this->QSLMsg = $data['COL_QSLMSG'] ?? '';
|
||||
|
||||
|
|
@ -185,10 +188,10 @@ class QSO
|
|||
$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->cqzone = ($data['COL_CQZ'] === null) ? '' : '<a href="javascript:spawnLookupModal('.$data['COL_CQZ'].',\'cq\');">'.$data['COL_CQZ'].'</a>';
|
||||
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
|
||||
$this->dxcc = ($data['name'] === null) ? '- NONE -' : ucwords(strtolower($data['name']), "- (/");
|
||||
$this->iota = ($data['COL_IOTA'] === null) ? '' :$data['COL_IOTA'];
|
||||
$this->dxcc = ($data['name'] === null) ? '- NONE -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['name']), "- (/").'</a>';
|
||||
$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']);
|
||||
if (array_key_exists('end', $data)) {
|
||||
$this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC'));
|
||||
} else {
|
||||
|
|
@ -196,10 +199,18 @@ class QSO
|
|||
}
|
||||
$this->callsign = ($data['callsign'] === null) ? '' :$data['callsign'];
|
||||
$this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload']));
|
||||
$this->lotw_hint = $this->getLotwHint($data['lastupload']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getLotwHint($lastupload): string
|
||||
{
|
||||
$lotw_hint = '';
|
||||
if ($data['lastupload'] !== null) {
|
||||
if ($lastupload !== null) {
|
||||
$diff = time();
|
||||
$diff = (time() - strtotime($data['lastupload'])) / 86400;
|
||||
$diff = (time() - strtotime($lastupload)) / 86400;
|
||||
if ($diff > 365) {
|
||||
$lotw_hint = ' lotw_info_red';
|
||||
} elseif ($diff > 30) {
|
||||
|
|
@ -208,8 +219,7 @@ class QSO
|
|||
$lotw_hint = ' lotw_info_yellow';
|
||||
}
|
||||
}
|
||||
$this->lotw_hint = $lotw_hint;
|
||||
|
||||
return $lotw_hint;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -218,14 +228,6 @@ class QSO
|
|||
function getQSLString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$qslstring = '<span ';
|
||||
|
||||
|
|
@ -315,6 +317,9 @@ class QSO
|
|||
}
|
||||
}
|
||||
$qslstring .= '">▼</span>';
|
||||
if ($data['qslcount'] != null) {
|
||||
$qslstring .= ' <a href="javascript:displayQsl('.$data['COL_PRIMARY_KEY'].');"><i class="fa fa-id-card"></i></a>';
|
||||
}
|
||||
return $qslstring;
|
||||
}
|
||||
|
||||
|
|
@ -324,14 +329,6 @@ class QSO
|
|||
function getLotwString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$lotwstring = '<span ';
|
||||
|
||||
|
|
@ -369,14 +366,6 @@ class QSO
|
|||
function getEqslString($data, $custom_date_format): string
|
||||
{
|
||||
$CI =& get_instance();
|
||||
// Load language files
|
||||
$CI->lang->load(array(
|
||||
'contesting',
|
||||
'qslcard',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
'qso'
|
||||
));
|
||||
|
||||
$eqslstring = '<span ';
|
||||
|
||||
|
|
@ -595,7 +584,7 @@ class QSO
|
|||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDeVUCCGridsquares(): array
|
||||
public function getDeVUCCGridsquares(): string
|
||||
{
|
||||
return $this->deVUCCGridsquares;
|
||||
}
|
||||
|
|
@ -651,7 +640,7 @@ class QSO
|
|||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDxVUCCGridsquares(): array
|
||||
public function getDxVUCCGridsquares(): string
|
||||
{
|
||||
return $this->dxVUCCGridsquares;
|
||||
}
|
||||
|
|
@ -825,8 +814,8 @@ class QSO
|
|||
private function getFormattedDeRefs(): string
|
||||
{
|
||||
$refs = [];
|
||||
if ($this->deVUCCGridsquares !== []) {
|
||||
$refs[] = implode(",", $this->deVUCCGridsquares);
|
||||
if ($this->deVUCCGridsquares !== '') {
|
||||
$refs[] = $this->deVUCCGridsquares;
|
||||
} else {
|
||||
if ($this->deGridsquare !== '') {
|
||||
$refs[] = $this->deGridsquare;
|
||||
|
|
@ -851,10 +840,10 @@ class QSO
|
|||
private function getFormattedDxRefs(): string
|
||||
{
|
||||
$refs = [];
|
||||
if ($this->dxVUCCGridsquares !== []) {
|
||||
$refs[] = implode(",", $this->dxVUCCGridsquares);
|
||||
if ($this->dxVUCCGridsquares !== '') {
|
||||
$refs[] = $this->dxVUCCGridsquares . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
|
||||
} else if ($this->dxGridsquare !== '') {
|
||||
$refs[] = $this->dxGridsquare;
|
||||
$refs[] = $this->dxGridsquare . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
|
||||
}
|
||||
if ($this->dxSOTAReference !== '') {
|
||||
$refs[] = "SOTA:" . $this->dxSOTAReference;
|
||||
|
|
@ -961,4 +950,22 @@ class QSO
|
|||
|
||||
return trim(implode(" ", $label));
|
||||
}
|
||||
|
||||
private function getQrbLink($mygrid, $grid, $vucc) : string
|
||||
{
|
||||
if (!empty($grid)) {
|
||||
return '<a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
|
||||
} else if (!empty($vucc)) {
|
||||
return '<a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
private function getIotaLink($iota) : string
|
||||
{
|
||||
if ($iota !== '') {
|
||||
return '<a href="javascript:spawnLookupModal(\''.$iota.'\',\'iota\');">'.$iota.'</a> <a href="https://www.iota-world.org/iotamaps/?grpref=' .$iota . '" target="_blank"><i class="fas fa-globe"></i></a>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
正在加载…
在新工单中引用