initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Mensen extends MY_controller {
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array('ijkpartituur/Modpartactiviteiten',
|
||||
'shared/Orgusers_model',
|
||||
'ijkpartituur/Modpartactxorgusers');
|
||||
$this->load->model($models);
|
||||
if ( ! $this->check_online_status() ) {
|
||||
echo json_encode( array('offline' => TRUE) );
|
||||
die;
|
||||
};// if
|
||||
}
|
||||
public function index(){
|
||||
}
|
||||
|
||||
public function getMensen(){
|
||||
if(!$this->userid) return;
|
||||
$mensen =$this->Orgusers_model->get_org_users($this->globorgid);
|
||||
if ($mensen) {
|
||||
foreach ($mensen as $mens){
|
||||
$mens->takenC = $this->Modpartactiviteiten->get_activiteiten_per_user($mens->id);
|
||||
$mens->takenU = $this->Modpartactxorgusers->get_activiteiten_per_user($mens->id);
|
||||
};
|
||||
};
|
||||
echo json_encode($mensen);
|
||||
}
|
||||
public function deleteVer(){
|
||||
if ($this->Autorisaties_model->check_autorisatie($this->userrole, WRITER) <= 0) return;
|
||||
$aID = $this->uri->segment(4);
|
||||
$wieID = $this->uri->segment(5);
|
||||
$wat = array('verantwoordelijke' => null);
|
||||
$this->Modpartactiviteiten->update_record($wat, $aID);
|
||||
$mens =$this->Orgusers_model->get_org_user($wieID);
|
||||
$mens->takenC = $this->Modpartactiviteiten->get_activiteiten_per_user($wieID);
|
||||
$mens->takenU = $this->Modpartactxorgusers->get_activiteiten_per_user($wieID);
|
||||
echo json_encode($mens);
|
||||
}
|
||||
public function deleteUit(){
|
||||
if ($this->Autorisaties_model->check_autorisatie($this->userrole, WRITER) <= 0) return;
|
||||
$aID = $this->uri->segment(4);
|
||||
$wieID = $this->uri->segment(5);
|
||||
$where =array('activiteitID' => $aID,
|
||||
'orguserID' =>$wieID);
|
||||
$this->Modpartactxorgusers->delete_record_where($where);
|
||||
$mens = $this->Orgusers_model->get_org_user($wieID);
|
||||
$mens->takenC = $this->Modpartactiviteiten->get_activiteiten_per_user($wieID);
|
||||
$mens->takenU = $this->Modpartactxorgusers->get_activiteiten_per_user($wieID);
|
||||
echo json_encode($mens);
|
||||
}
|
||||
} //einde class Mensen
|
||||
Reference in New Issue
Block a user