Add filter for SAT and Orbit to DXCC table

This commit is contained in:
phl0
2024-04-13 17:10:19 +02:00
parent d13cce4641
commit 60952337af
3 changed files with 14 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ class DXCC extends CI_Model {
if ($postdata['worked'] != NULL) {
$workedDXCC = $this->getDxccBandWorked($location_list, $band, $postdata);
foreach ($workedDXCC as $wdxcc) {
$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>';
$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>';
}
}
@@ -88,7 +88,7 @@ class DXCC extends CI_Model {
if ($postdata['confirmed'] != NULL) {
$confirmedDXCC = $this->getDxccBandConfirmed($location_list, $band, $postdata);
foreach ($confirmedDXCC as $cdxcc) {
$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>';
$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>';
}
}
}

View File

@@ -396,12 +396,20 @@ class Logbook_model extends CI_Model {
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer');
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
if ($band == 'SAT' && $type == 'VUCC') {
if ($band == 'SAT' && ($type == 'VUCC' || $type == 'DXCC')) {
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.col_sat_name', 'left outer');
}
switch ($type) {
case 'DXCC':
$this->db->where('COL_COUNTRY', $searchphrase);
if ($band == 'SAT' && $type == 'DXCC') {
if ($sat != 'All' && $sat != null) {
$this->db->where("COL_SAT_NAME = '$sat'");
}
if ($orbit != 'All' && $orbit != null) {
$this->db->where("satellite.orbit = '$orbit'");
}
}
break;
case 'DXCC2':
$this->db->where('COL_DXCC', $searchphrase);

View File

@@ -2239,13 +2239,15 @@ function viewEqsl(picture, callsign) {
/*
* Used to fetch QSOs from the logbook in the awards
*/
function displayContacts(searchphrase, band, mode, type, qsl) {
function displayContacts(searchphrase, band, sat, orbit, mode, type, qsl) {
$.ajax({
url: base_url + 'index.php/awards/qso_details_ajax',
type: 'post',
data: {
'Searchphrase': searchphrase,
'Band': band,
'Sat': sat,
'Orbit': orbit,
'Mode': mode,
'Type': type,
'QSL' : qsl