AhmadSS

Controller

May 11th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. <?php
  2. class Barang extends CI_Controller{
  3.  
  4.     function __construct(){
  5.         parent::__construct();     
  6.         $this->load->model('model_umroh');
  7.     }
  8.  
  9.     function index(){
  10.         $data['user'] = $this->model_umroh->tampil_data()->result();
  11.         $this->load->view('lihat_data',$data);
  12.     }
  13.  
  14.     function tambah(){
  15.         $this->load->view('form_input');
  16.     }
  17.  
  18.     function tambah_aksi(){
  19.           $id_umroh                     = addslashes($this->input->post('id_umroh'));
  20.         $nama_paket                   = addslashes($this->input->post('nama_paket'));
  21.         $harga_paket                   = addslashes($this->input->post('harga_paket'));
  22.         $pilih_paket                  = addslashes($this->input->post('pilih_paket'));
  23.         $prog_hari                  = addslashes($this->input->post('prog_hari'));
  24.         $akomodasi_hotel                 = addslashes($this->input->post('akomodasi_hotel'));
  25.  
  26.         $data = array(
  27.               'id_umroh'   => $id_umroh,
  28.                 'nama_paket'  => $nama_paket,
  29.                 'harga_paket' => $harga_paket,
  30.                 'pilih_paket'=> $pilih_paket,
  31.                 'prog_hari'    => $prog_hari,
  32.                 'akomodasi_hotel'     => $akomodasi_hotel
  33.             );
  34.         $this->model_umroh->input_data($data,'tb_umroh');
  35.         redirect('barang/index');
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment