Advertisement
devasatrio

input_ci_04

Apr 6th, 2018
2,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. class C_buku extends CI_Controller
  3. {
  4.  function __construct()
  5. {
  6. parent::__construct();
  7. $this->load->model('M_buku');
  8. }
  9.  
  10. function index(){
  11. $this->load->view('main');
  12. }
  13.  
  14. function i(){
  15. $this->load->view('input');
  16. }
  17.  
  18. function input(){
  19. $judul = $this->input->post('judul');
  20. $tebal = $this->input->post('tebal');
  21. $penerbit = $this->input->post('penerbit');
  22.  
  23.   //------------------------------------------
  24.  
  25. $data_buku = array(
  26. 'judul'=>$judul,
  27. 'tebal'=>$tebal,
  28. 'penerbit'=>$penerbit
  29. );
  30.  
  31. $this->M_buku->tambah_data($data_buku);
  32. redirect('C_buku');
  33. }}
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement