Advertisement
freddy0512

controller

Nov 6th, 2014
202
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 updateProductDb()
  2. {
  3. $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
  4. $this->form_validation->set_rules('kode', 'kode', 'required');
  5. $this->form_validation->set_rules('kategori', 'Kategori', 'required');
  6. $this->form_validation->set_rules('active', 'Radio button', 'required');
  7.  
  8.  
  9. if ($this->form_validation->run() == FALSE)
  10. {
  11. $header = array(
  12. 'title' =>'Welcome to my Website'
  13. );
  14. $content = array(
  15. 'article' =>'Lorem Ipsum Dolor Sit Amet'
  16. );
  17. $data['data_to_load'] = array($header,$content);
  18. $data['tmp_file']='kategori/update_product';
  19. $this->load->view('index',$data);
  20. }
  21.  
  22.  
  23. $data=array(
  24. 'kategori'=>$this->input->post('kategori'),
  25. 'status'=>$this->input->post('active'),
  26. );
  27.  
  28. $condition['id_kategori'] = $this->input->post('id_kategori');
  29. $this->kategori_model->updateProduct($data, $condition);
  30. redirect('kategori');
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement