Esempio n. 1
0
 function edit($id = 0)
 {
     $newstopic = new newstopic($id);
     if ($_SERVER['REQUEST_METHOD'] == "GET") {
     } else {
         $newstopic->name = $this->input->post('name');
         $this->load->helper('remove_vn_helper');
         $newstopic->name_none = remove_vn($newstopic->name);
         if ($newstopic->save()) {
             redirect($this->admin . 'newstopics/edit/' . $newstopic->id);
         }
     }
     $dis['base_url'] = base_url();
     $dis['title'] = "Thêm/ Sửa dòng sự kiện tin tức";
     $dis['menu_active'] = "Dòng sự kiện";
     $dis['view'] = "newstopic/edit";
     $dis['object'] = $newstopic;
     $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}newstopics/", "onclick" => ""), array("type" => "add", "text" => "Thêm mới", "link" => "{$this->admin_url}newstopics/edit", "onclick" => ""));
     $this->viewadmin($dis);
 }