Skip to content

Commit 6095233

Browse files
committed
Add filter for SAT and Orbit to DXCC table
1 parent d13cce4 commit 6095233

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

application/models/Dxcc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ function get_dxcc_array($dxccArray, $bands, $postdata) {
8080
if ($postdata['worked'] != NULL) {
8181
$workedDXCC = $this->getDxccBandWorked($location_list, $band, $postdata);
8282
foreach ($workedDXCC as $wdxcc) {
83-
$dxccMatrix[$wdxcc->dxcc][$band] = '<div class="bg-danger awardsBgDanger" ><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wdxcc->name).'","'. $band . '","'. $postdata['mode'] . '","DXCC", "")\'>W</a></div>';
83+
$dxccMatrix[$wdxcc->dxcc][$band] = '<div class="bg-danger awardsBgDanger" ><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wdxcc->name).'","'. $band . '","'. $postdata['sat'] . '","' . $postdata['orbit'] . '","'. $postdata['mode'] . '","DXCC", "")\'>W</a></div>';
8484
}
8585
}
8686

8787
// If confirmed is checked, we add confirmed entities to the array
8888
if ($postdata['confirmed'] != NULL) {
8989
$confirmedDXCC = $this->getDxccBandConfirmed($location_list, $band, $postdata);
9090
foreach ($confirmedDXCC as $cdxcc) {
91-
$dxccMatrix[$cdxcc->dxcc][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cdxcc->name).'","'. $band . '","'. $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C</a></div>';
91+
$dxccMatrix[$cdxcc->dxcc][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cdxcc->name).'","'. $band . '","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","' . $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C</a></div>';
9292
}
9393
}
9494
}

application/models/Logbook_model.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,20 @@ 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') {
399+
if ($band == 'SAT' && ($type == 'VUCC' || $type == 'DXCC')) {
400400
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.col_sat_name', 'left outer');
401401
}
402402
switch ($type) {
403403
case 'DXCC':
404404
$this->db->where('COL_COUNTRY', $searchphrase);
405+
if ($band == 'SAT' && $type == 'DXCC') {
406+
if ($sat != 'All' && $sat != null) {
407+
$this->db->where("COL_SAT_NAME = '$sat'");
408+
}
409+
if ($orbit != 'All' && $orbit != null) {
410+
$this->db->where("satellite.orbit = '$orbit'");
411+
}
412+
}
405413
break;
406414
case 'DXCC2':
407415
$this->db->where('COL_DXCC', $searchphrase);

application/views/interface_assets/footer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,13 +2239,15 @@ function viewEqsl(picture, callsign) {
22392239
/*
22402240
* Used to fetch QSOs from the logbook in the awards
22412241
*/
2242-
function displayContacts(searchphrase, band, mode, type, qsl) {
2242+
function displayContacts(searchphrase, band, sat, orbit, mode, type, qsl) {
22432243
$.ajax({
22442244
url: base_url + 'index.php/awards/qso_details_ajax',
22452245
type: 'post',
22462246
data: {
22472247
'Searchphrase': searchphrase,
22482248
'Band': band,
2249+
'Sat': sat,
2250+
'Orbit': orbit,
22492251
'Mode': mode,
22502252
'Type': type,
22512253
'QSL' : qsl

0 commit comments

Comments
 (0)