function edit_category() { $category_model = new Category_model(); $category_service = new Category_service(); $category_model->set_id($this->input->post('category_id', TRUE)); $category_model->set_name($this->input->post('name', TRUE)); echo $category_service->update_category($category_model); }
function load_animal() { $animal_service = new Animal_service(); $category_service = new Category_service(); $data['categories'] = $category_service->get_all_categories(); $data['animal'] = $animal_service->get_animal($this->input->post('id', TRUE)); echo $this->load->view('animal/animal_edit_popup', $data, TRUE); }