diff --git a/application/controllers/Station.php b/application/controllers/Station.php index e47ccbd0..2c1398e1 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -56,9 +56,37 @@ class Station extends CI_Controller { } } - public function edit() + public function edit($id) { + $this->load->library('form_validation'); + $this->load->model('stations'); + $this->load->model('dxcc'); + + $station_profile_query = $this->stations->profile($id); + + $data['my_station_profile'] = $station_profile_query->row(); + + $data['dxcc_list'] = $this->dxcc->list(); + + $data['page_title'] = "Edit Station Profile"; + + $this->form_validation->set_rules('station_profile_name', 'Station Profile Name', 'required'); + + if ($this->form_validation->run() == FALSE) + { + $this->load->view('interface_assets/header', $data); + $this->load->view('station_profile/edit'); + $this->load->view('interface_assets/footer'); + } + else + { + $this->stations->edit(); + + $data['notice'] = "Station Profile ".$this->input->post('station_profile_name')." Updated"; + + redirect('station'); + } } function reassign_profile($id) { diff --git a/application/models/Stations.php b/application/models/Stations.php index a4fdf9f9..eb401ef1 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -58,6 +58,7 @@ class Stations extends CI_Model { 'station_cnty' => $this->input->post('station_cnty'), 'station_cq' => $this->input->post('station_cq'), 'station_itu' => $this->input->post('station_itu'), + 'eqslqthnickname' => $this->input->post('eqslnickname'), ); $this->db->where('station_id', $this->input->post('station_id')); diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php new file mode 100644 index 00000000..a5899a9f --- /dev/null +++ b/application/views/station_profile/edit.php @@ -0,0 +1,113 @@ + +