diff --git a/application/controllers/Dxcluster.php b/application/controllers/Dxcluster.php index 4414873f5..8b9771bac 100644 --- a/application/controllers/Dxcluster.php +++ b/application/controllers/Dxcluster.php @@ -11,15 +11,16 @@ class Dxcluster extends CI_Controller { } - function spots($band,$age = '', $de = '') { + function spots($band, $age = '', $de = '', $mode = 'All') { if ($age == '') { $age = $this->optionslib->get_option('dxcluster_maxage') ?? 60; } if ($de == '') { $de = $this->optionslib->get_option('dxcluster_decont') ?? 'EU'; } - $calls_found=$this->dxcluster_model->dxc_spotlist($band, $age, $de); - header('Content-Type: application/json'); + $calls_found = $this->dxcluster_model->dxc_spotlist($band, $age, $de, $mode); + + header('Content-Type: application/json'); if ($calls_found) { echo json_encode($calls_found, JSON_PRETTY_PRINT); } else { diff --git a/application/models/Dxcluster_model.php b/application/models/Dxcluster_model.php index f4459c1de..de609c0d9 100644 --- a/application/models/Dxcluster_model.php +++ b/application/models/Dxcluster_model.php @@ -3,7 +3,7 @@ use Wavelog\Dxcc\Dxcc; class Dxcluster_model extends CI_Model { - public function dxc_spotlist($band = '20m', $maxage = 60, $de = '') { + public function dxc_spotlist($band = '20m', $maxage = 60, $de = '', $mode = 'All') { $this->load->helper(array('psr4_autoloader')); if($this->session->userdata('user_date_format')) { @@ -52,6 +52,7 @@ class Dxcluster_model extends CI_Model { } $singlespot->band=$spotband; if (($band != 'All') && ($band != $spotband)) { continue; } + if (($mode != 'All') && ($mode != $this->modefilter($singlespot, $mode))) { continue; } $datetimecurrent = new DateTime("now", new DateTimeZone('UTC')); // Today's Date/Time $datetimespot = new DateTime($singlespot->when, new DateTimeZone('UTC')); $spotage = $datetimecurrent->diff($datetimespot); @@ -113,6 +114,15 @@ class Dxcluster_model extends CI_Model { } + function modefilter($spot, $mode) { + if ($mode == 'cw') { + if (isset($spot->message) && stripos($spot->message, 'cw') !== false) { + return true; + } + } + return false; + } + public function dxc_qrg_lookup($qrg, $maxage = 120) { $this->load->helper(array('psr4_autoloader')); if (is_numeric($qrg)) { diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php index 788917194..d7507dd6b 100644 --- a/application/views/bandmap/list.php +++ b/application/views/bandmap/list.php @@ -106,30 +106,38 @@ } ?> + +

+

+ + + + + + + + + + + + + -
/
- - - - - - - - - - - - - - - -
/
+ + + +
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js index 6e8c2a39f..ec2bc9508 100644 --- a/assets/js/sections/bandmap_list.js +++ b/assets/js/sections/bandmap_list.js @@ -36,11 +36,11 @@ $(function() { return table; } - function fill_list(band,de,maxAgeMinutes,cwn) { + function fill_list(band, de, maxAgeMinutes, cwn, mode) { // var table = $('.spottable').DataTable(); var table = get_dtable(); if ((band != '') && (band !== undefined)) { - let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de; + let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de + "/" + mode; $.ajax({ url: dxurl, cache: false, @@ -172,22 +172,27 @@ $(function() { var table=get_dtable(); table.order([1, 'asc']); table.clear(); - fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage,$('#cwnSelect option:selected').val()); - setInterval(function () { fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage,$('#cwnSelect option:selected').val()); },60000); + fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); + setInterval(function () { fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); },60000); $("#cwnSelect").on("change",function() { table.clear(); - fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage,$('#cwnSelect option:selected').val()); + fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); }); $("#decontSelect").on("change",function() { table.clear(); - fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage,$('#cwnSelect option:selected').val()); + fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); }); $("#band").on("change",function() { table.clear(); - fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage,$('#cwnSelect option:selected').val()); + fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); + }); + + $("#mode").on("change",function() { + table.clear(); + fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage, $('#cwnSelect option:selected').val(), $('#mode option:selected').val()); }); $("#spottertoggle").on("click", function() {