function delete($id = NULL)
 {
     if ($id) {
         $alert = new Information_alert();
         $alert->get_by_information_comment_id($id);
         $alert->delete_all();
         $comment = new Information_comment($id);
         $comment->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
Example #2
0
    function alert($id)
    {
        if ($_POST) {
            $comment = new Information_alert();
            $comment->from_array($_POST);
            $comment->save();
            set_notify('success', 'แจ้งลบความเห็นเรียบร้อย');
            echo '<script type="text/javascript">
					parent.location = unescape(parent.location.pathname);
					</script>
			';
        } else {
            $data['id'] = $id;
            $this->template->set_layout('blank');
            $this->template->build('alert', $data);
        }
    }