129 lines
3.7 KiB
PHP
129 lines
3.7 KiB
PHP
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class Diversiteit
|
|
{
|
|
private $CI;
|
|
private $swvid;
|
|
private $normaantallen =[];
|
|
private $schooljaar;
|
|
private $minnivo;
|
|
private $maxnivo;
|
|
private $groepen;
|
|
private $groep;
|
|
private $tijden;
|
|
private $vormen;
|
|
private $factoren ='';
|
|
private $diversiteit = [];
|
|
|
|
public function getDiversiteit(){
|
|
return $this->diversiteit;
|
|
}
|
|
|
|
public function __construct($orgversieid, $orgid, $modulenr){
|
|
$this->CI =& get_instance();
|
|
$this->schooljaarnr = $orgversieid;
|
|
$this->orgid = $orgid;
|
|
$this->modulenr = $modulenr;
|
|
$this->handle();
|
|
}
|
|
|
|
private function handle(){
|
|
|
|
$this->setSWVid();
|
|
$this->setMinnivo();
|
|
$this->setMaxnivo();
|
|
$this->setNormaantallen();
|
|
$this->setSchooljaar();
|
|
$this->setGroepen();
|
|
$this->loopGroepen();
|
|
$this->setOndersteuningsvormen();
|
|
$this->setCombifactoren();
|
|
$this->setDiversiteit();
|
|
}
|
|
|
|
private function setSWVid(){
|
|
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
|
|
}
|
|
|
|
private function setMinnivo(){
|
|
switch($this->modulenr){
|
|
case 2:
|
|
case 660: $this->minnivo = 1; break;
|
|
case 270: $this->minnivo = 5; break;
|
|
}
|
|
}
|
|
|
|
private function setMaxnivo(){
|
|
switch($this->modulenr){
|
|
case 2:
|
|
case 660: $this->maxnivo = 4; break;
|
|
case 270: $this->maxnivo = 8; break;
|
|
}
|
|
}
|
|
|
|
private function setNormaantallen(){
|
|
if($this->modulenr == 2 || $this->modulenr == 660) {
|
|
$regulier = $this->CI->Diversiteits_model->getnormaantallen($this->orgid, 'REGULIER');
|
|
$this->normaantallen = ['regulier' => $regulier];
|
|
}
|
|
if($this->modulenr == 270){
|
|
$sbo = $this->CI->Diversiteits_model->getnormaantallen($this->orgid, 'SBO');
|
|
$so = $this->CI->Diversiteits_model->getnormaantallen($this->orgid, 'SO');
|
|
$this->normaantallen =['sbo'=>$sbo, 'so' => $so];
|
|
|
|
}
|
|
}
|
|
|
|
private function setSchooljaar(){
|
|
$this->schooljaar = $this->CI->Schooljaren_model->get_fieldvalue(["schooljaarnr" => $this->schooljaarnr], "naam");
|
|
}
|
|
|
|
private function setGroepen(){
|
|
if($this->modulenr == 2 || $this->modulenr == 660) {
|
|
$this->groepen = $this->CI->Groepen_model->getgroepen(
|
|
$this->orgid, $this->schooljaarnr, $this->modulenr);
|
|
|
|
|
|
}
|
|
if($this->modulenr == 270) {
|
|
$this->groepen = $this->CI->Groepen_model->getgroepenSboSo(
|
|
$this->orgid, $this->schooljaarnr);
|
|
|
|
}
|
|
}
|
|
|
|
private function loopGroepen(){
|
|
if(!$this->groepen) return;
|
|
foreach($this->groepen as $this->groep) {
|
|
$this->getGroeptijden();
|
|
|
|
}
|
|
}
|
|
|
|
private function getGroeptijden()
|
|
{
|
|
$this->groep->tijden = $this->CI->Ondersteuningtijden_model->getgroeptijden($this->groep->id);
|
|
}
|
|
|
|
private function setOndersteuningsvormen(){
|
|
$this->vormen = $this->CI->Diversiteits_model->getosvormen(
|
|
$this->orgid, $this->schooljaarnr, $this->minnivo, $this->maxnivo, $this->modulenr);
|
|
}
|
|
|
|
private function setCombifactoren(){
|
|
if($this->modulenr == 270) return;
|
|
$this->factoren = $this->CI->Combifactoren_model->getfactoren($this->swvid);
|
|
}
|
|
|
|
private function setDiversiteit()
|
|
{
|
|
$this->diversiteit=[
|
|
'normaantallen' => $this->normaantallen,
|
|
'schooljaar' => $this->schooljaar,
|
|
'groepen' => $this->groepen,
|
|
'vormen' => $this->vormen,
|
|
'factoren' => $this->factoren
|
|
];
|
|
|
|
}
|
|
} |