load->model($models); } function get_refs ($type=false,$zoek=false){ $this->sql = "SELECT id, naam, link, opmerking,soort,srtlink, docnaam FROM tbReferenties"; if ($type) {$this->sql .=" WHERE soort = {$type} ";} else { $this->sql .= " WHERE true " ; } ; if ($zoek) { $zoektekst = '%'.strtolower($zoek).'%'; $this ->sql .=" AND (LOWER(naam) LIKE '{$zoektekst}' OR LOWER(link) LIKE '{$zoektekst}' )" ;} ; $this->sql .= " ORDER BY naam"; return $this->get_query_result(); } } // einde class modreferenties