Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. *
  5. */
  6. class main extends CI_Controller {
  7.  
  8. function __construct(){
  9. parent::__construct();
  10. $this->load->model('m_data');
  11. $this->load->helper('url');
  12. }
  13.  
  14. function index() {
  15. $data['car'] = $this->m_data->tampil_data();
  16. $this->load->view('data', $data);
  17. }
  18.  
  19. function tambah(){
  20. $this->load->view('data2');
  21. }
  22.  
  23. function getData(){
  24. $tiket = $this->input->get('tiket');
  25. $data = $this->m_data->getDataTiket($tiket);
  26.  
  27. retrun $data;
  28. }
  29.  
  30. function action_tambah(){
  31. $tiket = $this->input->post('tiket');
  32. $refrom = $this->input->post('refrom');
  33. $divisi = $this->input->post('divisi');
  34. $retime = $this->input->post('retime');
  35. $departure = $this->input->post('departure');
  36. $destination = $this->input->post('destination');
  37.  
  38.  
  39. $data = array(
  40. 'tiket' => $tiket,
  41. 'refrom' => $refrom,
  42. 'divisi' => $divisi,
  43. 'retime' => $retime,
  44. 'departure' => $departure,
  45. 'destination' => $destination,
  46.  
  47. );
  48.  
  49. $this->m_data->tambah_data($data, 'car');
  50. redirect('main/index');
  51. }
  52.  
  53. function show(){ //function show data
  54. $data=$this->input->post('tiket');
  55. $this->db->where('refrom',$data);
  56. $this->db->show('car');
  57. redirect('main');
  58. }
  59.  
  60. /*
  61.  
  62. function tambah_action(){
  63. $tiket = $this->load->post('tiket');
  64. $refrom = $this->load->post('refrom');
  65. $divisi = $this->load->post('divisi');
  66. $retime = $this->load->post('retime');
  67. $departure = $this->load->post('departure');
  68. $destination = $this->load->post('destination');
  69.  
  70. $data = array(
  71. 'tiket' => $tiket,
  72. 'refrom' => $refrom,
  73. 'divisi' => $divisi,
  74. 'retime' => $retime,
  75. 'departure' => $departure,
  76. 'destination' => $destination,
  77.  
  78. );
  79.  
  80. $this->m_data->input_data($data, 'car');
  81. redirect('main/index');
  82.  
  83. }
  84.  
  85. */
  86. }
  87.  
  88. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement