SHARE
TWEET

Untitled

a guest Mar 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function posts($category = 0) {
  2.       if ($this->session->userdata('student_login') != 1)
  3.         redirect(base_url(), 'refresh');
  4.  
  5.       $page_data['category_filter'] = $category;
  6.       $page_data['page_name']         = 'posts';
  7.       $page_data['page_title']        = 'Postagens';
  8.       $this->load->view('backend/index', $page_data);
  9.     }
  10.      function create_comment($post) {
  11.       if ($this->session->userdata('student_login') != 1)
  12.         redirect(base_url(), 'refresh');
  13.         $data['content'] = $this->input->post('comment');
  14.        $data['post_id'] = $post;
  15.        $data['created_by_student'] = $this->session->userdata('student_id');
  16.        $data['created_by'] = 'student';
  17.        $data['created_at'] = date('d/m/Y H:m');
  18.         $this->db->insert('post_comments', $data);
  19.         $this->session->set_flashdata('flash_message', 'Enviado com sucesso');
  20.        redirect(site_url('student/posts'), 'refresh');
  21.      }
  22.       function delete_comment($comment) {
  23.       if ($this->session->userdata('student_login') != 1)
  24.         redirect(base_url(), 'refresh');
  25.        $this->db->where('id', $comment);
  26.       $this->db->delete('post_comments');
  27.       $this->session->set_flashdata('flash_message', 'Removido com sucesso');
  28.       redirect(site_url('student/posts'), 'refresh');  
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top