From c55ea496752f55cbe334c807440e05897f7087eb Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 4 Sep 2022 08:49:58 +0200 Subject: [PATCH] [Bands] Added a controller and a view to display bands with options --- application/controllers/Band.php | 30 ++++++++++ application/models/Bands.php | 9 +++ application/views/bands/index.php | 93 +++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 application/controllers/Band.php create mode 100644 application/views/bands/index.php diff --git a/application/controllers/Band.php b/application/controllers/Band.php new file mode 100644 index 00000000..505575a9 --- /dev/null +++ b/application/controllers/Band.php @@ -0,0 +1,30 @@ +load->helper(array('form', 'url')); + + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + public function index() + { + $this->load->model('bands'); + + $data['bands'] = $this->bands->all(); + + // Render Page + $data['page_title'] = "Bands"; + $this->load->view('interface_assets/header', $data); + $this->load->view('bands/index'); + $this->load->view('interface_assets/footer'); + } +} \ No newline at end of file diff --git a/application/models/Bands.php b/application/models/Bands.php index a56faaf0..a49ae19c 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -28,6 +28,15 @@ class Bands extends CI_Model { "SAT"=>0, ); + function all2() { + $this->db->order_by('band', 'ASC'); + return $this->db->get('bands'); + } + + function all() { + return $this->bandslots; + } + function get_worked_bands() { $CI =& get_instance(); $CI->load->model('logbooks_model'); diff --git a/application/views/bands/index.php b/application/views/bands/index.php new file mode 100644 index 00000000..b2608a57 --- /dev/null +++ b/application/views/bands/index.php @@ -0,0 +1,93 @@ +
+ Using the band list you can control which bands are shown when creating a new QSO. +
++ Active bands will be shown in the QSO "Band" drop-down, while inactive bands will be hidden and cannot be selected. +
+