From 4eae240fb9bce9390d2249db37beda1b89f7927c Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 9 Sep 2022 18:52:57 +0200 Subject: [PATCH] [Bands] Updated edit/create band to include bandgroup, cw/ssb/data qrg --- application/controllers/Band.php | 6 +++++- application/models/Bands.php | 12 ++++++++++-- application/views/bands/create.php | 20 ++++++++++++++++++++ application/views/bands/edit.php | 22 +++++++++++++++++++++- application/views/bands/index.php | 20 ++++++++++++++------ 5 files changed, 70 insertions(+), 10 deletions(-) diff --git a/application/controllers/Band.php b/application/controllers/Band.php index 61403418..910561a6 100644 --- a/application/controllers/Band.php +++ b/application/controllers/Band.php @@ -65,7 +65,11 @@ class Band extends CI_Controller { $this->load->model('bands'); $id = $this->security->xss_clean($this->input->post('id', true)); - $band = $this->security->xss_clean($this->input->post('band', true)); + $band['band'] = $this->security->xss_clean($this->input->post('band', true)); + $band['bandgroup'] = $this->security->xss_clean($this->input->post('bandgroup', true)); + $band['ssbqrg'] = $this->security->xss_clean($this->input->post('ssbqrg', true)); + $band['dataqrg'] = $this->security->xss_clean($this->input->post('dataqrg', true)); + $band['cwqrg'] = $this->security->xss_clean($this->input->post('cwqrg', true)); $this->bands->saveupdatedband($id, $band); echo json_encode(array('message' => 'OK')); diff --git a/application/models/Bands.php b/application/models/Bands.php index 209aa1a0..d0c52023 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -262,7 +262,11 @@ class Bands extends CI_Model { function add() { $data = array( - 'band' => xss_clean($this->input->post('band', true)), + 'band' => xss_clean($this->input->post('band', true)), + 'bandgroup' => xss_clean($this->input->post('bandgroup', true)), + 'ssb' => xss_clean($this->input->post('ssbqrg', true)), + 'data' => xss_clean($this->input->post('dataqrg', true)), + 'cw' => xss_clean($this->input->post('cwqrg', true)), ); $this->db->where('band', xss_clean($this->input->post('band', true))); @@ -283,7 +287,11 @@ class Bands extends CI_Model { function saveupdatedband($id, $band) { $data = array( - 'band' => $band, + 'band' => $band['band'], + 'bandgroup' => $band['bandgroup'], + 'ssb' => $band['ssbqrg'], + 'data' => $band['dataqrg'], + 'cw' => $band['cwqrg'], ); $this->db->where('bands.id', $id); diff --git a/application/views/bands/create.php b/application/views/bands/create.php index fa55a435..5f397f61 100644 --- a/application/views/bands/create.php +++ b/application/views/bands/create.php @@ -25,6 +25,26 @@ Band name +
| Band | -Active | CQ | DOK | DXCC | @@ -37,6 +37,10 @@US Counties | WAS | VUCC | +Bandgroup | +SSB QRG | +DATA QRG | +CW QRG | @@ -46,8 +50,8 @@ | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| band;?> | active == 1) {echo 'checked';}?>> | +band;?> | cq == 1) {echo 'checked';}?>> | dok == 1) {echo 'checked';}?>> | dxcc == 1) {echo 'checked';}?>> | @@ -57,14 +61,18 @@uscounties == 1) {echo 'checked';}?>> | was == 1) {echo 'checked';}?>> | vucc == 1) {echo 'checked';}?>> | +bandgroup;?> | +ssb;?> | +data;?> | +cw;?> | - Edit + | - Delete + | - Save + |