Added de-spot options as selector

pull/2317/head
int2001 2023-07-23 09:29:04 +00:00
rodzic 32073482b6
commit ba9d5be562
3 zmienionych plików z 24 dodań i 7 usunięć

Wyświetl plik

@ -56,8 +56,8 @@ class Dxcluster_model extends CI_Model {
$dxcc=$dxccObj->dxcc_lookup($singlespot->spotter,date('Ymd', time()));
$singlespot->dxcc_spotter=$dxcc;
}
if ( ($de != '') && (property_exists($singlespot->dxcc_spotter,'cont')) ){ // If we have a "de continent" and a filter-wish filter on that
if ($de == $singlespot->dxcc_spotter->cont) {
if ( ($de != '') && ($de != 'Any') && (property_exists($singlespot->dxcc_spotter,'cont')) ){ // If we have a "de continent" and a filter-wish filter on that
if (strtolower($de) == strtolower($singlespot->dxcc_spotter->cont)) {
$singlespot->worked_call = ($this->logbook_model->check_if_callsign_worked_in_logbook($singlespot->spotted, $logbooks_locations_array, $singlespot->band) == 1);
array_push($spotsout,$singlespot);
}

Wyświetl plik

@ -27,6 +27,17 @@
<option value="<?php echo $row->id; ?>" <?php if($this->session->userdata('radio') == $row->id) { echo "selected=\"selected\""; } ?>><?php echo $row->radio; ?></option>
<?php } ?>
</select>
<label class="my-1 mr-2" for="decontSelect">Spots de</label>
<select class="form-control-sm my-1 mr-sm-2" id="decontSelect" name="dxcluster_decont" aria-describedby="dxcluster_decontHelp" required>
<option value="Any">*</option>
<option value="AF"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'AF') { echo " selected"; } ?>>Africa</option>
<option value="AN"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'AN') { echo " selected"; } ?>>Antarctica</option>
<option value="AS"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'AS') { echo " selected"; } ?>>Asia</option>
<option value="EU"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'EU') { echo " selected"; } ?>>Europe</option>
<option value="NA"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'NA') { echo " selected"; } ?>>North America</option>
<option value="OC"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'OC') { echo " selected"; } ?>>Oceania</option>
<option value="SA"<?php if ($this->optionslib->get_option('dxcluster_decont') == 'SA') { echo " selected"; } ?>>South America</option>
</select>
<label class="my-1 mr-2" for="band"><?php echo lang('gen_hamradio_band'); ?></label>
<select id="band" class="form-control-sm my-1 mr-sm-2" name="band">

Wyświetl plik

@ -7,8 +7,8 @@ $(function() {
}
function fill_list(band,maxAgeMinutes) {
let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
function fill_list(band,de,maxAgeMinutes) {
let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de;
$.ajax({
url: dxurl,
cache: false,
@ -52,12 +52,18 @@ $(function() {
$('.spottable').DataTable().order([1, 'asc']);
$('.spottable').DataTable().clear();
fill_list($('#band option:selected').val(),30);
setInterval(function () { fill_list($('#band option:selected').val(),30); },60000);
fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
setInterval(function () { fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30); },60000);
$("#decontSelect").on("change",function() {
$('.spottable').DataTable().clear();
fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
});
$("#band").on("change",function() {
$('.spottable').DataTable().order([1, 'asc']);
$('.spottable').DataTable().clear();
fill_list($('#band option:selected').val(),30);
fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
});