kopia lustrzana https://github.com/magicbug/Cloudlog
Revert "Merge pull request #577 from AndreasK79/award_was_summary"
This reverts commitpull/580/head^2488a4e1748
, reversing changes made toa81ab1001e
.
rodzic
fa19166da9
commit
c715231ef1
|
@ -346,7 +346,6 @@ class Awards extends CI_Controller {
|
|||
}
|
||||
|
||||
$data['was_array'] = $this->was->get_was_array($bands, $postdata);
|
||||
$data['was_summary'] = $this->was->get_was_summary();
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = "Awards - WAS (Worked all states)";
|
||||
|
|
|
@ -132,39 +132,6 @@ class was extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function gets worked and confirmed summary on each band on the active stationprofile
|
||||
*/
|
||||
function get_was_summary() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
$stateArray = explode(',', $this->stateString);
|
||||
|
||||
$states = array(); // Used for keeping track of which states that are not worked
|
||||
|
||||
$sql = "SELECT thcv.col_band, count(distinct thcv.col_state) as count, coalesce (cfmwas.count, 0) as cfmwas FROM " . $this->config->item('table_name') . " thcv";
|
||||
|
||||
$sql .= " left outer join (
|
||||
select col_band, count(distinct col_state) as count from " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= " where station_id = " . $station_id;
|
||||
$sql .= $this->addStateToQuery();
|
||||
|
||||
$sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')
|
||||
group by col_band";
|
||||
$sql .= ") cfmwas on thcv.col_band = cfmwas.col_band ";
|
||||
|
||||
$sql .= " where station_id = " . $station_id;
|
||||
|
||||
$sql .= $this->addStateToQuery();
|
||||
$sql .= " group by thcv.col_band order by thcv.col_band+0 desc";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
/*
|
||||
* Function returns all worked, but not confirmed states
|
||||
* $postdata contains data from the form, in this case Lotw or QSL are used
|
||||
|
|
|
@ -92,37 +92,8 @@
|
|||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>
|
||||
echo '</tfoot></table></div>';
|
||||
|
||||
<h1>Summary</h1>
|
||||
|
||||
<table class="table table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>
|
||||
<tr><td></td>';
|
||||
|
||||
foreach ($was_summary as $was) { // Fills the table with the data
|
||||
echo '<td style="text-align: center">' . $was->col_band . '</td>';
|
||||
}
|
||||
|
||||
echo '</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr><td>Total worked</td>';
|
||||
|
||||
foreach ($was_summary as $was) { // Fills the table with the data
|
||||
echo '<td style="text-align: center">' . $was->count . '</td>';
|
||||
}
|
||||
|
||||
echo '</tr><tr>
|
||||
<td>Total confirmed</td>';
|
||||
foreach ($was_summary as $was) { // Fills the table with the data
|
||||
echo '<td style="text-align: center">' . $was->cfmwas . '</td>';
|
||||
}
|
||||
|
||||
echo '</tr>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
|
|
Ładowanie…
Reference in New Issue