load->model('pembayaran_m'); } public function index() { $this->load->model(['customer_m','sparepart_m']); $customer = $this->customer_m->get()->result(); $sparepart = $this->sparepart_m->get()->result(); $data = array( 'customer'=> $customer, 'sparepart'=> $sparepart, 'wo' => $this->pembayaran_m->wo(), ); $this->template->load('template','pembayaran/pembayaran_form', $data); } public function process() { $data =$this->input->post(null, TRUE); if(isset($_POST['add'])) { $this->pembayaran_m->add($data); } if($this->db->affected_rows() > 0) { $params = array("success" => true); } else { $params = array("success" => false); } echo json_encode($params); } }