initial commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Activiteiten x doelgroepen model
|
||||
*
|
||||
* @author Liesbeth
|
||||
* @date april 25 2013
|
||||
*/
|
||||
|
||||
class ModActDoel extends MY_Model{
|
||||
|
||||
protected $tablename = 'tbActxDoelgroep';
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
//$models = array();
|
||||
//$this->load->model($models);
|
||||
}
|
||||
function doelgroepen_per_activiteit($actID){
|
||||
$this->sql="SELECT d.id, d.omschrijving
|
||||
FROM tbActxDoelgroep a, tbDoelgroepen d
|
||||
WHERE a.activiteitID = {$actID}
|
||||
AND d.id = a.doelgroepID";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function doelgroepen_niet_in_activiteit($actID){
|
||||
$this->sql = "SELECT d.id, d.omschrijving
|
||||
FROM tbDoelgroepen d
|
||||
WHERE d.id NOT IN (SELECT doelgroepID FROM tbActxDoelgroep WHERE activiteitID = {$actID} )";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
function delete_link($actID, $hulpID){
|
||||
$this->sql = "DELETE FROM tbActxDoelgroep
|
||||
WHERE activiteitID = {$actID}
|
||||
AND doelgroepID = {$hulpID}";
|
||||
$this->db->query($this->sql);
|
||||
}
|
||||
function get_doelgroepen_per_act ($actID){
|
||||
$this->sql = "SELECT d.id, d.omschrijving, a.id as padID
|
||||
FROM tbActxDoelgroep a, tbDoelgroepen d
|
||||
WHERE a.activiteitID ={$actID}
|
||||
AND d.id = a.doelgroepID";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user