mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Taking a break (at IOTA)
This commit is contained in:
@@ -784,7 +784,7 @@ class Awards extends CI_Controller {
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function iota () {
|
||||
public function iota () {
|
||||
$this->load->model('iota');
|
||||
$this->load->model('modes');
|
||||
$this->load->model('bands');
|
||||
@@ -805,6 +805,11 @@ class Awards extends CI_Controller {
|
||||
$data['modes'] = $this->modes->active(); // Used in the view for mode select
|
||||
|
||||
if($this->input->method() === 'post') {
|
||||
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
|
||||
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
|
||||
$postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1;
|
||||
$postdata['qrz'] = $this->input->post('qrz') == 0 ? NULL: 1;
|
||||
$postdata['clublog'] = $this->input->post('clublog') == 0 ? NULL: 1;
|
||||
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked')) ?? NULL;
|
||||
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed')) ?? NULL;
|
||||
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked')) ?? NULL;
|
||||
@@ -819,6 +824,11 @@ class Awards extends CI_Controller {
|
||||
$postdata['band'] = $this->security->xss_clean($this->input->post('band')) ?? NULL;
|
||||
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode')) ?? NULL;
|
||||
} else { // Setting default values at first load of page
|
||||
$postdata['qsl'] = 1;
|
||||
$postdata['lotw'] = 1;
|
||||
$postdata['eqsl'] = 0;
|
||||
$postdata['qrz'] = 0;
|
||||
$postdata['clublog'] = 0;
|
||||
$postdata['worked'] = 1;
|
||||
$postdata['confirmed'] = 1;
|
||||
$postdata['notworked'] = 1;
|
||||
|
||||
@@ -5,360 +5,323 @@ class IOTA extends CI_Model {
|
||||
$this->load->library('Genfunctions');
|
||||
}
|
||||
|
||||
function get_iota_array($iotaArray, $bands, $postdata) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function get_iota_array($iotaArray, $bands, $postdata) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
foreach ($bands as $band) { // Looping through bands and iota to generate the array needed for display
|
||||
foreach ($iotaArray as $iota) {
|
||||
$iotaMatrix[$iota->tag]['prefix'] = $iota->prefix;
|
||||
$iotaMatrix[$iota->tag]['name'] = $iota->name;
|
||||
if ($postdata['includedeleted'])
|
||||
$iotaMatrix[$iota->tag]['Deleted'] = isset($iota->status) && $iota->status == 'D' ? "<div class='alert-danger'>Y</div>" : '';
|
||||
$iotaMatrix[$iota->tag][$band] = '-';
|
||||
}
|
||||
|
||||
foreach ($bands as $band) { // Looping through bands and iota to generate the array needed for display
|
||||
foreach ($iotaArray as $iota) {
|
||||
$iotaMatrix[$iota->tag]['prefix'] = $iota->prefix;
|
||||
$iotaMatrix[$iota->tag]['name'] = $iota->name;
|
||||
if ($postdata['includedeleted'])
|
||||
$iotaMatrix[$iota->tag]['Deleted'] = isset($iota->status) && $iota->status == 'D' ? "<div class='alert-danger'>Y</div>" : '';
|
||||
$iotaMatrix[$iota->tag][$band] = '-';
|
||||
}
|
||||
// If worked is checked, we add worked iotas to the array
|
||||
if ($postdata['worked'] != NULL) {
|
||||
$workedIota = $this->getIotaBandWorked($location_list, $band, $postdata);
|
||||
foreach ($workedIota as $wiota) {
|
||||
$iotaMatrix[$wiota->tag][$band] = '<div class="bg-danger awardsBgDanger"><a href=\'javascript:displayContacts("'.$wiota->tag.'","'. $band . '","All","All","'. $postdata['mode'] . '","IOTA")\'>W</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// If worked is checked, we add worked iotas to the array
|
||||
if ($postdata['worked'] != NULL) {
|
||||
$workedIota = $this->getIotaBandWorked($location_list, $band, $postdata);
|
||||
foreach ($workedIota as $wiota) {
|
||||
$iotaMatrix[$wiota->tag][$band] = '<div class="bg-danger awardsBgDanger"><a href=\'javascript:displayContacts("'.$wiota->tag.'","'. $band . '","All","All","'. $postdata['mode'] . '","IOTA")\'>W</a></div>';
|
||||
}
|
||||
}
|
||||
// If confirmed is checked, we add confirmed iotas to the array
|
||||
if ($postdata['confirmed'] != NULL) {
|
||||
$confirmedIota = $this->getIotaBandConfirmed($location_list, $band, $postdata);
|
||||
foreach ($confirmedIota as $ciota) {
|
||||
$iotaMatrix[$ciota->tag][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.$ciota->tag.'","'. $band . '","All","All","'. $postdata['mode'] . '","IOTA")\'>C</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If confirmed is checked, we add confirmed iotas to the array
|
||||
if ($postdata['confirmed'] != NULL) {
|
||||
$confirmedIota = $this->getIotaBandConfirmed($location_list, $band, $postdata);
|
||||
foreach ($confirmedIota as $ciota) {
|
||||
$iotaMatrix[$ciota->tag][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.$ciota->tag.'","'. $band . '","All","All","'. $postdata['mode'] . '","IOTA")\'>C</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// We want to remove the worked iotas in the list, since we do not want to display them
|
||||
if ($postdata['worked'] == NULL) {
|
||||
$workedIota = $this->getIotaWorked($location_list, $postdata);
|
||||
foreach ($workedIota as $wiota) {
|
||||
if (array_key_exists($wiota->tag, $iotaMatrix)) {
|
||||
unset($iotaMatrix[$wiota->tag]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We want to remove the worked iotas in the list, since we do not want to display them
|
||||
if ($postdata['worked'] == NULL) {
|
||||
$workedIota = $this->getIotaWorked($location_list, $postdata);
|
||||
foreach ($workedIota as $wiota) {
|
||||
if (array_key_exists($wiota->tag, $iotaMatrix)) {
|
||||
unset($iotaMatrix[$wiota->tag]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// We want to remove the confirmed iotas in the list, since we do not want to display them
|
||||
if ($postdata['confirmed'] == NULL) {
|
||||
$confirmedIOTA = $this->getIotaConfirmed($location_list, $postdata);
|
||||
foreach ($confirmedIOTA as $ciota) {
|
||||
if (array_key_exists($ciota->tag, $iotaMatrix)) {
|
||||
unset($iotaMatrix[$ciota->tag]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We want to remove the confirmed iotas in the list, since we do not want to display them
|
||||
if ($postdata['confirmed'] == NULL) {
|
||||
$confirmedIOTA = $this->getIotaConfirmed($location_list, $postdata);
|
||||
foreach ($confirmedIOTA as $ciota) {
|
||||
if (array_key_exists($ciota->tag, $iotaMatrix)) {
|
||||
unset($iotaMatrix[$ciota->tag]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($iotaMatrix)) {
|
||||
return $iotaMatrix;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($iotaMatrix)) {
|
||||
return $iotaMatrix;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getIotaBandConfirmed($location_list, $band, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list .
|
||||
") and thcv.col_iota is not null
|
||||
and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')";
|
||||
function getIotaBandConfirmed($location_list, $band, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list . ") and thcv.col_iota is not null";
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
$sql .= $this->genfunctions->addBandToQuery($band);
|
||||
$sql .= $this->genfunctions->addBandToQuery($band);
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->genfunctions->addQslToQuery($postdata);
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getIotaBandWorked($location_list, $band, $postdata) {
|
||||
$sql = 'SELECT distinct UPPER(col_iota) as tag FROM ' . $this->config->item('table_name'). ' thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (' . $location_list .
|
||||
') and thcv.col_iota is not null';
|
||||
function getIotaBandWorked($location_list, $band, $postdata) {
|
||||
$sql = 'SELECT distinct UPPER(col_iota) as tag FROM ' . $this->config->item('table_name'). ' thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (' . $location_list .
|
||||
') and thcv.col_iota is not null';
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
$sql .= $this->genfunctions->addBandToQuery($band);
|
||||
$sql .= $this->genfunctions->addBandToQuery($band);
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function fetchIota($postdata) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function fetchIota($postdata) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = "select tag, name, prefix, dxccid, status, lat1, lat2, lon1, lon2 from iota where 1=1";
|
||||
$sql = "select tag, name, prefix, dxccid, status, lat1, lat2, lon1, lon2 from iota where 1=1";
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
if ($postdata['notworked'] == NULL) {
|
||||
$sql .= " and exists (select 1 from " . $this->config->item('table_name') . " where station_id in (". $location_list . ") and col_iota = iota.tag";
|
||||
if ($postdata['notworked'] == NULL) {
|
||||
$sql .= " and exists (select 1 from " . $this->config->item('table_name') . " where station_id in (". $location_list . ") and col_iota = iota.tag";
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
if ($postdata['band'] != 'All') {
|
||||
if ($postdata['band'] == 'SAT') {
|
||||
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
|
||||
}
|
||||
else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and col_band ='" . $postdata['band'] . "'";
|
||||
}
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
if ($postdata['band'] != 'All') {
|
||||
if ($postdata['band'] == 'SAT') {
|
||||
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and col_band ='" . $postdata['band'] . "'";
|
||||
}
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
|
||||
$sql .= ' order by tag';
|
||||
$query = $this->db->query($sql);
|
||||
$sql .= ' order by tag';
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getIotaWorked($location_list, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list .
|
||||
") and thcv.col_iota is not null
|
||||
and not exists (select 1 from ". $this->config->item('table_name') . " where station_id = ". $location_list .
|
||||
" and col_iota = thcv.col_iota";
|
||||
function getIotaWorked($location_list, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list . ") and thcv.col_iota is not null
|
||||
and not exists (select 1 from ". $this->config->item('table_name') . " where station_id = ". $location_list . " and col_iota = thcv.col_iota)";
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
$sql .= $this->genfunctions->addBandToQuery($postdata['band']);
|
||||
$sql .= $this->genfunctions->addBandToQuery($postdata['band']);
|
||||
|
||||
$sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y'))";
|
||||
|
||||
$sql .= $this->genfunctions->addBandToQuery($postdata['band']);
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getIotaConfirmed($location_list, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list .
|
||||
") and thcv.col_iota is not null
|
||||
and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')";
|
||||
function getIotaConfirmed($location_list, $postdata) {
|
||||
$sql = "SELECT distinct UPPER(col_iota) as tag FROM " . $this->config->item('table_name') . " thcv
|
||||
join iota on thcv.col_iota = iota.tag
|
||||
where station_id in (" . $location_list . ") and thcv.col_iota is not null";
|
||||
$sql .= $this->genfunctions->addQslToQuery($postdata);
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$sql .= $this->genfunctions->addBandToQuery($postdata['band']);
|
||||
$sql .= $this->genfunctions->addBandToQuery($postdata['band']);
|
||||
$sql .= $this->genfunctions->addQslToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
// Made function instead of repeating this several times
|
||||
function addContinentsToQuery($postdata) {
|
||||
$sql = '';
|
||||
if ($postdata['Africa'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AF'";
|
||||
}
|
||||
// Made function instead of repeating this several times
|
||||
function addContinentsToQuery($postdata) {
|
||||
$sql = '';
|
||||
if ($postdata['Africa'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AF'";
|
||||
}
|
||||
|
||||
if ($postdata['Europe'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'EU'";
|
||||
}
|
||||
if ($postdata['Europe'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'EU'";
|
||||
}
|
||||
|
||||
if ($postdata['Asia'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AS'";
|
||||
}
|
||||
if ($postdata['Asia'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AS'";
|
||||
}
|
||||
|
||||
if ($postdata['SouthAmerica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'SA'";
|
||||
}
|
||||
if ($postdata['SouthAmerica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'SA'";
|
||||
}
|
||||
|
||||
if ($postdata['NorthAmerica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'NA'";
|
||||
}
|
||||
if ($postdata['NorthAmerica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'NA'";
|
||||
}
|
||||
|
||||
if ($postdata['Oceania'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'OC'";
|
||||
}
|
||||
if ($postdata['Oceania'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'OC'";
|
||||
}
|
||||
|
||||
if ($postdata['Antarctica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AN'";
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
if ($postdata['Antarctica'] == NULL) {
|
||||
$sql .= " and left(tag, 2) <> 'AN'";
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function gets worked and confirmed summary on each band on the active stationprofile
|
||||
*/
|
||||
function get_iota_summary($bands, $postdata)
|
||||
{
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
/*
|
||||
* Function gets worked and confirmed summary on each band on the active stationprofile
|
||||
*/
|
||||
function get_iota_summary($bands, $postdata) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
foreach ($bands as $band) {
|
||||
$worked = $this->getSummaryByBand($band, $postdata, $location_list);
|
||||
$confirmed = $this->getSummaryByBandConfirmed($band, $postdata, $location_list);
|
||||
$iotaSummary['worked'][$band] = $worked[0]->count;
|
||||
$iotaSummary['confirmed'][$band] = $confirmed[0]->count;
|
||||
}
|
||||
foreach ($bands as $band) {
|
||||
$worked = $this->getSummaryByBand($band, $postdata, $location_list);
|
||||
$confirmed = $this->getSummaryByBandConfirmed($band, $postdata, $location_list);
|
||||
$iotaSummary['worked'][$band] = $worked[0]->count;
|
||||
$iotaSummary['confirmed'][$band] = $confirmed[0]->count;
|
||||
}
|
||||
|
||||
$workedTotal = $this->getSummaryByBand($postdata['band'], $postdata, $location_list);
|
||||
$confirmedTotal = $this->getSummaryByBandConfirmed($postdata['band'], $postdata, $location_list);
|
||||
$workedTotal = $this->getSummaryByBand($postdata['band'], $postdata, $location_list);
|
||||
$confirmedTotal = $this->getSummaryByBandConfirmed($postdata['band'], $postdata, $location_list);
|
||||
|
||||
$iotaSummary['worked']['Total'] = $workedTotal[0]->count;
|
||||
$iotaSummary['confirmed']['Total'] = $confirmedTotal[0]->count;
|
||||
$iotaSummary['worked']['Total'] = $workedTotal[0]->count;
|
||||
$iotaSummary['confirmed']['Total'] = $confirmedTotal[0]->count;
|
||||
|
||||
return $iotaSummary;
|
||||
}
|
||||
|
||||
function getSummaryByBand($band, $postdata, $location_list)
|
||||
{
|
||||
$sql = "SELECT count(distinct UPPER(thcv.col_iota)) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= ' join iota on thcv.col_iota = iota.tag';
|
||||
|
||||
$sql .= " where station_id in (" . $location_list . ")";
|
||||
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||
} else if ($band == 'All') {
|
||||
$this->load->model('bands');
|
||||
return $iotaSummary;
|
||||
}
|
||||
|
||||
function getSummaryByBand($band, $postdata, $location_list) {
|
||||
$sql = "SELECT count(distinct UPPER(thcv.col_iota)) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= ' join iota on thcv.col_iota = iota.tag';
|
||||
$sql .= " where station_id in (" . $location_list . ")";
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||
} else if ($band == 'All') {
|
||||
$this->load->model('bands');
|
||||
$bandslots = $this->bands->get_worked_bands('iota');
|
||||
|
||||
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
}
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getSummaryByBandConfirmed($band, $postdata, $location_list)
|
||||
{
|
||||
$sql = "SELECT count(distinct thcv.col_iota) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= ' join iota on thcv.col_iota = iota.tag';
|
||||
|
||||
$sql .= " where station_id in (" . $location_list . ")";
|
||||
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||
} else if ($band == 'All') {
|
||||
$this->load->model('bands');
|
||||
|
||||
function getSummaryByBandConfirmed($band, $postdata, $location_list) {
|
||||
$sql = "SELECT count(distinct thcv.col_iota) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= ' join iota on thcv.col_iota = iota.tag';
|
||||
$sql .= " where station_id in (" . $location_list . ")";
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||
} else if ($band == 'All') {
|
||||
$this->load->model('bands');
|
||||
$bandslots = $this->bands->get_worked_bands('iota');
|
||||
|
||||
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
}
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
}
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and coalesce(iota.status, '') <> 'D'";
|
||||
}
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
$sql .= $this->genfunctions->addQslToQuery($postdata);
|
||||
log_message("Error",$sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -53,6 +53,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 row">
|
||||
<div class="col-md-2"><?php echo lang('awards_qsl_type'); ?></div>
|
||||
<div class="col-md-10">
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="qsl" value="1" id="qsl" <?php if ($this->input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||
<label class="form-check-label" for="qsl">QSL</label>
|
||||
</div>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="lotw" value="1" id="lotw" <?php if ($this->input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||
<label class="form-check-label" for="lotw">LoTW</label>
|
||||
</div>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="eqsl" value="1" id="eqsl" <?php if ($this->input->post('eqsl')) echo ' checked="checked"'; ?> >
|
||||
<label class="form-check-label" for="eqsl">eQSL</label>
|
||||
</div>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="qrz" value="1" id="qrz" <?php if ($this->input->post('qrz')) echo ' checked="checked"'; ?> >
|
||||
<label class="form-check-label" for="qrz">QRZ.com</label>
|
||||
</div>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="clublog" value="1" id="clublog" <?php if ($this->input->post('clublog')) echo ' checked="checked"'; ?> >
|
||||
<label class="form-check-label" for="clublog">Clublog</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-3 row">
|
||||
<div class="col-md-2">Continents</div>
|
||||
<div class="col-md-10">
|
||||
|
||||
Reference in New Issue
Block a user