Ejemplo n.º 1
0
 function delete($id = FALSE)
 {
     if ($id) {
         $alert = new blogcomment_alert();
         $alert->get_by_blogcomment_id($id);
         $alert->delete_all();
         $comment = new blogcomment($id);
         $comment->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect('blogs/admin/blogs');
 }
Ejemplo n.º 2
0
    function alert($id)
    {
        if ($_POST) {
            $comment = new blogcomment_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);
        }
    }