/** * Jobscats::edit() * @param integer $id * @return */ function edit($id = 0) { $jobscat = new Jobscat($id); if ($_SERVER['REQUEST_METHOD'] == 'GET') { } else { $jobscat->name_vietnamese = $this->input->post('name_vietnamese'); $jobscat->name_english = $this->input->post('name_english'); $jobscat->name_japanese = $this->input->post('name_japanese'); $jobscat->url = $this->input->post('url'); $jobscat->description_vietnamese = $this->input->post('description_vietnamese'); $jobscat->description_english = $this->input->post('description_english'); $jobscat->description_japanese = $this->input->post('description_japanese'); $jobscat->keyword_vietnamese = $this->input->post('keyword_vietnamese'); $jobscat->keyword_english = $this->input->post('keyword_english'); $jobscat->keyword_japanese = $this->input->post('keyword_japanese'); if ($jobscat->save()) { flash_message('success', 'Thành công. Thao tác đã được thực hiện.'); redirect($this->admin . 'jobscats/edit/' . $jobscat->id); } else { flash_message('error', 'Có lỗi. Vui lòng kiểm tra lại'); redirect($this->admin_url . 'jobscats/listAll'); } } $sitelanguage = new Sitelanguage(); $sitelanguage->order_by('position'); $sitelanguage->get()->all; $dis['sitelanguage'] = $sitelanguage; $dis['base_url'] = base_url(); $dis['view'] = 'jobscat/edit'; $dis['object'] = $jobscat; $dis['menu_active'] = "Danh mục công việc"; //$dis['title_table']="Trang hiện tại"; $dis['title'] = "Thêm/sửa danh mục"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}jobscats/listAll", "onclick" => "")); $this->viewadmin($dis); }