mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Only modes used for EME
This commit is contained in:
@@ -309,10 +309,10 @@ class Statistics extends CI_Controller {
|
||||
}
|
||||
|
||||
public function initials() {
|
||||
$this->load->model('modes');
|
||||
$this->load->model('stats');
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['modes'] = $this->modes->active();
|
||||
$data['modes'] = $this->stats->get_eme_modes();
|
||||
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands_eme();
|
||||
|
||||
|
||||
@@ -951,6 +951,29 @@
|
||||
return $result->result();
|
||||
}
|
||||
|
||||
function get_eme_modes() {
|
||||
|
||||
$modes = array();
|
||||
|
||||
$this->db->select('distinct col_mode, coalesce(col_submode, "") col_submode', FALSE);
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
|
||||
$this->db->where($this->config->item('table_name').'.col_prop_mode', 'EME');
|
||||
$this->db->order_by('col_mode, col_submode', 'ASC');
|
||||
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
foreach($query->result() as $mode){
|
||||
if ($mode->col_submode == null || $mode->col_submode == "") {
|
||||
array_push($modes, $mode->col_mode);
|
||||
} else {
|
||||
array_push($modes, $mode->col_submode);
|
||||
}
|
||||
}
|
||||
|
||||
return $modes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
<div class="w-auto">
|
||||
<select id="band" name="band" class="form-select">
|
||||
<?php foreach($worked_bands as $band) {
|
||||
echo '<option value="' . $band . '"';
|
||||
if ($this->input->post('band') == $band) echo ' selected';
|
||||
echo '>' . $band . '</option>'."\n";
|
||||
echo '<option value="' . $band . '">' . $band . '</option>'."\n";
|
||||
} ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -21,16 +19,8 @@
|
||||
<select id="mode" name="mode" class="form-select">
|
||||
<option value="All" <?php if ($this->input->post('mode') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("All") ?></option>
|
||||
<?php
|
||||
foreach($modes->result() as $mode){
|
||||
if ($mode->submode == null) {
|
||||
echo '<option value="' . $mode->mode . '"';
|
||||
if ($this->input->post('mode') == $mode->mode) echo ' selected';
|
||||
echo '>' . $mode->mode . '</option>'."\n";
|
||||
} else {
|
||||
echo '<option value="' . $mode->submode . '"';
|
||||
if ($this->input->post('mode') == $mode->submode) echo ' selected';
|
||||
echo '>' . $mode->submode . '</option>'."\n";
|
||||
}
|
||||
foreach($modes as $mode){
|
||||
echo '<option value="' . $mode . '">' . $mode . '</option>'."\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user