db->insert($table, $data); }else{ $insert = $this->db->insert_batch($table, $data); } return $insert; } public function update($table, $data, $pk, $id = null, $batch = false) { if($batch === false){ $insert = $this->db->update($table, $data, array($pk => $id)); }else{ $insert = $this->db->update_batch($table, $data, $pk); } return $insert; } public function delete($table, $data, $pk) { $this->db->where_in($pk, $data); return $this->db->delete($table); } public function getData_UnitService($id = null){ if ($id === null) { $this->db->select('*'); $this->db->from('unitservice a'); $this->db->join('jenis b','b.ID_JENIS=a.JENIS_ID'); $this->db->order_by('a.NAMA_UNITSERVICE'); }else{ $this->db->select('*'); $this->db->from('unitservice'); $this->db->where(['ID_UNITSERVICE' => $id]); } return $this->db->get()->result_array(); } public function getData_UnitService_byNAMA($nama, $id=null){ $this->db->select('*'); $this->db->from('unitservice'); $this->db->where(['NAMA_UNITSERVICE' => $nama]); if ($id!=null) { $this->db->where('ID_UNITSERVICE!=', $id); } return $this->db->get()->result_array(); } public function getData_SnService_byUNITSERVICE($id){ $this->db->select('*'); $this->db->from('sn_service'); $this->db->where(['UNITSERVICE_ID' => $id]); return $this->db->get()->result_array(); } public function getData_Jenis_BIAYANot0(){ $this->db->select('*'); $this->db->from('jenis'); $this->db->where('BIAYA_SERVICE!="0.00"'); return $this->db->get()->result_array(); } } ?>