Advertisement
freddy0512

controller

Nov 27th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. public function create(){
  2. $this->load->helper('string');
  3. $this->load->library('Datatables');
  4. $this->load->library('table');
  5. //ini table yang tampung data barang, perhatikan baik-baik
  6. $tmpl = array('table_open' => '<table id="big_table" border="1" cellpadding="2" cellspacing="1" class="table table-striped table-bordered">');
  7. $this->table->set_template($tmpl);
  8. $this->table->set_heading('no_faktur', 'kode_barang', 'kuantity', 'hargabeli','diskon1','diskon2','diskon3','ppn','kode_lokasi_barang','total_bayar','Action');
  9. $this->load->view('pembelian/form_pembelian', $data);
  10. }
  11.  
  12.  
  13. public function datatablebarangbelisatuan(){
  14.  
  15. $this->load->library('Datatables');
  16. $this->datatables->select('detail_beli.id, detail_beli.no_faktur, detail_beli.kode_barang, detail_beli.kuantity, detail_beli.hargabeli, detail_beli.diskon1, detail_beli.diskon2, detail_beli.diskon3, detail_beli.ppn, detail_beli.kode_lokasi_barang, detail_beli.total_bayar')
  17. ->unset_column('detail_beli.id')
  18. ->add_column('Actions', get_pembeliansatuan('$1'), 'detail_beli.id')
  19. ->from('detail_beli');
  20. echo $this->datatables->generate();
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement