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

40 lines
1.1 KiB
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Description of model
*
* @author Liesbeth
* @date april 25 2013
*/
class ModPartActxDoelgroep extends MY_Model{
protected $tablename = 'tbPartActxDoelgroep';
function __construct(){
// parent::__construct();
//$models = array();
//$this->load->model($models);
}
function get_doelgroepen_per_act ($actID){
$this->sql = "SELECT d.id, d.omschrijving, a.id as padID
FROM tbPartActxDoelgroep a, tbDoelgroepen d
WHERE a.activiteitID ={$actID}
AND d.id = a.doelgroepID";
return $this->get_query_result();
}
function get_doelgroep($newID){
$this->sql = "SELECT d.id, d.omschrijving, a.id as padID
FROM tbPartActxDoelgroep a, tbDoelgroepen d
WHERE a.id ={$newID}
AND d.id = a.doelgroepID";
return $this->get_query_row();
}
function get_other_doelgroepen($actID){
$this->sql = "SELECT d.id, omschrijving
FROM tbDoelgroepen d
WHERE d.id not in (SELECT doelgroepID FROM tbPartActxDoelgroep a WHERE a.activiteitID = {$actID})";
return $this->get_query_result();
}
}