Advertisement
anjhar

import_member (controller)

Nov 25th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. function proses_import_member()
  2. {
  3. $this->load->library('form_validation');
  4. if ($this->valid) {
  5. $this->form_validation->set_rules('pegawai_l', 'pegawai_l', 'trim|required|xss_clean');
  6. $this->form_validation->set_rules('pegawai_p', 'pegawai_p', 'trim|required|xss_clean');
  7. $this->form_validation->set_rules('siswa_l', 'siswa_l', 'trim|required|xss_clean');
  8. $this->form_validation->set_rules('siswa_p', 'siswa_p', 'trim|required|xss_clean');
  9. if ($this->form_validation->run() == FALSE) {
  10. $output = '{ "success": "no", "title": "Isi data dengan lengkap" }';
  11. } else {
  12. $data['pegawai_l'] = $this->input->post('pegawai_l');
  13. $data['pegawai_p'] = $this->input->post('pegawai_p');
  14. $data['siswa_l'] = $this->input->post('siswa_l');
  15. $data['siswa_p'] = $this->input->post('siswa_p');
  16.  
  17. $this->member_model->update($this->input->post('id'),$data);
  18.  
  19. $data['url'] = $this->input->post('url');
  20. $output = '{ "success": "yes", "title": "save", "content":"member", "component": "index_member/' . $data['url'] . '" }';
  21. }
  22. $output = str_replace("\r", "", $output);
  23. $output = str_replace("\n", "", $output);
  24. echo $output;
  25. }else {
  26. $this->session->sess_destroy();
  27. $this->load->view('redirect_logout');
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement