Files
monpas/application/models/ijkpartituur/Moddoelgroepen.php
T
2021-07-10 16:25:16 +02:00

34 lines
845 B
PHP

<?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;};
}
}