function admin_delete($id) { if (!is_numeric($id)) { show_error("ID Must be numeric!"); } $this->_load_admin(); $query = $this->db->query("DELETE FROM `event_messages` WHERE `id` = '{$id}'"); $this->data["highlight"] = "1"; $this->data["highlight_message"] = "Event #{$id} was successfully deleted"; $this->admin(); }
function ads_edit($id) { if (!is_numeric($id)) { show_error("ID Must be numeric"); } $query = $this->db->query("SELECT * FROM `adverts` WHERE `id` = '{$id}'"); if ($query->num_rows() == 0) { show_error("Hmm...That must be deleted or something...Atleast theres no data for it!"); } else { $result = $query->result_array(); $result = $result[0]; foreach ($result as $key => $data) { $this->data[$key] = $data; } $this->data["form"] = "ads_edit_post/{$id}"; $this->data["submitText"] = "Update Advertisement"; $this->load->view("ads/form", $this->data); } }