diff --git a/application/controllers/Activated_grids.php b/application/controllers/Activated_grids.php index aab6ca04..2bbbaf84 100644 --- a/application/controllers/Activated_grids.php +++ b/application/controllers/Activated_grids.php @@ -19,6 +19,7 @@ class Activated_grids extends CI_Controller { public function index() { // if there are no satellite QSOs redirect to band selection directly $this->load->model('logbook_model'); + $this->load->model('bands'); $total_sat = $this->logbook_model->total_sat(); if ($total_sat->num_rows() == 0) { redirect('activated_grids/band/2m'); @@ -26,6 +27,7 @@ class Activated_grids extends CI_Controller { } $data['page_title'] = "Activated Gridsquare Map"; + $data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true); $this->load->view('interface_assets/header', $data); $this->load->view('activated_grids/main.php'); diff --git a/application/controllers/Band.php b/application/controllers/Band.php index acce57b8..04c6ec17 100644 --- a/application/controllers/Band.php +++ b/application/controllers/Band.php @@ -137,4 +137,16 @@ class Band extends CI_Controller { echo json_encode(array('message' => 'OK')); return; } + + public function saveBandAward() { + $award = $this->security->xss_clean($this->input->post('award')); + $status = $this->security->xss_clean($this->input->post('status')); + + $this->load->model('bands'); + $this->bands->saveBandAward($award, $status); + + header('Content-Type: application/json'); + echo json_encode(array('message' => 'OK')); + return; + } } \ No newline at end of file diff --git a/application/controllers/Gridsquares.php b/application/controllers/Gridsquares.php index 0034963d..87dbafe0 100644 --- a/application/controllers/Gridsquares.php +++ b/application/controllers/Gridsquares.php @@ -19,6 +19,7 @@ class Gridsquares extends CI_Controller { public function index() { // if there are no satellite QSOs redirect to band selection directly $this->load->model('logbook_model'); + $this->load->model('bands'); $total_sat = $this->logbook_model->total_sat(); if ($total_sat->num_rows() == 0) { redirect('gridsquares/band/2m'); @@ -26,6 +27,7 @@ class Gridsquares extends CI_Controller { } $data['page_title'] = "Gridsquare Map"; + $data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true); $this->load->view('interface_assets/header', $data); $this->load->view('gridsquares/main.php'); diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 491da78d..6652b5f7 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -37,7 +37,8 @@ class QSO extends CI_Controller { $data['dxcc'] = $this->logbook_model->fetchDxcc(); $data['iota'] = $this->logbook_model->fetchIota(); $data['modes'] = $this->modes->active(); - $data['bands'] = $this->bands->get_user_bands_for_qso_entry(); + $data['bands'] = $this->bands->get_user_bands_for_qso_entry(); + $data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true); $this->load->library('form_validation'); diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index 4e3a33ec..9d187b13 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -5,6 +5,7 @@ class Statistics extends CI_Controller { public function index() { $this->load->model('user_model'); + $this->load->model('bands'); if(!$this->user_model->authorize($this->config->item('auth_mode'))) { if($this->user_model->validate_session()) { $this->user_model->clear_session(); @@ -17,6 +18,7 @@ class Statistics extends CI_Controller { // Set Page Title $data['page_title'] = "Statistics"; + $data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true); // Load Views $this->load->view('interface_assets/header', $data); diff --git a/application/models/Bands.php b/application/models/Bands.php index a31582e5..f8eee324 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -260,6 +260,18 @@ class Bands extends CI_Model { $this->db->update('bandxuser', $data); + return true; + } + + function saveBandAward($award, $status) { + $data = array( + $award => $status == "true" ? '1' : '0', + ); + + $this->db->where('bandxuser.userid', $this->session->userdata('user_id')); + + $this->db->update('bandxuser', $data); + return true; } diff --git a/application/views/activated_grids/main.php b/application/views/activated_grids/main.php index bb753951..1858097a 100644 --- a/application/views/activated_grids/main.php +++ b/application/views/activated_grids/main.php @@ -12,7 +12,9 @@
diff --git a/application/views/bands/index.php b/application/views/bands/index.php index ad01691e..ec79ddb5 100644 --- a/application/views/bands/index.php +++ b/application/views/bands/index.php @@ -1,3 +1,15 @@ +