mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #2546 from AndreasK79/lba_distance_filter
This commit is contained in:
@@ -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'))
|
||||
);
|
||||
|
||||
@@ -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'] !== '') {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1402,3 +1402,9 @@ svg text.month { fill: #AAA; }
|
||||
.legendClose {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
/* Ensure tooltip appears above everything */
|
||||
.tooltip {
|
||||
z-index: 9999 !important;
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user