Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- */
- class main extends CI_Controller {
- function __construct(){
- parent::__construct();
- $this->load->model('m_data');
- $this->load->helper('url');
- }
- function index() {
- $data['car'] = $this->m_data->tampil_data();
- $this->load->view('data', $data);
- }
- function tambah(){
- $this->load->view('data2');
- }
- function getData(){
- $tiket = $this->input->get('tiket');
- $data = $this->m_data->getDataTiket($tiket);
- retrun $data;
- }
- function action_tambah(){
- $tiket = $this->input->post('tiket');
- $refrom = $this->input->post('refrom');
- $divisi = $this->input->post('divisi');
- $retime = $this->input->post('retime');
- $departure = $this->input->post('departure');
- $destination = $this->input->post('destination');
- $data = array(
- 'tiket' => $tiket,
- 'refrom' => $refrom,
- 'divisi' => $divisi,
- 'retime' => $retime,
- 'departure' => $departure,
- 'destination' => $destination,
- );
- $this->m_data->tambah_data($data, 'car');
- redirect('main/index');
- }
- function show(){ //function show data
- $data=$this->input->post('tiket');
- $this->db->where('refrom',$data);
- $this->db->show('car');
- redirect('main');
- }
- /*
- function tambah_action(){
- $tiket = $this->load->post('tiket');
- $refrom = $this->load->post('refrom');
- $divisi = $this->load->post('divisi');
- $retime = $this->load->post('retime');
- $departure = $this->load->post('departure');
- $destination = $this->load->post('destination');
- $data = array(
- 'tiket' => $tiket,
- 'refrom' => $refrom,
- 'divisi' => $divisi,
- 'retime' => $retime,
- 'departure' => $departure,
- 'destination' => $destination,
- );
- $this->m_data->input_data($data, 'car');
- redirect('main/index');
- }
- */
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement