load->database(); } public function getCustomerByLimit($from, $to) { return $this->db->get("customer", $from, $to); } public function getAllCustomerOrderBy($col, $order) { return $this->db->order_by($col, $order)->get("customer"); } public function getCustomerByLastnameFirstname($name) { return $this->db->like("CONCAT(lastname, ', ', firstname)", $name)->get("customer"); } public function addNewCustomer() { $data = array( "lastname" => $this->lastname, "firstname" => $this->firstname, "dob" => $this->dob, "contactinfo" => $this->contactinfo, "emailadd" => $this->emailadd, "address" => $this->address ); $this->db->set($data); $this->db->set("editdate", "NOW()", FALSE); $success = $this->db->set("creationdate", "NOW()", FALSE)->insert("customer"); if($success) return array("success"=>$success, "data" => $this->db->insert_id()); else return array("success"=>$success, "data" => $this->db->error()); } }