Merge pull request #2546 from AndreasK79/lba_distance_filter

This commit is contained in:
Andreas Kristiansen
2025-11-23 18:42:51 +01:00
committed by GitHub
6 changed files with 34 additions and 4 deletions

View File

@@ -153,7 +153,8 @@ class Logbookadvanced extends CI_Controller {
'qsoids' => xss_clean($this->input->post('qsoids')),
'dok' => xss_clean($this->input->post('dok')),
'qrzSent' => xss_clean($this->input->post('qrzSent')),
'qrzReceived' => xss_clean($this->input->post('qrzReceived'))
'qrzReceived' => xss_clean($this->input->post('qrzReceived')),
'distance' => xss_clean($this->input->post('distance')),
);
}
@@ -378,6 +379,9 @@ class Logbookadvanced extends CI_Controller {
'dok' => '*',
'qrzSent' => '',
'qrzReceived' => '',
'distance' => '*',
'qrzSent' => '',
'qrzReceived' => '',
'ids' => json_decode(xss_clean($this->input->post('ids'))),
'qsoids' => xss_clean($this->input->post('qsoids'))
);

View File

@@ -409,6 +409,20 @@ class Logbookadvanced_model extends CI_Model {
$conditions[] = "(coalesce(COL_GRIDSQUARE, '') = '' and coalesce(COL_VUCC_GRIDS, '') = '')";
}
if ($searchCriteria['distance'] !== '*' && $searchCriteria['distance'] !== '') {
if (strtolower($searchCriteria['distance']) == '!empty') {
$conditions[] = "COL_DISTANCE <> ''";
} else {
$conditions[] = "COL_DISTANCE >= ?";
$binding[] = $searchCriteria['distance'];
}
}
if ($searchCriteria['distance'] == '') {
$conditions[] = "coalesce(COL_DISTANCE, '') = ''";
}
if (($searchCriteria['propmode'] ?? '') == 'None') {
$conditions[] = "(trim(COL_PROP_MODE) = '' OR COL_PROP_MODE is null)";
} elseif ($searchCriteria['propmode'] !== '') {

View File

@@ -256,7 +256,7 @@ $options = json_decode($options);
<i class="fas fa-filter"></i> <?= __("Filters"); ?>
</button>
<div class="dropdown-menu dropdown-menu-start p-3 mt-2" aria-labelledby="filterDropdown" style="min-width: 900px; max-height: 600px; overflow-y: auto;">
<div class="card-body filterbody">
<div class="card-body filterbody container-fluid">
<div class="row">
<div <?php if (($options->datetime->show ?? "true") == "false") { echo 'style="display:none"'; } ?> class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="dateFrom"><?= __("From") . ": " ?></label>
@@ -449,11 +449,15 @@ $options = json_decode($options);
<option value="invalid"><?= __("Invalid"); ?></option>
</select>
</div>
</div>
</div>
<div class="row">
<div <?php if (($options->comment->show ?? "true") == "false") { echo 'style="display:none"'; } ?> class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="comment"><?= __("Comment"); ?></label>
<input onclick="this.select()" type="text" name="comment" id="comment" class="form-control form-control-sm border border-secondary" value="*" placeholder="<?= __("Empty"); ?>">
</div>
<div <?php if (($options->distance->show ?? "true") == "false") { echo 'style="display:none"'; } ?> class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="distanceinput"><?= __("Distance"); ?> <i class="fa fa-question-circle" aria-hidden="true" data-bs-toggle="tooltip" title="<?= __("Distance in kilometers. Search will look for distances greater than or equal to this value."); ?>"></i></label>
<input onclick="this.select()" type="text" name="distanceinput" id="distanceinput" class="form-control form-control-sm border border-secondary" value="*" placeholder="<?= __("Empty"); ?>">
</div>
</div>
</div>

View File

@@ -1402,3 +1402,9 @@ svg text.month { fill: #AAA; }
.legendClose {
float: right;
}
/* Ensure tooltip appears above everything */
.tooltip {
z-index: 9999 !important;
}

View File

@@ -657,6 +657,7 @@ $(document).ready(function () {
dok: this.dok.value,
qrzSent: this.qrzSent.value,
qrzReceived: this.qrzReceived.value,
distance: this.distanceinput.value,
},
dataType: 'json',
success: function (data) {

View File

@@ -548,7 +548,8 @@ function getFormData(form) {
comment: form.comment.value,
dok: form.dok.value,
qrzSent: form.qrzSent.value,
qrzReceived: form.qrzReceived.value
qrzReceived: form.qrzReceived.value,
distance: form.distanceinput.value,
};
}