diff --git a/application/controllers/Satellite.php b/application/controllers/Satellite.php index 04e26a918..d7f18cc83 100644 --- a/application/controllers/Satellite.php +++ b/application/controllers/Satellite.php @@ -77,10 +77,15 @@ class Satellite extends CI_Controller { $satellite['name'] = $this->security->xss_clean($this->input->post('name')); $satellite['exportname'] = $this->security->xss_clean($this->input->post('exportname')); $satellite['orbit'] = $this->security->xss_clean($this->input->post('orbit')); + if ($this->security->xss_clean($this->input->post('lotw')) == 'Y') { + $satellite['lotw'] = 'Y'; + } else {; + $satellite['lotw'] = 'N'; + } - $this->satellite_model->saveupdatedsatellite($id, $satellite); + $this->satellite_model->saveupdatedsatellite($id, $satellite); echo json_encode(array('message' => 'OK')); - return; + return; } public function delete() { diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index c2e567b86..07fd82409 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -38,19 +38,15 @@ class Satellite_model extends CI_Model { } function saveupdatedsatellite($id, $satellite) { - $this->db->where('satellite.id', $id); - - $this->db->update('satellite', $satellite); - - return true; + $this->db->where('satellite.id', $id); + $this->db->update('satellite', $satellite); + return true; } function saveSatelliteMode($id, $satmode) { $this->db->where('satellitemode.id', $id); - - $this->db->update('satellitemode', $satmode); - - return true; + $this->db->update('satellitemode', $satmode); + return true; } function add() { @@ -59,6 +55,11 @@ class Satellite_model extends CI_Model { 'exportname' => xss_clean($this->input->post('exportname', true)), 'orbit' => xss_clean($this->input->post('orbit', true)), ); + if (xss_clean($this->input->post('lotw', true)) == 'Y') { + $data['lotw'] = 'Y'; + } else { + $data['lotw'] = 'N'; + } $this->db->where('name', xss_clean($this->input->post('name', true))); $result = $this->db->get('satellite'); diff --git a/application/views/satellite/create.php b/application/views/satellite/create.php index 0a71b7683..115d9f5d3 100644 --- a/application/views/satellite/create.php +++ b/application/views/satellite/create.php @@ -65,6 +65,14 @@ = __("Enter frequency (in Hz) used for downlink"); ?> +