public function index_delete() { $status = 404; $return["data"] = ""; $return["result"] = "NOOK"; $id = $this->delete('id') > 0 ? $this->delete('id') : 0; if ($id > 0) { $message = CI_Message::getById($id); $message = $message[0]; if ($message->delete()) { $status = 200; $return["result"] = "OK"; } } $this->response($return, $status); }