Only modes used for EME

This commit is contained in:
Andreas Kristiansen
2025-05-26 22:11:12 +02:00
parent 600915f34c
commit 6e56f30588
3 changed files with 28 additions and 15 deletions

View File

@@ -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();

View File

@@ -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;
}
}
?>

View File

@@ -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>