Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public function update()
  2.     {
  3.         $post = $this->input->post();
  4.         $this->service_id = $post["id"];
  5.         $this->name = $post["name"];
  6.         $this->price = $post["price"];
  7.  
  8.  
  9.         if (!empty($_FILES["image"]["name"])) {
  10.             $this->image = $this->_uploadImage();
  11.         } else {
  12.             $this->image = $post["old_image"];
  13.         }
  14.  
  15.         $this->description = $post["description"];
  16.         $this->db->update($this->_table, $this, array('service_id' => $post['id']));
  17.     }
  18.  
  19.     public function delete($id)
  20.     {
  21.         $this->_deleteImage($id);
  22.         return $this->db->delete($this->_table, array("service_id" => $id));
  23.     }