mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
Added duration filter
This commit is contained in:
@@ -161,7 +161,8 @@ class Logbookadvanced extends CI_Controller {
|
||||
'qrzReceived' => xss_clean($this->input->post('qrzReceived')),
|
||||
'distance' => xss_clean($this->input->post('distance')),
|
||||
'sortcolumn' => xss_clean($this->input->post('sortcolumn')),
|
||||
'sortdirection' => xss_clean($this->input->post('sortdirection'))
|
||||
'sortdirection' => xss_clean($this->input->post('sortdirection')),
|
||||
'duration' => xss_clean($this->input->post('duration'))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -394,7 +395,8 @@ class Logbookadvanced extends CI_Controller {
|
||||
'ids' => json_decode(xss_clean($this->input->post('ids'))),
|
||||
'qsoids' => xss_clean($this->input->post('qsoids')),
|
||||
'sortcolumn' => 'qsotime',
|
||||
'sortdirection' => 'desc'
|
||||
'sortdirection' => 'desc',
|
||||
'duration' => '*'
|
||||
);
|
||||
|
||||
$result = $this->logbookadvanced_model->getSearchResultArray($searchCriteria);
|
||||
|
||||
@@ -534,6 +534,11 @@ class Logbookadvanced_model extends CI_Model {
|
||||
$conditions[] = "coalesce(COL_DISTANCE, '') = ''";
|
||||
}
|
||||
|
||||
if ($searchCriteria['duration'] !== '*' && $searchCriteria['duration'] !== '') {
|
||||
$conditions[] = "TIMESTAMPDIFF(MINUTE, COL_TIME_ON, COL_TIME_OFF) >= ?";
|
||||
$binding[] = $searchCriteria['duration'];
|
||||
}
|
||||
|
||||
if (($searchCriteria['propmode'] ?? '') == 'None') {
|
||||
$conditions[] = "(trim(COL_PROP_MODE) = '' OR COL_PROP_MODE is null)";
|
||||
} elseif ($searchCriteria['propmode'] !== '') {
|
||||
|
||||
@@ -511,6 +511,10 @@ $options = json_decode($options);
|
||||
<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="distance"><?= __("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="distance" class="form-control form-control-sm border border-secondary" value="*" placeholder="<?= __("Empty"); ?>">
|
||||
</div>
|
||||
<div <?php if (($options->duration->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="duration"><?= __("Duration"); ?> <i class="fa fa-question-circle" aria-hidden="true" data-bs-toggle="tooltip" title="<?= __("Duration in minutes. Search will look for durations greater than or equal to this value."); ?>"></i></label>
|
||||
<input onclick="this.select()" type="text" name="duration" class="form-control form-control-sm border border-secondary" value="*" placeholder="<?= __("Empty"); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -771,7 +771,8 @@ $(document).ready(function () {
|
||||
qrzReceived: this.qrzReceived.value,
|
||||
distance: this.distance.value,
|
||||
sortcolumn: this.sortcolumn.value,
|
||||
sortdirection: this.sortdirection.value
|
||||
sortdirection: this.sortdirection.value,
|
||||
duration: this.duration.value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
Reference in New Issue
Block a user