[Advanced Logbook] Added Quickfilter search. Mark one line and click filter button

pull/2250/head
Andreas 2023-07-05 09:29:13 +02:00
rodzic 9efb2f3233
commit 9d73c30f91
5 zmienionych plików z 112 dodań i 18 usunięć

Wyświetl plik

@ -104,6 +104,7 @@ class Logbookadvanced extends CI_Controller {
'propmode' => xss_clean($this->input->post('propmode')), 'propmode' => xss_clean($this->input->post('propmode')),
'gridsquare' => xss_clean($this->input->post('gridsquare')), 'gridsquare' => xss_clean($this->input->post('gridsquare')),
'state' => xss_clean($this->input->post('state')), 'state' => xss_clean($this->input->post('state')),
'cqzone' => xss_clean($this->input->post('cqzone')),
'qsoresults' => xss_clean($this->input->post('qsoresults')), 'qsoresults' => xss_clean($this->input->post('qsoresults')),
'sats' => xss_clean($this->input->post('sats')), 'sats' => xss_clean($this->input->post('sats')),
'lotwSent' => xss_clean($this->input->post('lotwSent')), 'lotwSent' => xss_clean($this->input->post('lotwSent')),

Wyświetl plik

@ -89,6 +89,11 @@ class Logbookadvanced_model extends CI_Model {
$binding[] = $searchCriteria['state']; $binding[] = $searchCriteria['state'];
} }
if ($searchCriteria['cqzone'] !== '') {
$conditions[] = "COL_CQZ = ?";
$binding[] = $searchCriteria['cqzone'];
}
if ($searchCriteria['gridsquare'] !== '') { if ($searchCriteria['gridsquare'] !== '') {
$conditions[] = "(COL_GRIDSQUARE like ? or COL_VUCC_GRIDS like ?)"; $conditions[] = "(COL_GRIDSQUARE like ? or COL_VUCC_GRIDS like ?)";
$binding[] = '%' . $searchCriteria['gridsquare'] . '%'; $binding[] = '%' . $searchCriteria['gridsquare'] . '%';

Wyświetl plik

@ -144,6 +144,18 @@
<option value="TR">Tropospheric ducting</option> <option value="TR">Tropospheric ducting</option>
</select> </select>
</div> </div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="cqzone">CQ Zone</label>
<select id="cqzone" name="cqzone" class="form-control form-control-sm">
<option value="">All</option>
<?php
for ($i = 1; $i<=40; $i++) {
echo '<option value="'. $i . '">'. $i .'</option>';
}
?>
?>
</select>
</div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl"> <div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
@ -216,28 +228,41 @@
</div> </div>
<div class="actionbody collapse"> <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>
</div>
</div>
<div class="quickfilterbody collapse">
<div class="mb-2"> <div class="mb-2">
<span class="h6">With selected :</span> <span class="h6">Quick search 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="searchCallsign">Search Callsign</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="searchDxcc">Search DXCC</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="searchIota">Search IOTA</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-primary mr-1" id="searchState">Search State</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-primary mr-1" id="searchGridsquare">Search Gridsquare</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-primary mr-1" id="searchCqZone">Search CQ Zone</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-primary mr-1" id="searchMode">Search Mode</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-primary mr-1" id="searchBand">Search Band</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>
</div> </div>
<div class="form-row pt-2"> <div class="form-row pt-2">
<div class="form-group form-inline col-lg d-flex flex-row justify-content-center align-items-center"> <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=".quickfilterbody">Quickfilters</button>
<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=".filterbody">Filters</button>
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".actionbody">Actions</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> <label for="qsoResults" class="mr-2"># Results</label>

Wyświetl plik

@ -188,6 +188,7 @@ $(document).ready(function () {
state: this.state.value, state: this.state.value,
qsoresults: this.qsoResults.value, qsoresults: this.qsoResults.value,
sats: this.sats.value, sats: this.sats.value,
cqzone: this.cqzone.value,
lotwSent: this.lotwSent.value, lotwSent: this.lotwSent.value,
lotwReceived: this.lotwReceived.value, lotwReceived: this.lotwReceived.value,
eqslSent: this.eqslSent.value, eqslSent: this.eqslSent.value,
@ -359,6 +360,68 @@ $(document).ready(function () {
handleQslReceived('Y','D', 'receivedDirect'); handleQslReceived('Y','D', 'receivedDirect');
}); });
$('#searchGridsquare').click(function (event) {
quickSearch('gridsquare');
});
$('#searchState').click(function (event) {
quickSearch('state');
});
$('#searchIota').click(function (event) {
quickSearch('iota');
});
$('#searchDxcc').click(function (event) {
quickSearch('dxcc');
});
$('#searchCallsign').click(function (event) {
quickSearch('dx');
});
$('#searchCqZone').click(function (event) {
quickSearch('cqzone');
});
$('#searchMode').click(function (event) {
quickSearch('mode');
});
$('#searchBand').click(function (event) {
quickSearch('band');
});
function quickSearch(type) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
if (nElements > 1) {
alert("Only 1 row can be selected");
//popup message that only 1 row can be selected
}
elements.each(function() {
var currentRow = $(this).first().closest('tr');
var col1 = '';
switch (type) {
case 'dxcc': col1 = currentRow.find("td:eq(16)").html(); col1 = col1.match(/\d/g); col1 = col1.join("");break;
case 'dx': col1 = currentRow.find("td:eq(3)").text(); col1 = col1.match(/^([^\s]+)/gm); break;
case 'iota': col1 = currentRow.find("td:eq(19)").text(); col1 = col1.trim(); break;
case 'state': col1 = currentRow.find("td:eq(17)").text(); break;
case 'cqzone': col1 = currentRow.find("td:eq(18)").text(); break;
case 'gridsquare': col1 = $(currentRow).find('#dxgrid').text(); col1 = col1.substring(0, 4); 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;
}
if (col1.length == 0) return;
$('#searchForm').trigger("reset");
$("#"+type).val(col1);
$('#searchForm').submit();
});
}
$('#printLabel').click(function (event) { $('#printLabel').click(function (event) {
var elements = $('#qsoList tbody input:checked'); var elements = $('#qsoList tbody input:checked');
var nElements = elements.length; var nElements = elements.length;

Wyświetl plik

@ -841,9 +841,9 @@ class QSO
{ {
$refs = []; $refs = [];
if ($this->dxVUCCGridsquares !== '') { if ($this->dxVUCCGridsquares !== '') {
$refs[] = $this->dxVUCCGridsquares . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare); $refs[] = '<span id="dxgrid">' . $this->dxVUCCGridsquares . '</span> ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
} else if ($this->dxGridsquare !== '') { } else if ($this->dxGridsquare !== '') {
$refs[] = $this->dxGridsquare . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare); $refs[] = '<span id="dxgrid">' . $this->dxGridsquare . '</span> ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
} }
if ($this->dxSOTAReference !== '') { if ($this->dxSOTAReference !== '') {
$refs[] = "SOTA:" . $this->dxSOTAReference; $refs[] = "SOTA:" . $this->dxSOTAReference;