Only bands with EME

This commit is contained in:
Andreas Kristiansen
2025-05-26 20:06:08 +02:00
parent 648097149c
commit 94df939957
3 changed files with 20 additions and 2 deletions

View File

@@ -314,7 +314,7 @@ class Statistics extends CI_Controller {
$data['modes'] = $this->modes->active();
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['worked_bands'] = $this->bands->get_worked_bands_eme();
// Set Page Title
$data['page_title'] = __("EME Initials");

View File

@@ -391,6 +391,25 @@ class Bands extends CI_Model {
return $worked_slots;
}
function get_worked_bands_eme() {
if (!$this->logbooks_locations_array) {
return array();
}
$location_list = "'".implode("','",$this->logbooks_locations_array)."'";
// get all worked slots from database
$data = $this->db->query(
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."` WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE = 'EME'"
);
$worked_slots = array();
foreach($data->result() as $row){
array_push($worked_slots, $row->COL_BAND);
}
return $worked_slots;
}
}
?>

View File

@@ -7,7 +7,6 @@
<label class="col-md-1 control-label" for="band"><?= __("Band") ?></label>
<div class="col-md-3">
<select id="band" name="band" class="form-select">
<option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?= __("All") ?></option>
<?php foreach($worked_bands as $band) {
echo '<option value="' . $band . '"';
if ($this->input->post('band') == $band) echo ' selected';