diff --git a/application/controllers/Mode.php b/application/controllers/Mode.php index a5afe7c3..b6176fbb 100644 --- a/application/controllers/Mode.php +++ b/application/controllers/Mode.php @@ -90,4 +90,22 @@ class Mode extends CI_Controller { redirect('mode'); } + + public function activate() { + $id = $this->input->post('id'); + $this->load->model('modes'); + $this->modes->activate($id); + header('Content-Type: application/json'); + echo json_encode(array('message' => 'OK')); + return; + } + + public function deactivate() { + $id = $this->input->post('id'); + $this->load->model('modes'); + $this->modes->deactivate($id); + header('Content-Type: application/json'); + echo json_encode(array('message' => 'OK')); + return; + } } \ No newline at end of file diff --git a/application/models/Modes.php b/application/models/Modes.php index 76aaee7b..07d9ec28 100644 --- a/application/models/Modes.php +++ b/application/models/Modes.php @@ -72,6 +72,36 @@ class Modes extends CI_Model { $this->db->delete('adif_modes', array('id' => $clean_id)); } + function activate($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); + + $data = array( + 'active' => '1', + ); + + $this->db->where('id', $clean_id); + + $this->db->update('adif_modes', $data); + + return true; + } + + function deactivate($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); + + $data = array( + 'active' => '0', + ); + + $this->db->where('id', $clean_id); + + $this->db->update('adif_modes', $data); + + return true; + } + } ?> \ No newline at end of file diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index b88d22d6..d72d89cc 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1809,6 +1809,38 @@ $(document).ready(function(){ + uri->segment(1) == "mode") { ?> + + + uri->segment(1) == "accumulated") { ?>