Files
2021-07-10 16:25:16 +02:00

32 lines
882 B
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Description of Activiteiten model
*
* @author Liesbeth
* @date april 25 2013
*/
class ModReferenties extends MY_Model{
protected $tablename = 'tbReferenties';
function __construct(){
parent::__construct();
//$models = array();
//$this->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