Skip to content

Commit daa2e6a

Browse files
committed
Appliy sat and orbit filter to DXCC map
1 parent 6095233 commit daa2e6a

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

application/controllers/Awards.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,8 @@ public function dxcc_map() {
14131413
$postdata['SouthAmerica'] = $this->input->post('SouthAmerica') == 0 ? NULL: 1;
14141414
$postdata['Oceania'] = $this->input->post('Oceania') == 0 ? NULL: 1;
14151415
$postdata['Antarctica'] = $this->input->post('Antarctica') == 0 ? NULL: 1;
1416-
$postdata['sat'] = $this->security->xss_clean($this->input->post('sat'));
1417-
$postdata['orbit'] = $this->security->xss_clean($this->input->post('orbit'));
1416+
$postdata['sat'] = $this->security->xss_clean($this->input->post('sat'));
1417+
$postdata['orbit'] = $this->security->xss_clean($this->input->post('orbit'));
14181418

14191419
$dxcclist = $this->dxcc->fetchdxcc($postdata);
14201420

application/models/Logbook_model.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = nul
396396
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
397397
$this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer');
398398
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
399-
if ($band == 'SAT' && ($type == 'VUCC' || $type == 'DXCC')) {
399+
if ($band == 'SAT' && ($type == 'VUCC' || $type == 'DXCC' || $type == 'DXCC2')) {
400400
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.col_sat_name', 'left outer');
401401
}
402402
switch ($type) {
@@ -413,6 +413,14 @@ public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = nul
413413
break;
414414
case 'DXCC2':
415415
$this->db->where('COL_DXCC', $searchphrase);
416+
if ($band == 'SAT' && $type == 'DXCC2') {
417+
if ($sat != 'All' && $sat != null) {
418+
$this->db->where("COL_SAT_NAME = '$sat'");
419+
}
420+
if ($orbit != 'All' && $orbit != null) {
421+
$this->db->where("satellite.orbit = '$orbit'");
422+
}
423+
}
416424
break;
417425
case 'IOTA':
418426
$this->db->where('COL_IOTA', $searchphrase);

application/views/interface_assets/footer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,13 +2292,15 @@ function displayContacts(searchphrase, band, sat, orbit, mode, type, qsl) {
22922292
});
22932293
}
22942294

2295-
function displayContactsOnMap(target, searchphrase, band, mode, type, qsl) {
2295+
function displayContactsOnMap(target, searchphrase, band, sat, orbit, mode, type, qsl) {
22962296
$.ajax({
22972297
url: base_url + 'index.php/awards/qso_details_ajax',
22982298
type: 'post',
22992299
data: {
23002300
'Searchphrase': searchphrase,
23012301
'Band': band,
2302+
'Sat': sat,
2303+
'Orbit': orbit,
23022304
'Mode': mode,
23032305
'Type': type,
23042306
'QSL' : qsl

assets/js/sections/dxccmap.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var osmUrl = $('#dxccmapjs').attr("tileUrl");
22

33
$('#band2').change(function(){
44
var band = $("#band2 option:selected").text();
5-
console.log("TEST: "+band)
65
if (band != "SAT") {
76
$("#sats").val('All');
87
$("#orbits").val('All');
@@ -37,7 +36,7 @@ function load_dxcc_map() {
3736
SouthAmerica: +$('#SouthAmerica').prop('checked'),
3837
Oceania: +$('#Oceania').prop('checked'),
3938
Antarctica: +$('#Antarctica').prop('checked'),
40-
sat: $("#sats").val(),
39+
sat: $("#sats").val(),
4140
orbit: $("#orbits").val(),
4241
},
4342
success: function(data) {
@@ -173,5 +172,5 @@ function addMarker(L, D, mapColor, map) {
173172

174173
function onClick(e) {
175174
var marker = e.target;
176-
displayContactsOnMap($("#dxccmap"),marker.options.adif, $('#band2').val(), $('#mode').val(), 'DXCC2');
175+
displayContactsOnMap($("#dxccmap"),marker.options.adif, $('#band2').val(), $('#sats').val(), $('#orbits').val(), $('#mode').val(), 'DXCC2');
177176
}

0 commit comments

Comments
 (0)