arsiarne

c_buat_ebook

Jul 13th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public function buat_ebook(){
  2. $this->load->view("app_user/global/header");
  3.  
  4.  
  5.  
  6.  
  7. $this->form_validation->set_rules('judul_ebook', 'judul_ebook', 'trim|required');
  8. $this->form_validation->set_rules('cover_ebook', 'cover_ebook', 'trim|required');
  9. $this->form_validation->set_rules('isi_ebook', 'isi_ebook', 'trim|required');
  10. $this->form_validation->set_rules('kat_ebook', 'kat_ebook', 'trim|required');
  11.  
  12.  
  13.  
  14.  
  15. if($this->form_validation->run() == FALSE)
  16. {
  17. $this->load->view("app_user/halaman/buat_ebook");
  18. }
  19.  
  20. else
  21. {
  22. if($query = $this->app_model->buat_ebook())
  23. {
  24. $this->session->set_flashdata('success', 'Your ebook successfully created!');
  25. header('location:'.base_url().'app_user/buat_ebook');
  26. }
  27. else
  28. {
  29. $this->session->set_flashdata('msg', 'Error insert database');
  30. header('location:'.base_url().'app_user/buat_ebook');
  31. }
  32. }
  33. $this->load->view("app_user/global/footer");
  34. }
Advertisement
Add Comment
Please, Sign In to add comment