[Awards WAS] Added mode filtering.

This commit is contained in:
Andreas
2021-07-27 12:11:41 +02:00
parent da0b5f5b3a
commit 88c4a10d35
5 changed files with 55 additions and 20 deletions

View File

@@ -87,14 +87,14 @@ class was extends CI_Model {
if ($postdata['worked'] != NULL) {
$wasBand = $this->getWasWorked($station_id, $band, $postdata);
foreach ($wasBand as $line) {
$bandWas[$line->col_state][$band] = '<div class="alert-danger"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","All","WAS")\'>W</a></div>';
$bandWas[$line->col_state][$band] = '<div class="alert-danger"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","'. $postdata['mode'] . '","WAS")\'>W</a></div>';
$states[$line->col_state]['count']++;
}
}
if ($postdata['confirmed'] != NULL) {
$wasBand = $this->getWasConfirmed($station_id, $band, $postdata);
foreach ($wasBand as $line) {
$bandWas[$line->col_state][$band] = '<div class="alert-success"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","All","WAS")\'>C</a></div>';
$bandWas[$line->col_state][$band] = '<div class="alert-success"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","'. $postdata['mode'] . '","WAS")\'>C</a></div>';
$states[$line->col_state]['count']++;
}
}
@@ -211,6 +211,10 @@ class was extends CI_Model {
$sql = "SELECT distinct col_state FROM " . $this->config->item('table_name') . " thcv
where station_id = " . $station_id;
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
}
$sql .= $this->addStateToQuery();
$sql .= $this->addBandToQuery($band);
@@ -219,6 +223,10 @@ class was extends CI_Model {
" where station_id = ". $station_id .
" and col_state = thcv.col_state";
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
}
$sql .= $this->addBandToQuery($band);
$sql .= $this->addQslToQuery($postdata);
@@ -240,6 +248,10 @@ class was extends CI_Model {
$sql = "SELECT distinct col_state FROM " . $this->config->item('table_name') . " thcv
where station_id = " . $station_id;
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
}
$sql .= $this->addStateToQuery();
$sql .= $this->addBandToQuery($band);