db_onedev = $this->load->database("onedev", true); } public function lookup() { if (! $this->isLogin) { $this->sys_error("Invalid Token"); exit; } $query = " SELECT M_DeliveryID as id, M_DeliveryTypeID as typeid, M_DeliveryTypeCode as type, M_DeliverySource as source, M_DeliveryName as name FROM m_deliverytype JOIN m_delivery ON M_DeliveryM_DeliveryTypeID = M_DeliveryTypeID AND M_DeliveryIsActive = 'Y' WHERE M_DeliveryTypeIsActive = 'Y'"; $rows = $this->db_onedev->query($query)->result_array(); $result = array( "total" => count($rows) , "records" => $rows ); $this->sys_ok($result); exit; } }