[Advanced Logbook] Added SOTA, POTA, WWFF searches and refs

这个提交包含在:
Andreas 2023-07-07 10:03:52 +02:00
父节点 878094a5ab
当前提交 6fc021f14c
共有 5 个文件被更改,包括 174 次插入77 次删除

查看文件

@ -1,4 +1,4 @@
<?php
<?php
use Cloudlog\QSLManager\QSO;
@ -47,10 +47,10 @@ class Logbookadvanced extends CI_Controller {
$pageData['dxccarray'] = $this->logbook_model->fetchDxcc();
$pageData['iotaarray'] = $this->logbook_model->fetchIota();
$pageData['sats'] = $this->bands->get_worked_sats();
$pageData['bands'] = $this->bands->get_worked_bands();
$CI =& get_instance();
$CI =& get_instance();
// Get Date format
if($CI->session->userdata('user_date_format')) {
// If Logged in and session exists
@ -111,6 +111,10 @@ class Logbookadvanced extends CI_Controller {
'lotwReceived' => xss_clean($this->input->post('lotwReceived')),
'eqslSent' => xss_clean($this->input->post('eqslSent')),
'eqslReceived' => xss_clean($this->input->post('eqslReceived')),
'qslvia' => xss_clean($this->input->post('qslvia')),
'sota' => xss_clean($this->input->post('sota')),
'pota' => xss_clean($this->input->post('pota')),
'wwff' => xss_clean($this->input->post('wwff')),
);
$qsos = [];
@ -175,7 +179,7 @@ class Logbookadvanced extends CI_Controller {
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $user_id);
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
@ -203,7 +207,7 @@ class Logbookadvanced extends CI_Controller {
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $user_id);
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
@ -217,4 +221,4 @@ class Logbookadvanced extends CI_Controller {
header("Content-Type: application/json");
print json_encode($q);
}
}
}

查看文件

@ -94,6 +94,26 @@ class Logbookadvanced_model extends CI_Model {
$binding[] = $searchCriteria['cqzone'];
}
if ($searchCriteria['qslvia'] !== '') {
$conditions[] = "COL_QSL_VIA like ?";
$binding[] = $searchCriteria['qslvia'].'%';
}
if ($searchCriteria['sota'] !== '') {
$conditions[] = "COL_SOTA_REF like ?";
$binding[] = $searchCriteria['sota'].'%';
}
if ($searchCriteria['pota'] !== '') {
$conditions[] = "COL_POTA_REF like ?";
$binding[] = $searchCriteria['pota'].'%';
}
if ($searchCriteria['wwff'] !== '') {
$conditions[] = "COL_WWFF_REF like ?";
$binding[] = $searchCriteria['wwff'].'%';
}
if ($searchCriteria['gridsquare'] !== '') {
$conditions[] = "(COL_GRIDSQUARE like ? or COL_VUCC_GRIDS like ?)";
$binding[] = '%' . $searchCriteria['gridsquare'] . '%';
@ -138,12 +158,12 @@ class Logbookadvanced_model extends CI_Model {
$data = $this->db->query($sql, $binding);
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
}
return $qsos;
}
@ -245,7 +265,7 @@ class Logbookadvanced_model extends CI_Model {
);
$this->db->where_in('COL_PRIMARY_KEY', json_decode($ids, true));
$this->db->update($this->config->item('table_name'), $data);
return array('message' => 'OK');
}
}
@ -263,7 +283,7 @@ class Logbookadvanced_model extends CI_Model {
);
$this->db->where_in('COL_PRIMARY_KEY', json_decode($ids, true));
$this->db->update($this->config->item('table_name'), $data);
return array('message' => 'OK');
}
}
@ -315,19 +335,19 @@ class Logbookadvanced_model extends CI_Model {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
return null;
}
$modes = array();
$this->db->select('distinct col_mode, coalesce(col_submode, "") col_submode', FALSE);
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->order_by('col_mode, col_submode', 'ASC');
$query = $this->db->get($this->config->item('table_name'));
foreach($query->result() as $mode){
if ($mode->col_submode == null || $mode->col_submode == "") {
array_push($modes, $mode->col_mode);

查看文件

@ -55,7 +55,7 @@
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="dxcc">DXCC</label>
<select class="form-control form-control-sm" id="dxcc" name="dxcc">
<option value="">-</option>
<option value="">-</option>
<option value="0">- NONE - (e.g. /MM, /AM)</option>
<?php
foreach($dxccarray as $dxcc){
@ -156,6 +156,18 @@
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="sota">SOTA</label>
<input type="text" name="sota" id="sota" class="form-control form-control-sm" value="">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="wwff">WWFF</label>
<input type="text" name="wwff" id="wwff" class="form-control form-control-sm" value="">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="pota">POTA</label>
<input type="text" name="pota" id="pota" class="form-control form-control-sm" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
@ -224,9 +236,20 @@
<option value="V">Verified</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qslvia">QSL Via</label>
<datalist id="qslvia" name="qslvia">
<option value="">All</option>
<option value="B">Bureau</option>
<option value="D">Direct</option>
<option value="E">Electronic</option>
<option value="M">Manager</option>
</datalist>
<input type="search" list="qslvia" name="qslviainput" class="custom-select custom-select-sm">
</div>
</div>
</div>
<div class="actionbody collapse">
<div class="mb-2">
<span class="h6">With selected :</span>
@ -257,6 +280,9 @@
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchCqZone">Search CQ Zone</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchMode">Search Mode</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchBand">Search Band</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchSota">Search SOTA</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchWwff">Search WWFF</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchPota">Search POTA</button>
</div>
</div>
</div>
@ -309,4 +335,4 @@
<tbody>
</tbody>
</table>
</div>
</div>

查看文件

@ -73,7 +73,7 @@ function loadQSOTable(rows) {
var table = $('#qsoList').DataTable();
table.clear();
for (i = 0; i < rows.length; i++) {
let qso = rows[i];
@ -102,7 +102,7 @@ function loadQSOTable(rows) {
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;
@ -193,6 +193,10 @@ $(document).ready(function () {
lotwReceived: this.lotwReceived.value,
eqslSent: this.eqslSent.value,
eqslReceived: this.eqslReceived.value,
qslvia: $('[name="qslviainput"]').val(),
sota: this.sota.value,
pota: this.pota.value,
wwff: this.wwff.value,
},
dataType: 'json',
success: function (data) {
@ -392,6 +396,18 @@ $(document).ready(function () {
quickSearch('band');
});
$('#searchSota').click(function (event) {
quickSearch('sota');
});
$('#searchWwff').click(function (event) {
quickSearch('wwff');
});
$('#searchPota').click(function (event) {
quickSearch('pota');
});
function quickSearch(type) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
@ -419,7 +435,7 @@ $(document).ready(function () {
}
elements.each(function() {
var currentRow = $(this).first().closest('tr');
var col1 = '';
var col1 = '';
switch (type) {
case 'dxcc': var tdoffset = (offset + 16); col1 = currentRow.find("td:eq("+tdoffset+")").html(); col1 = col1.match(/\d/g); col1 = col1.join(""); break;
case 'cqzone': var tdoffset = (offset + 18); col1 = currentRow.find("td:eq("+tdoffset+")").text(); break;
@ -427,6 +443,9 @@ $(document).ready(function () {
case 'state': var tdoffset = (offset + 17); col1 = currentRow.find("td:eq("+tdoffset+")").text(); break;
case 'dx': col1 = currentRow.find("td:eq(3)").text(); col1 = col1.match(/^([^\s]+)/gm); break;
case 'gridsquare': col1 = $(currentRow).find('#dxgrid').text(); col1 = col1.substring(0, 4); break;
case 'sota': col1 = $(currentRow).find('#dxsota').text(); break;
case 'wwff': col1 = $(currentRow).find('#dxwwff').text(); break;
case 'pota': col1 = $(currentRow).find('#dxpota').text(); break;
case 'mode': col1 = currentRow.find("td:eq(4)").text(); break;
case 'band': col1 = currentRow.find("td:eq(7)").text(); col1 = col1.match(/\S\w*/); break;
}
@ -462,10 +481,10 @@ $(document).ready(function () {
return xhr;
},
success: function(data) {
if(data){
if(data){
var file = new Blob([data], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
window.open(fileURL);
window.open(fileURL);
}
$.each(id_list, function(k, v) {
unselectQsoID(this);

查看文件

@ -45,6 +45,8 @@ class QSO
private string $dxSigInfo;
private string $dxDARCDOK;
private string $dxSOTAReference;
private string $dxPOTAReference;
private string $dxWWFFReference;
/** @var string[] */
private string $dxVUCCGridsquares;
private string $QSLMsg;
@ -107,6 +109,8 @@ class QSO
'COL_MY_SOTA_REF',
'COL_MY_VUCC_GRIDS',
'COL_SOTA_REF',
'COL_POTA_REF',
'COL_WWFF_REF',
'COL_SUBMODE',
'COL_VUCC_GRIDS',
'COL_CQZ',
@ -125,7 +129,7 @@ class QSO
$this->qsoID = $data['COL_PRIMARY_KEY'];
$CI =& get_instance();
$CI =& get_instance();
// Get Date format
if($CI->session->userdata('user_date_format')) {
// If Logged in and session exists
@ -134,7 +138,7 @@ class QSO
// Get Default date format from /config/cloudlog.php
$custom_date_format = $CI->config->item('qso_date_format');
}
$this->qsoDateTime = date($custom_date_format . " H:i", strtotime($data['COL_TIME_ON']));
$this->qsoDateTime = date($custom_date_format . " H:i", strtotime($data['COL_TIME_ON']));
$this->de = $data['COL_STATION_CALLSIGN'];
$this->dx = $data['COL_CALL'];
@ -171,6 +175,8 @@ class QSO
$this->dxDARCDOK = $data['COL_DARC_DOK'] ?? '';
$this->dxSOTAReference = $data['COL_SOTA_REF'] ?? '';
$this->dxPOTAReference = $data['COL_POTA_REF'] ?? '';
$this->dxWWFFReference = $data['COL_WWFF_REF'] ?? '';
$this->dxVUCCGridsquares = $data['COL_VUCC_GRIDS'] ?? '';
@ -183,11 +189,11 @@ class QSO
$this->QSLSent = ($data['COL_QSL_SENT'] === null) ? '' : $data['COL_QSL_SENT'];
$this->QSLSentVia = ($data['COL_QSL_SENT_VIA'] === null) ? '' : $data['COL_QSL_SENT_VIA'];
$this->QSLVia = ($data['COL_QSL_VIA'] === null) ? '' : $data['COL_QSL_VIA'];
$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) ? '' : '<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 -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['name']), "- (/").'</a>';
@ -227,7 +233,7 @@ class QSO
*/
function getQSLString($data, $custom_date_format): string
{
$CI =& get_instance();
$CI =& get_instance();
$qslstring = '<span ';
@ -250,11 +256,11 @@ class QSO
break;
}
if ($data['COL_QSLSDATE'] != null) {
$timestamp = strtotime($data['COL_QSLSDATE']);
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
$timestamp = strtotime($data['COL_QSLSDATE']);
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
}
} else {
$qslstring .= "class=\"qsl-red";
} else {
$qslstring .= "class=\"qsl-red";
}
if ($data['COL_QSL_SENT_VIA'] != "") {
@ -272,7 +278,7 @@ class QSO
$qslstring .= " (".$CI->lang->line('general_word_qslcard_electronic').")";
break;
}
}
}
$qslstring .= '">&#9650;</span><span ';
@ -295,10 +301,10 @@ class QSO
break;
}
if ($data['COL_QSLRDATE'] != null) {
$timestamp = strtotime($data['COL_QSLRDATE']);
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
$timestamp = strtotime($data['COL_QSLRDATE']);
$qslstring .= " " .($timestamp != '' ? date($custom_date_format, $timestamp) : '');
}
} else {
} else {
$qslstring .= "class=\"qsl-red"; }
if ($data['COL_QSL_RCVD_VIA'] != "") {
switch ($data['COL_QSL_RCVD_VIA']) {
@ -315,45 +321,45 @@ class QSO
$qslstring .= " (".$CI->lang->line('general_word_qslcard_electronic').")";
break;
}
}
}
$qslstring .= '">&#9660;</span>';
if ($data['qslcount'] != null) {
$qslstring .= ' <a href="javascript:displayQsl('.$data['COL_PRIMARY_KEY'].');"><i class="fa fa-id-card"></i></a>';
}
return $qslstring;
}
/**
* @return string
*/
function getLotwString($data, $custom_date_format): string
{
$CI =& get_instance();
$CI =& get_instance();
$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\"";
}
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') . '">&#9650;</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\"";
}
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') . '">&#9660;</span>';
@ -365,32 +371,32 @@ class QSO
*/
function getEqslString($data, $custom_date_format): string
{
$CI =& get_instance();
$CI =& get_instance();
$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\"";
}
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') . '">&#9650;</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\"";
}
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') . '">';
@ -637,6 +643,22 @@ class QSO
return $this->dxSOTAReference;
}
/**
* @return string
*/
public function getDxPOTAReference(): string
{
return $this->dxPOTAReference;
}
/**
* @return string
*/
public function getWWFFReference(): string
{
return $this->dxWWFFReference;
}
/**
* @return string[]
*/
@ -846,7 +868,13 @@ class QSO
$refs[] = '<span id="dxgrid">' . $this->dxGridsquare . '</span> ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
}
if ($this->dxSOTAReference !== '') {
$refs[] = "SOTA:" . $this->dxSOTAReference;
$refs[] = "SOTA: " . '<span id="dxsota">' . $this->dxSOTAReference. '</span>';
}
if ($this->dxPOTAReference !== '') {
$refs[] = "POTA: " . '<span id="dxpota">' . $this->dxPOTAReference. '</span>';
}
if ($this->dxWWFFReference !== '') {
$refs[] = "WWFF: " . '<span id="dxwwff">' . $this->dxWWFFReference. '</span>';
}
if ($this->dxSig !== '') {
$refs[] = $this->dxSig . ":" . $this->dxSigInfo;