initial commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Doelgroepen model
|
||||
*
|
||||
* @author Liesbeth
|
||||
* @date april 25 2013
|
||||
*/
|
||||
|
||||
class ModDoelgroepen extends MY_Model{
|
||||
|
||||
protected $tablename = 'tbdoelgroepen';
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
//$models = array();
|
||||
//$this->load->model($models);
|
||||
}
|
||||
|
||||
function getAll(){
|
||||
$this->sql = "SELECT id, omschrijving
|
||||
FROM tbDoelgroepen";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function findNoUse($doelgroepID){
|
||||
$this->sql = "SELECT count(*) as aantal
|
||||
FROM tbActxDoelgroep a, tbPartActxDoelgroep p
|
||||
WHERE a.doelgroepID = {$doelgroepID}
|
||||
OR p.doelgroepID = {$doelgroepID}";
|
||||
$count = $this->db->query($this->sql)->row()->aantal;
|
||||
if ($count > 0) {return false;}
|
||||
else {return true;};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user