initial commit

This commit is contained in:
2021-07-10 16:25:16 +02:00
parent bff57cbf45
commit 20fb7267a8
2426 changed files with 792090 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
include MYROOTPATH."application/third_party/ChromePhp.php";
class Chromelogger {
private $enabled;
public function __construct()
{
}
public function setEnabled($status)
{
$this->enabled = $status;
}
public function log()
{
if( $this->enabled === FALSE ) return;
$args = func_get_args();
ChromePhp::log($args);
}
public function warn()
{
if( $this->enabled === FALSE ) return;
$args = func_get_args();
ChromePhp::warn($args);
}
public function error()
{
if( $this->enabled === FALSE ) return;
$args = func_get_args();
ChromePhp::error($args);
}
}
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,129 @@
<?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->CI->globorgid, $this->schooljaarnr, $this->modulenr);
}
if($this->modulenr == 270) {
$this->groepen = $this->CI->Groepen_model->getgroepenSboSo(
$this->CI->globorgid, $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->CI->globorgid, $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
];
}
}
@@ -0,0 +1,392 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class DiversiteitAfbeeldingen {
private $CI;
private $normaantallen;
private $normaantallensbo;
private $normaantallenso;
private $normaantal;
private $normtot =0;
private $schooljaar;
private $groepen;
private $groep;
private $vormen;
private $combifactor;
private $combifactoren;
private $deelfactoren;
private $deelfactor;
private $schoolfactor;
private $tijden;
private $tijd;
private $uur;
private $uur0;
private $minuut0;
private $string;
private $soort;
private $totminuten;
private $schoolminuten= 0;
private $schooltijdstring;
private $tottijd;
private $minuten;
private $totG = 0;
private $totS = 0;
private $totI = 0;
private $gtijd;
private $itijd;
private $stijd;
private $minuten1 = 0;
private $minuten2 = 0;
private $minuten3 = 0;
private $minuten4 = 0;
private $minuten5 = 0;
private $dagtijd1 = 0;
private $dagtijd2 = 0;
private $dagtijd3 = 0;
private $dagtijd4 = 0;
private $dagtijd5 = 0;
private $schoolsoort;
private $factorenTot = 0;
private $combis;
private $combi;
private $groep12;
private $groep38;
private $groepdiversiteit =0;
private $totaal = 0;
private $aantalgroepen = 0;
private $som1 =0;
private $som2 =0;
private $som3 =0;
private $som4 =0;
private $som5 =0;
private $som6 =0;
private $som7 =0;
private $som8 =0;
private $totdiversiteit;
private $somdq;
private $totdq;
private $diversiteitafbeeldingen =[];
public function __construct($diversiteit, $modulenr, $orgversieid){
$this->CI = & get_instance();
$this->modulenr = $modulenr;
$this->orgversieid = $orgversieid;
$this->diversiteit = $diversiteit;
$this->handle();
}
public function getDiversiteitAfbeeldingen(){
return $this->diversiteitafbeeldingen;
}
private function handle(){
$this->setNormaantallen();
$this->setSchooljaar();
$this->setGroepen();
$this->setOndersteuningsvormen();
$this->setFactoren();
$this->loopGroepen();
$this->setTotDiversiteit();
$this->setDQ();
$this->setDiversiteitAfbeeldingen();
}
private function setNormaantallen()
{
if($this->modulenr == 2 || $this->modulenr == 660) {
$this->normaantallen = $this->diversiteit['normaantallen']['regulier'];
}
if($this->modulenr == 270){
$this->normaantallensbo = $this->diversiteit['normaantallen']['sbo'];
$this->normaantallenso = $this->diversiteit['normaantallen']['so'];
}
}
private function setSchooljaar(){
$this->schooljaar = $this->diversiteit['schooljaar'];
}
private function setGroepen(){
$this->groepen = $this->diversiteit['groepen'];
}
private function setOndersteuningsvormen(){
$this->vormen = $this->diversiteit['vormen'];
}
private function setFactoren(){
if($this->diversiteit['factoren']) {
$this->combifactoren = $this->diversiteit['factoren'];
}
}
private function loopGroepen(){
if(!$this->groepen) return;
foreach ($this->groepen as $index => $this->groep){
$this->groep->totminuten = 0;
$this->groep->tottijd = 0;
$this->groep->minuten1 = 0;
$this->groep->minuten2 = 0;
$this->groep->minuten3 = 0;
$this->groep->minuten4 = 0;
$this->groep->minuten5 = 0;
$this->groep->dagtijd1 =0;
$this->groep->dagtijd2 =0;
$this->groep->dagtijd3 =0;
$this->groep->dagtijd4 =0;
$this->groep->dagtijd5 =0;
$this->groep->deelfactoren = 0;
$this->loopTijden();
$this->setGroepTijdstring();
$this->setSchoolMinuten();
$this->setSchoolTijdstring();
$this->setCombis();
$this->setDiversiteitfactor();
$this->setDiversiteitGroep();
$this->setSchoolFactor();
$this->setDeelfactor();
$this->setDiversiteitsquotient();
$this->setFactorenTotaal();
$this->setTotaal();
$this->telGroepen();
$this->setDQSom();
$this->telCombi();
$this->telSommen();
$this->telNormaantal();
}
}
private function loopTijden(){
if(!$this->groep->tijden) return;
foreach($this->groep->tijden as $this->tijd){
$this->setMinutenTotaal();
$this->setSoortTotaal();
$this->setTijdPerSoortString();
$this->setTijdStringPerdag();
}
}
private function setMinutenTotaal(){
$this->groep->totminuten = $this->groep->totminuten + $this->tijd->minuten;
}
private function setSoortTotaal(){
switch ($this->tijd->soort){
case 'G' : $this->totG= $this->totG + $this->tijd->minuten; break;
case 'S' : $this->totS= $this->totS + $this->tijd->minuten; break;
case 'I' : $this->totI= $this->totI+ $this->tijd->minuten; break;
}
}
private function setTijdStringPerDag(){
$this->groep->{'minuten' . $this->tijd->dagnr} = $this->groep->{'minuten' . $this->tijd->dagnr} + $this->tijd->minuten;
$dagminuten = $this->groep->{'minuten' . $this->tijd->dagnr};
$this->groep->{'dagtijd' . $this->tijd->dagnr} = $this->maakTijdstring($dagminuten);
}
private function setTijdPerSoortString(){
$this->gtijd = $this->maakTijdstring($this->totG);
$this->stijd = $this->maakTijdstring($this->totS);
$this->itijd = $this->maakTijdstring($this->totI);
}
private function setGroepTijdstring(){
$this->groep->tottijd= $this->maakTijdstring($this->groep->totminuten);
}
private function setSchoolMinuten(){
$this->schoolminuten = $this->schoolminuten + $this->groep->totminuten;
}
private function setSchoolTijdstring(){
$this->schooltijdstring = $this->maakTijdstring($this->schoolminuten);
}
private function maakTijdstring($inputminuten){
$this->uur = floor($inputminuten / 60);
$this->minuten = $inputminuten % 60;
$this->uur0 ='';
if ($this->uur < 10) $this->uur0='0';
$this->minuut0 ='';
if ($this->minuten < 10) $this->minuut0='0';
$this->string = $this->uur0.$this->uur.':'.$this->minuut0.$this->minuten;
return $this->string;
}
private function setCombis(){
$array = explode(';', $this->groep->niveau);
$this->combis = count($array);
}
private function setDiversiteitfactor(){
$this->combifactor = 0;
if($this->modulenr == 270) return;
if($this->combis == 2){
$this->combifactor= $this->combifactoren->combi2;
}
if($this->combis >2){
$this->combifactor = $this->combifactoren->combi3;
}
}
private function setDiversiteitGroep(){
if($this->modulenr == 2 || $this->modulenr == 660) {
$diversiteit = $this->groep->som1 + (1.5 * $this->groep->som2) +
(2 * $this->groep->som3) + (4 * $this->groep->som4);
if($diversiteit == 0){
$this->groep->groepdiversiteit = 0;
}
else {
$this->groep->groepdiversiteit =
$diversiteit +
$this->combifactor;
}
}
if($this->modulenr == 270) {
$diversiteit =
(2* $this->groep->som5) + (3 * $this->groep->som6) +
(4 * $this->groep->som7) + (5 * $this->groep->som8);
if($diversiteit == 0){
$this->groep->groepdiversiteit = 0;
}
else {
$this->groep->groepdiversiteit =
$diversiteit;
}
}
}
private function setSchoolFactor(){
if($this->modulenr == 270) return;
if($this->groep->groepdiversiteit == 0) return;
$this->schoolfactor = $this->schoolfactor + $this->combifactor;
}
private function setDeelfactor(){
$this->normaantal = new stdClass();
if($this->modulenr== 2 || $this->modulenr == 660) {
$this->normaantal->deelfactor = $this->normaantallen->groep38;
if (strpos($this->groep->niveau,'1') !== false || strpos($this->groep->niveau,'2') !== false) {
$this->normaantal->deelfactor = $this->normaantallen->groep12;
};
}
if($this->modulenr == 270){
if($this->groep->totaantal ==0){
$this->normaantal->deelfactor = 0;
return;
}
$this->normaantal->deelfactorsbo = $this->normaantallensbo->groep38;
if (strpos($this->groep->niveau,'1') !== false || strpos($this->groep->niveau,'2') !== false) {
$this->normaantal->deelfactorsbo = $this->normaantallensbo->groep12;
};
$this->normaantal->deelfactorso = $this->normaantallenso->groep38;
if (strpos($this->groep->niveau,'1') !== false || strpos($this->groep->niveau,'2') !== false) {
$this->normaantal->deelfactorso = $this->normaantallenso->groep12;
};
$this->normaantal->deelfactor = (($this->groep->som5 / $this->groep->totaantal) * $this->normaantal->deelfactorsbo) +
(($this->groep->totaantal - $this->groep->som5) / $this->groep->totaantal) * $this->normaantal->deelfactorso;
}
}
private function setDiversiteitsquotient(){
$this->groep->deelfactoren = $this->groep->deelfactoren + $this->normaantal->deelfactor;
if($this->groep->deelfactoren > 0) {
$this->groep->dq = round(($this->groep->groepdiversiteit / $this->groep->deelfactoren), 2);
}
}
private function setFactorenTotaal(){
$this->factorenTot = $this->factorenTot + $this->groep->deelfactoren;
}
private function setTotaal(){
$this->totaal =
$this->totaal + $this->groep->totaantal;
}
private function telGroepen(){
if($this->groep->totaantal > 0) {
$this->aantalgroepen = $this->aantalgroepen + 1;
}
}
private function setDQSom(){
if($this->aantalgroepen > 0) {
$this->somdq = $this->somdq+ $this->groep->dq;
}
}
private function telCombi(){
if($this->modulenr == 270) return;
if (strpos($this->groep->niveau, ';') > 0){
$this->combi = $this->combi + 1;}
}
private function telSommen(){
for($i =1; $i <= 8; $i++) {
if (isset($this->groep->{'som'.$i})) {
$this->{'som' . $i} = $this->{'som' . $i} + $this->groep->{'som' . $i};
}
}
}
private function telNormaantal(){
$this->normtot = $this->normtot + $this->normaantal->deelfactor;
}
private function setTotDiversiteit(){
if($this->modulenr == 2 || $this->modulenr == 660) {
$this->totdiversiteit = $this->som1 + (1.5 * $this->som2) + (2 * $this->som3) + (4 * $this->som4) + $this->schoolfactor;
}
if($this->modulenr == 270){
$this->totdiversiteit = (2* $this->som5) + (3 * $this->som6) + (4 * $this->som7) + (5 * $this->som8) + $this->schoolfactor;
}
}
private function setDQ(){
$this->totdq = 0;
if($this->aantalgroepen > 0 && $this->factorenTot > 0) {
// $this->totdq = round(($this->somdq / $this->aantalgroepen), 2); Deze kun je wel beter narekenen
if($this->modulenr == 2 || $this->modulenr == 660) {
$this->totdq = $this->totdiversiteit / $this->factorenTot;
}
if($this->modulenr == 270){
$this->totdq = round(($this->somdq / $this->aantalgroepen), 2);
}
}
}
private function setDiversiteitAfbeeldingen(){
$this->diversiteitafbeeldingen =[
'schooljaar' => $this->schooljaar,
'schooltijdstring' => $this->schooltijdstring,
'totaal' => $this->totaal,
'osvormen' => $this->vormen,
'groepen' => $this->groepen,
'aantalgroepen' => $this->aantalgroepen,
'schooldq' => $this->totdq,
'totdq' => $this->totdq,
'combi' => $this->combi,
'som1' => $this->som1,
'som2' => $this->som2,
'som3' => $this->som3,
'som4' => $this->som4,
'som5' => $this->som5,
'som6' => $this->som6,
'som7' => $this->som7,
'som8' => $this->som8,
'gtijd' => $this->gtijd,
'stijd' => $this->stijd,
'itijd' => $this->itijd,
'totdiversiteit' => $this->totdiversiteit,
'normtot' => $this->normtot,
'normaantallen' => $this->normaantallen
];
}
}
@@ -0,0 +1,191 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class GemiddeldeScores
{
private $CI;
private $ijkpunten;
private $ijkpunt;
private $leerkrachten;
private $leerkracht;
private $scores = [];
private $score;
private $wensen;
private $aantalY;
private $scoreteller;
private $slaover = false;
private $ambities;
private $gemiddeldescores;
public function __construct($orgversieid, $orgid)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->handle();
}
public function getGemiddeldeScores()
{
return $this->gemiddeldescores;
}
public function getLeerkrachten()
{
return $this->leerkrachten;
}
public function getAantalLeerkrachten()
{
return count($this->leerkrachten);
}
public function getAmbities()
{
return $this->ambities;
}
public function getIJkpunten()
{
return $this->ijkpunten;
}
public function getWensen()
{
return $this->wensen;
}
private function handle()
{
$this->setIJkpunten();
$this->setLeerkrachten();
$this->setLeerkrachtScores();
$this->telIJkpunten();
$this->loopIJkpunten();
$this->setAmbities();
$this->setWensen();
$this->setGemiddeldeScores();
}
private function setIJkpunten()
{
$this->ijkpunten = $this->CI->Orgversies_model->getijkpunten($this->orgversieid);
}
private function setLeerkrachten()
{
$this->leerkrachten = $this->CI->Filledversions_model->getlks($this->orgid, $this->orgversieid);
}
private function setLeerkrachtScores()
{
if (!$this->leerkrachten) return;
foreach ($this->leerkrachten as $index => $this->leerkracht) {
$this->leerkracht->scores = $this->CI->Scores_model->calculateindividualscores(
$this->orgversieid, $this->orgid, $this->leerkracht->user_id);
}
}
private function telIJkpunten()
{
if ($this->ijkpunten) {
$this->aantalY = count($this->ijkpunten);
}
}
private function loopIJkpunten()
{
foreach ($this->ijkpunten as $index => $this->ijkpunt) {
$this->ijkpunt->totaal = 0;
$this->ijkpunt->aantallkrtn = 0;
$this->loopLeerkrachten();
$this->setIJkpuntGemiddeldeScores();
}
}
private function loopLeerkrachten()
{
if (!isset($this->leerkrachten) || !$this->leerkrachten) return;
foreach ($this->leerkrachten as $this->leerkracht) {
$this->slaover = false;
$this->scoreteller = 0;
$this->loopLeerkrachtScores();
$this->setVoldoendeAantal();
}
}
private function loopLeerkrachtScores()
{
if (!isset($this->leerkracht->scores) || $this->leerkracht->scores == false) return;
$this->scoreteller = 0;
foreach ($this->leerkracht->scores as $index => $this->score) {
$this->setAantalScores();
if ($this->slaover == false) {
$this->setIJkpuntTotaal();
}
}
}
private function setAantalScores(){
if (!isset($this->leerkracht->scores) || $this->leerkracht->scores == false) return;
if($this->score->num > 0){
$this->scoreteller++;
}
}
private function setIJkpuntTotaal()
{
if ($this->score->nummer == $this->ijkpunt->nummer) {
if ($this->score->num > 0) {
$lkrtscore = $this->score->somscore / $this->score->num;
$this->ijkpunt->totaal = $this->ijkpunt->totaal + $lkrtscore;
$this->ijkpunt->aantallkrtn++;
$this->slaover = true;
}
}
}
private function setVoldoendeAantal(){
if (!isset($this->leerkracht->scores) || $this->leerkracht->scores == false) return;
if ($this->scoreteller < 5){
$this->leerkrachtscores = false;
}
}
private function setIJkpuntGemiddeldeScores()
{
if ($this->ijkpunt->aantallkrtn > 0) {
$this->ijkpunt->score = $this->ijkpunt->totaal / $this->ijkpunt->aantallkrtn;
}
}
private function setAmbities()
{
$this->ambities = $this->CI->Ambities_model->getOrgAmbities($this->orgversieid, $this->orgid);
}
private function setWensen()
{
$this->wensen = $this->CI->Wenssituaties_model->getgewenst($this->orgversieid, $this->orgid);
}
private function setGemiddeldeScores()
{
$this->gemiddeldescores = [
"ijkpunten" => $this->ijkpunten,
"leerkrachten" => $this->leerkrachten,
"ambities" => $this->ambities,
"wensen" => $this->wensen
];
}
}
@@ -0,0 +1,388 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class GemiddeldenAfbeeldingen {
private $CI;
private $swvid;
private $leerkrachten;
private $ijkpunten;
private $ijkpunt;
private $omschrijving;
private $aantalY;
private $somscore = 0;
private $aantalscores = 0;
private $score;
private $wensen;
private $wens;
private $ambities;
private $adviezen = [];
private $labels;
private $kleuren;
private $kleurcodes;
private $orgversie;
private $vantm;
private $gemiddelde;
private $nummer;
private $ijkpuntenok = 0;
private $welkehoogste = 0;
private $hoogstescore = -1;
private $welkelaagste = 0;
private $laagstescore = 101;
private $rij = 708;
private $standaardorg = 250;
private $aantal = 15;
private $resultaten;
private $kolombreedte;
private $orgbreedte;
private $gemiddeldenafbeeldingen;
public function __construct(GemiddeldeScores $gemiddeldescores, $modulenr, $orgversieid, $clusterid, $orgid){
$this->CI = & get_instance();
$this->gemiddeldescores = $gemiddeldescores;
$this->modulenr = $modulenr;
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->clusterid = $clusterid;
$this->setLeerkrachten();
$this->setOrgversie();
$this->setAmbities();
$this->setIJkpunten();
$this->setWensen();
$this->handle();
}
public function getGemiddeldenAfbeeldingen(){
return $this->gemiddeldenafbeeldingen;
}
public function getAantalScores(){
return $this->aantalscores;
}
public function getIJkpunten(){
return $this->ijkpunten;
}
public function getAdviezen(){
return $this->adviezen;
}
public function getResultaten(){
$this->resultaten = [
'totgem' => $this->gemiddelde->score,
'ijkpuntenok' => $this->ijkpuntenok,
'welkehoogste' => $this->welkehoogste,
'hoogstescore' => round($this->hoogstescore, 1),
'welkelaagste' => $this->welkelaagste,
'laagstescore' => round($this->laagstescore, 1),
];
return $this->resultaten;
}
public function getKleuren(){
return $this->kleuren;
}
private function setLeerkrachten(){
$this->leerkrachten = $this->gemiddeldescores->getLeerkrachten();
}
private function setOrgversie(){
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
}
private function setAmbities(){
$this->ambities = $this->gemiddeldescores->getAmbities();
}
private function setIJkpunten(){
$this->ijkpunten = $this->gemiddeldescores->getIJKpunten();
}
private function setWensen(){
$this->wensen = $this->gemiddeldescores->getWensen();
}
private function handle(){
$this->setSwvid();
$this->setLabels();
$this->telIJkpunten();
$this->setPeriode();
$this->setKleurcodes();
$this->setKleuren();
$this->loopIJkpunten();
$this->loopIJkpunten2(); // verplaatst boven addGemiddelde score omdat je anders een "ijkpunt" te veel hebt
// moet hier niet eerst setGemiddelde worden gedaan?
$this->setGemiddeldeScore();
$this->addGemiddeldeScore();
$this->setGemiddeldenAfbeeldingen();
}
private function setSwvid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setLabels(){
$this->labels = $this->CI->Labels_model->getalllabels($this->modulenr);
if(! $this->labels){
$this->labels = $this->CI->Labels_model->getalllabels(1);
}
}
private function telIJkpunten(){
if($this->ijkpunten){
$this->aantalY = count($this->ijkpunten);
}
}
private function setPeriode(){
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
$this->vantm = "Gegevens uit periode ".$this->orgversie->periodenummer." van ".
mysql2date($this->orgversie->geldigvanaf)." t/m ".mysql2date($this->orgversie->geldigtm);
}
private function setKleurcodes(){
$this->kleurcodes = new Kleurcodes();
}
private function setKleuren(){
// $this->kleuren = $this->kleurcodes->getKleurcodesOrg($this->clusterid, $this->swvid);
// $this->CI->firephp->log($this->kleuren, "kleuren");
// if(!$this->kleuren || $this->kleuren == " "){
$this->kleuren = new stdClass();
$this->kleuren->cluster_id = $this->clusterid;
$this->kleuren->grens1 = '60';
$this->kleuren->grens2 = '80';
$this->kleuren->grens3 = '90';
$this->kleuren->grens4 = '100';
if($this->orgversie->scoretype == 7){
$this->kleuren->grens1 = '33';
$this->kleuren->grens2 = '66';
$this->kleuren->grens3 = '100';
}
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
$this->kleuren->organisatie_id = '0';
// }
}
private function loopIJkpunten(){
foreach($this->ijkpunten as $index =>$this->ijkpunt){
if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score) {continue;};
$this->telScoresOp();
$this->setAantalScores();
}
$this->setGemiddeldeScore(); // gemiddelde ga je niet in de loop berekenen
}
private function telScoresOp(){
$this->somscore = $this->somscore + $this->ijkpunt->score;
}
private function setAantalScores(){
if(!$this->ijkpunt->score) return;
$this->aantalscores++;
}
private function getKleur ($score){
$grensnummer = 1;
if ($score>= $this->kleuren->grens1) $grensnummer = 2;
if ($score>= $this->kleuren->grens2) $grensnummer = 3;
if ($score>= $this->kleuren->grens3) $grensnummer = 4;
switch ( $grensnummer) {
case 1:
$kleur = $this->kleuren->kleur1;
break;
case 2:
$kleur = $this->kleuren->kleur2;
break;
case 3:
$kleur = $this->kleuren->kleur3;
break;
case 4:
$kleur = $this->kleuren->kleur4;
break;
default:
$kleur = $this->kleuren->kleur1;
}
return $kleur;
}
private function setGemiddeldeScore(){
$this->gemiddelde = new stdClass();
$this->gemiddelde->score = 0;
if ($this->aantalscores > 0) {
$this->gemiddelde->score = round($this->somscore / $this->aantalY);
}
$this->gemiddelde->nummer = 'gem';
$this->gemiddelde->kleur =$this->getKleur ($this->gemiddelde->score);
$this->ijkpunt = $this->gemiddelde;
}
private function addGemiddeldeScore(){
if(! $this->gemiddelde) return;
array_push($this->ijkpunten, $this->ijkpunt);
}
private function loopIJkpunten2(){
if(!$this->ijkpunten) return;
foreach($this->ijkpunten as $index => $this->ijkpunt){
if(!isset($this->ijkpunt->score)){continue;};
if(! $this->ijkpunt->score) $this->ijkpuntscore = 0;
$this->setScorenummer();
$this->rondScoresAf();
$this->setScoreKleuren();
$this->addGewensteScores($index);
$this->setWenskleuren();
$this->setAdvies();
$this->setResultatenOverzicht();
$this->telIJkpuntenok();
}
}
private function setScoreNummer(){
if($this->orgversie->scoretype != 7) {
$this->ijkpunt->huidig = 1;
if ($this->ijkpunt->score >= $this->kleuren->grens1) $this->ijkpunt->huidig = 2;
if ($this->ijkpunt->score >= $this->kleuren->grens2) $this->ijkpunt->huidig = 3;
if ($this->ijkpunt->score >= $this->kleuren->grens3) $this->ijkpunt->huidig = 4;
}
if($this->orgversie->scoretype == 7){
if ($this->ijkpunt->score == $this->kleuren->grens3) $this->ijkpunt->huidig = 4;
if ($this->ijkpunt->score < $this->kleuren->grens3) $this->ijkpunt->huidig = 3;
if ($this->ijkpunt->score <= $this->kleuren->grens2) $this->ijkpunt->huidig = 2;
if ($this->ijkpunt->score <= $this->kleuren->grens1) $this->ijkpunt->huidig = 1;
}
}
private function rondScoresAf(){
$this->ijkpunt->score = round($this->ijkpunt->score);
}
private function setScoreKleuren(){
switch ($this->ijkpunt->huidig) {
case 1:
$this->ijkpunt->kleur = $this->kleuren->kleur1;
break;
case 2:
$this->ijkpunt->kleur = $this->kleuren->kleur2;
break;
case 3:
$this->ijkpunt->kleur = $this->kleuren->kleur3;
break;
case 4:
$this->ijkpunt->kleur = $this->kleuren->kleur4;
break;
default:
$this->ijkpunt->kleur = $this->kleuren->kleur1;
}
}
private function addGewensteScores($index)
{
$this->ijkpunt->wens = 3;
if (isset($this->wensen) && $this->wensen[$index] ) {
$this->ijkpunt->wens = $this->wensen[$index]->wens;
}
}
private function setWensKleuren(){
if(!isset($this->ijkpunt->wens)) return;
switch ($this->ijkpunt->wens) {
case 1:
$this->ijkpunt->wenskleur = $this->kleuren->kleur1;
break;
case 2:
$this->ijkpunt->wenskleur = $this->kleuren->kleur2;
break;
case 3:
$this->ijkpunt->wenskleur = $this->kleuren->kleur3;
break;
case 4:
$this->ijkpunt->wenskleur = $this->kleuren->kleur4;
break;
default:
$this->ijkpunt->wenskleur = '#ffffff';
}
}
private function setAdvies(){
if(isset($this->ijkpunt->wens) && $this->ijkpunt->huidig < $this->ijkpunt->wens &&
$this->ijkpunt->huidig != 0 && $this->ijkpunt->wens!= 0 && isset($this->ijkpunt->omschrijving)){
array_push($this->adviezen, [
"nummer"=> $this->ijkpunt->nummer,
"omschrijving" =>$this->ijkpunt->omschrijving
]);
}
}
private function setResultatenOverzicht()
{
if ($this->ijkpunt->score > $this->hoogstescore) {
$this->hoogstescore = $this->ijkpunt->score;
$this->welkehoogste = $this->ijkpunt->nummer;
}
if ($this->ijkpunt->score <= $this->laagstescore) {
$this->laagstescore = $this->ijkpunt->score;
$this->welkelaagste = $this->ijkpunt->nummer;
}
}
private function telIJkpuntenok(){
if ($this->ambities && $this->ijkpunt->score >= $this->ambities->zprocent && $this->ijkpunt->nummer!= 'gem') {
$this->ijkpuntenok++;
}
}
private function setKolombreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$kolombreedte = floor(($this->rij - $this->standaardorg)/$this->aantal);
$this->kolombreedte = $kolombreedte . 'px';
}
private function setOrgbreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$orgbreedte = floor($this->rij - ($this->aantal * $this->kolombreedte));
$this->orgbreedte = $orgbreedte . 'px';
}
private function setGemiddeldenAfbeeldingen(){
$this->gemiddeldenafbeeldingen = [
"module" => $this->modulenr,
"leerkrachten" => $this->leerkrachten,
"labels" => $this->labels,
"kleuren" => $this->kleuren,
"vantm" => $this->vantm,
"ambitie" => $this->ambities,
"adviezen" => $this->adviezen,
"ijkpunten" => $this->ijkpunten,
'ijkpuntenok' => $this->ijkpuntenok,
'welkehoogste' => $this->welkehoogste,
'hoogstescore' => round($this->hoogstescore,1),
'welkelaagste' => $this->welkelaagste,
'laagstescore' => round($this->laagstescore,1),
"aantalY" => $this->aantalY,
"totgem" => $this->gemiddelde->score,
"orgbreedte" => $this->orgbreedte,
"kolombreedte" => $this->kolombreedte,
"aantalscores" => $this->aantalscores
];
}
}
+190
View File
@@ -0,0 +1,190 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Hoofdstuk
{
private $content;
private $hoofdstukkeuze;
private $volgorde;
private $views;
private $orgversie;
private $versie;
private $labels;
private $label;
private $sopkeuze;
private $view;
private $tab;
//private $imagecode;
private $tabelid;
private $imagedata;
private $vervangingscode;
private $contentid;
private $hoofdstuk;
private $CI;
public function __construct($chapterid, $profielid, $orgversieid = false)
{
$this->CI =& get_instance();
$this->chapterid = $chapterid;
$this->orgversieid = $orgversieid;
$this->profielid = $profielid;
$this->handle();
}
private function handle()
{
$this->setTekst();
$this->setHoofdstukKeuze();
$this->setSchool();
$this->setVersie();
$this->setSopKeuze();
$this->setLabels();
$this->setVolgordeInleiding();
$this->setVolgordeHoofdstukken();
$this->getViews();
$this->loopViews();
$this->saveContent();
}
private function setTekst(){
$this->content = $this->CI->Standaardteksten_model->get_fieldvalue(
["soort" => 1, "chapter_id" => $this->chapterid], 'content');
}
private function setHoofdstukKeuze(){
$hoofdstukkeuze =
new HoofdstukKeuze($this->chapterid, $this->orgversieid);
$this->hoofdstukkeuze = $hoofdstukkeuze->getHoofdstukKeuze();
}
private function setSchool(){
if( !($this->hoofdstukkeuze['data']) ) return;
$this->hoofdstukkeuze['data']['school'] = $this->CI->Organisaties_model->get_record_by_id($this->CI->globorgid);
}
private function setVersie(){
if( !($this->hoofdstukkeuze['data'])) return;
if(! isset($this->orgversieid) || $this->orgversieid == "" || $this->orgversieid == null || $this->orgversieid ==0) return;
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
$this->versie = $this->CI->Versies_model->get_record_by_id($this->orgversie->versie_id);
$this->versie->naam = $this->versie->naam . ', periode: ' . $this->orgversie->periodenummer . ':
' . $this->orgversie->geldigvanaf . ' - ' . $this->orgversie->geldigtm;
$this->hoofdstukkeuze['data']['versie'] = $this->versie;
}
private function setSopKeuze(){
$this->sopkeuze = new SopKeuze($this->profielid);
}
private function setLabels(){
$this->labels = $this->sopkeuze->getHoofdstukLabels();
}
private function setVolgordeInleiding()
{
if ($this->hoofdstukkeuze['soort'] != 'INLEIDING') return;
$this->volgorde = 10;
}
private function setVolgordeHoofdstukken() {
if ($this->hoofdstukkeuze['soort'] === 'INLEIDING') return;
if(!$this->labels){
$this->volgorde = 20;}
if($this->labels){
$hoogste = 0;
foreach ($this->labels as $this->label) {
if($this->label->volgorde > $hoogste){
$hoogste = $this->label->volgorde;
}
}
$this->volgorde = $hoogste + 10;
}
}
private function getViews(){
$this->views = $this->CI->Sopviews_model->get_records_where(
['soort' =>$this->hoofdstukkeuze['soort']]);
}
private function loopViews(){
if(! $this->views) return;
if( !($this->hoofdstukkeuze['data']) ) return;
foreach ($this->views as $index => $this->view) {
$this->loadView($index);
$this->maakAfbeelding($index);
$this->plaatsAfbeelding();
}
}
private function loadView($index){
$pad = $this->view->pad;
$this->view->tab = $this->CI->load->view("monpas/sopkeuze/" . $pad, ['data' => $this->hoofdstukkeuze['data']], TRUE);
}
private function maakAfbeelding($index){
if ($this->view->type != 'GRA') return;
//ls okt 2020 if(!$this->view->imagecode) return;
if(!$this->view->tabelid) return;
$this->view->grafiek = $this->CI->Phantom_model->create_img($this->view->tab, 'test', FALSE, FALSE, array(650, 0));
//ls okt 2020 $this->imagedata = "<img src='data:image/png;base64," . $this->view->grafiek ."' id='" . $this->view->imagecode . "' />";
$this->imagedata = "<img src='data:image/png;base64," . $this->view->grafiek ."' id='" . $this->view->tabelid . "' />";
}
private function plaatsAfbeelding()
{
$afbeelding = "";
$vervang = $this->view->vervangingscode;
if (strpos($this->content, $vervang)) {
$lengte = strlen($vervang);
$pos = strpos($this->content, $vervang);
if($this->view->type === 'GRA'){
$afbeelding = $this->imagedata;
}
if($this->view->type === 'TAB'){
$afbeelding = $this->view->tab;
}
if ($afbeelding == "") return;
$this->content = substr_replace($this->content, $afbeelding, $pos, $lengte);
}
}
private function saveContent(){
if( !($this->hoofdstukkeuze['data'])) return false;
$this->hoofdstuk = array( 'profiel_id' => $this->profielid,
'chapter_id' => $this->chapterid,
'content' => $this->content,
'orgversieid' => $this->orgversieid,
'volgorde' => $this->volgorde);
$oldID = $this->CI->Sopinhouden_model->get(['profiel_id' => $this->profielid, 'chapter_id'=> $this->chapterid], 'id' , true) ;
if ($oldID){
$this->CI->Sopinhouden_model->update_record($this->hoofdstuk, $oldID);
} else {
$this->CI->Sopinhouden_model->insert_record($this->hoofdstuk);
}
}
}
@@ -0,0 +1,218 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class HoofdstukKeuze
{
private $modulenr;
private $modulenaam;
private $clusterid;
private $orgid;
private $vergelijkingid;
private $scorevorm;
private $vorm;
private $data;
private $soort;
private $vergelijking;
private $hoofdstukkeuze = [];
private $selectie;
private $selecties = [];
private $CI;
public function __construct($chapterid, $orgversieid= false, $vergelijkingen)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->chapterid = $chapterid;
$this->vergelijkingen = $vergelijkingen;
$this->handle();
}
public function getHoofdstukKeuze(){
return $this->hoofdstukkeuze;
}
private function handle()
{
$this->setModuleNr();
$this->setModule();
$this->setClusterID();
$this->setOrgID();
$this->setScorevorm();
$this->setInleiding();
$this->checkModulenummer();
$this->checkClusterID();
$this->setHoofdstukKeuze();
}
private function setModuleNr(){
$this->modulenr =
$this->CI->Hoofdstukken_model->get_fieldvalue(['id'=>$this->chapterid], 'module');
}
private function setModule(){
$this->modulenaam =
$this->CI->Modules_model->get_fieldvalue(
['sysnr'=>$this->modulenr],"naam");
}
private function setClusterID()
{
if ($this->modulenr == 0) return $this->clusterid = FALSE;
$this->clusterid =
$this->CI->Modules_model->get_fieldvalue(
['sysnr' => $this->modulenr], 'cluster_id');
}
private function setOrgID(){
$this->orgid = $this->CI->globorgid;
}
private function setScorevorm(){
if($this->chapterid == 49) return;
$this->scorevorm =
$this->CI->Orgversies_model->get_fieldvalue( ['id' => $this->orgversieid ],'vorm');
}
private function setSelecties(){
$this->selectie = [
'orgversieid' => $this->orgversieid,
'vorm' => $this->scorevorm
];
$this->selecties [] = $this->selectie;
if($this->vergelijkingen){
foreach($this->vergelijkingen as $index => $this->vergelijking){
$this->vergelijkingid = intval($this->vergelijking);
$this->vorm = $this->CI->Orgversies_model->get_fieldvalue( ['id' => $this->vergelijkingid ],'vorm');
$this->selectie = ['orgversieid' => $this->vergelijkingid,
'vorm' => $this->vorm
];
$this->selecties [] = $this->selectie;
}
}
}
private function setInleiding(){//hoofdstukken die niet bij een module/instrument horen
if( $this->chapterid != 1 && $this->chapterid != 49) return;
$this->data = (new Inleiding($this->orgid))->getInleiding();
$this->soort = 'INLEIDING';
}
/**
*
*/
private function checkModulenummer()//hoofstukken bij een instrument dat niet bij een cluster is ingedeeld
{
if ($this->clusterid != 0 && $this->clusterid != 7 && $this->clusterid != 10 && $this->clusterid != 11) return;
if ($this->modulenr == 0) return;
return $this->setSchoolScores();
// else {
// //aanvullen databases lokaal & productie komen niet helemaal overeen lijkt het uitzoeken
// }
}
private function checkClusterID(){//hoofdstukken bij een instrument dat tot een cluster behoort
if(!$this->clusterid) return;
if ($this->clusterid == 1 || $this->clusterid ==7 ) return;// (1)partituren (7) framwork monitoren, Niet in Sop
if( $this->clusterid == 2 ||
$this->clusterid == 3 ||
$this->clusterid == 5 ||
$this->clusterid == 8 ||
$this->clusterid == 13||
$this->clusterid == 14) {
$this->setSchoolScores();
}// (2) tevredenheidsmeters, (3) competentiemeters,(5) expertise scans. Heeft voor alle weergaven scores nodig
if($this->clusterid == 4){
$this->setInspectieOordelen();
}
if($this->clusterid == 6) {
// return $this->setFinancien();
}
if($this->clusterid == 9){
$this->setDiversiteit();
}
}
private function setSchoolScores(){
$this->setSchoolSoort();
$this->setSelecties();
$this->setLijsten();
$lijsten = new Lijsten($this->orgid, $this->selecties);
$this->data = $lijsten->getSopInfo() ;
}
private function setLijsten(){
$lijsten = new Lijsten($this->orgid, $this->selecties);
$this->data = $lijsten->getSopInfo() ;
}
private function setSchoolSoort(){
if($this->scorevorm == 1) {
$this->soort = 'REGULIER';
}
if($this->scorevorm == 2){
$this->soort = 'GEMIDDELD';
}
}
private function setInspectieOordelen()
{
$inspectieOordelen =
(new InspectieOordelen($this->orgversieid, $this->orgid, $this->clusterid))->getInspectieOordelen();
$inspectieAfbeeldingen =
(new InspectieAfbeeldingen($inspectieOordelen, $this->modulenr, $this->orgversieid, $this->orgid))
->getInspectieAfbeeldingen();
$this->data = $inspectieAfbeeldingen;
$this->soort = 'INSPECTIE';
}
private function setDiversiteit(){
$diversiteit
= (new Diversiteit($this->orgversieid, $this->orgid, $this->modulenr))->getDiversiteit();
$diversiteitAfbeeldingen
= (new DiversiteitAfbeeldingen($diversiteit, $this->modulenr, $this->orgversieid))->getDiversiteitAfbeeldingen();
$this->data = $diversiteitAfbeeldingen;
if($this->modulenr == 2 || $this->modulenr == 660)
$this->soort = 'DIVERSITEIT';
if($this->modulenr == 270){
$this->soort ='DIVSBOSO';
}
}
private function setFinancien(){
$financien = (new Financien($this->orgversieid, $this->orgid))->getFinancien();
$financienAfbInfo = (new FinancienAfbInfo($financien, $this->modulenr, $this->orgversieid))->getFinancienAfbInfo() ;
$this->data = $financienAfbInfo;
$this->soort ='FINANCIEEL';
}
private function addModule(){
if(! $this->data) return;
array_push($this->data, ['module' =>$this->modulenaam]);
}
private function setHoofdstukKeuze()
{
$this->hoofdstukkeuze = ['data' => $this->data,
'soort' => $this->soort];
}
}
@@ -0,0 +1,68 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Inleiding
{
private $CI;
private $school;
private $naam;
private $schoolnaam;
private $details;
private $bg;
private $valtonder_id;
private $bgid;
private $inleiding;
public function __construct($orgid)
{
$this->CI =& get_instance();
$this->orgid = $orgid;
$this->handle();
}
public function getInleiding()
{
return $this->inleiding;
}
private function handle()
{
$this->setSchool();
$this->setSchoolNaam();
$this->setSchoolDetails();
$this->setBGid();
$this->setBGNaam();
$this->setInleiding();
}
private function setSchool(){
$this->school = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
}
private function setSchoolNaam(){
$this->schoolnaam = $this->school->naam;
}
private function setSchoolDetails(){
$this->details = $this->CI->Schooldetails_model->get_details($this->orgid);
}
private function setBGid(){
$this->bgid = $this->school->valtonder_id;
}
private function setBGNaam(){
$this->bg = $this->CI->Organisaties_model->get_fieldvalue(["id" => $this->bgid], "naam");
}
private function setInleiding(){
$this->inleiding = [
"bevoegdgezag" => $this->bg,
"schoolnaam" => $this->schoolnaam,
"details" => $this->details
];
}
}
@@ -0,0 +1,190 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class InspectieAfbeeldingen {
private $CI;
private $oordelen;
private $oordeel;
private $wensid;
private $labels;
private $swvid;
private $kleurcodes;
private $kleuren;
private $adviezen =[];
private $orgversie;
private $ijkpunten;
private $aantalY = 0;
private $rij = 708;
private $standaardorg = 250;
private $aantal = 15;
private $kolombreedte;
private $orgbreedte;
private $vantm;
private $inspectieafbeeldingen;
public function __construct($inspectieOordelen, $modulenr, $orgversieid, $orgid){
$this->CI = & get_instance();
$this->modulenr = $modulenr;
$this->orgversieid = $orgversieid;
$this->inspectieoordelen = $inspectieOordelen;
$this->orgid = $orgid;
$this->clusterid = 4;
$this->handle();
}
public function getInspectieAfbeeldingen(){
return $this->inspectieafbeeldingen;
}
private function handle(){
$this->setOordelen();
$this->setIJkpunten();
$this->telIJkpunten();
$this->setSWVid();
$this->setLabels();
$this->setKleurcodes();
$this->setKleuren();
$this->setPeriode();
$this->loopOordelen();
$this->setKolombreedte();
$this->setOrgbreedte();
$this->setInspectieAfbeeldingen();
}
private function setOordelen(){
$this->oordelen = $this->inspectieoordelen['oordelen'];
}
private function setIJkpunten(){
$this->ijkpunten = $this->inspectieoordelen['ijkpunten'];
}
private function telIJkpunten(){
if($this->ijkpunten){
$this->aantalY = count($this->ijkpunten);
}
}
private function setSWVid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setLabels(){
$this->labels = $this->CI->Labels_model->getalllabels($this->modulenr);
}
private function setKleurcodes(){
$this->kleurcodes = new Kleurcodes();
}
private function setKleuren(){
// $this->kleuren = $this->CI->Organisaties_model->getKleurcodesOrg($this->clusterid, $this->swvid);
$this->kleuren = new stdClass();
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
$this->kleuren->organisatie_id = '0';
}
private function setPeriode(){
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
$this->vantm = "Gegevens uit periode ".$this->orgversie->periodenummer." van ".mysql2date($this->orgversie->geldigvanaf)." t/m ".mysql2date($this->orgversie->geldigtm);
}
private function loopOordelen(){
if (!$this->oordelen) return;
foreach ($this->oordelen as $index => $this->oordeel) {
if(! isset($this->oordeel->normid)) return;
$this->setOordeelKleuren();
$this->setWensID();
$this->setWensKleuren();
$this->setAdvies();
}
}
private function setOordeelKleuren(){
switch ($this->oordeel->normid) {
case 1:
$this->oordeel->kleur = $this->kleuren->kleur1;
break;
case 2:
$this->oordeel->kleur = $this->kleuren->kleur2;
break;
case 3:
$this->oordeel->kleur = $this->kleuren->kleur3;
break;
case 4:
$this->oordeel->kleur = $this->kleuren->kleur4;
break;
default:
$this->oordeel->kleur = '#ffffff';
}
}
private function setWensID()
{
if (!$this->oordeel->wensid) {
$this->oordeel->wensid = 3;
}
}
private function setWensKleuren(){
switch ($this->oordeel->wensid) {
case 1:
$this->oordeel->wenskleur = $this->kleuren->kleur1;
break;
case 2:
$this->oordeel->wenskleur = $this->kleuren->kleur2;
break;
case 3:
$this->oordeel->wenskleur = $this->kleuren->kleur3;
break;
case 4:
$this->oordeel->wenskleur = $this->kleuren->kleur4;
break;
default:
$this->oordeel->wenskleur = '#ffffff';
}
}
private function setAdvies(){
if($this->oordeel->normid < $this->oordeel->wensid && $this->oordeel->normid != 0 && $this->oordeel->wensid != 0){
array_push($this->adviezen, ["nummer"=> $this->oordeel->nummer, "omschrijving" =>$this->oordeel->omschrijving]);
}
}
private function setKolombreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$kolombreedte = floor(($this->rij - $this->standaardorg)/$this->aantal);
$this->kolombreedte = $kolombreedte . 'px';
}
private function setOrgbreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$orgbreedte = floor($this->rij - ($this->aantal * $this->kolombreedte));
$this->orgbreedte = $orgbreedte . 'px';
}
private function setInspectieAfbeeldingen(){
$this->inspectieafbeeldingen =[
"module" => $this->modulenr,
"oordelen" => $this->oordelen,
"labels" => $this->labels,
"kleuren" => $this->kleuren,
"vantm" => $this->vantm,
"adviezen" => $this->adviezen,
"kolombreedte" => $this->kolombreedte,
"orgbreedte" => $this->orgbreedte,
"ijkpunten" => $this->ijkpunten,
"aantalY" => $this->aantalY
];
}
}
@@ -0,0 +1,71 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class InspectieOordelen
{
private $CI;
private $oordelen;
private $oordeel;
private $standaarden = 0;
private $ijkpunten;
private $melding;
private $inspectieoordelen;
public function __construct($orgversieid, $orgid, $clusterid){
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->clusterid = $clusterid;
$this->handle();
}
public function getInspectieOordelen(){
return $this->inspectieoordelen;//oordelen zijn inclusief wensen
}
public function getOordelen(){
return $this->oordelen;
}
public function getIJkpunten(){
return $this->ijkpunten;
}
private function handle(){
$this->setOordelen();
$this->loopOordelen();
$this->setIJkpunten();
$this->setInspectieOordelen();
}
private function setOordelen(){
$this->oordelen = $this->CI->Scores_model->getstandaardfrequenties(false, $this->orgid, $this->orgversieid);
}
private function loopOordelen(){
foreach ($this->oordelen ? $this->oordelen : [] as $this->oordeel){
if($this->oordeel->normid){
$this->standaarden++;
}
}
}
private function setMelding(){
$this->melding = "";
}
private function setIJkpunten(){
$this->ijkpunten = $this->CI->Orgversies_model->getijkpunten($this->orgversieid);
}
private function setInspectieOordelen()
{
if ($this->standaarden >= 2) {
$this->inspectieoordelen =
["oordelen" => $this->oordelen,
"ijkpunten" => $this->ijkpunten];
} else {
$this->inspectieoordelen = false;
}
}
}
+150
View File
@@ -0,0 +1,150 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Kleurcodes {
protected $CI;
protected $sql;
protected $kleuren;
private $kleurensop;
function __construct(){
$this->CI =& get_instance();
$models = array("monpas/Modules_model");
$this->CI->load->model($models);
$kleuren = $this->setkleurcodes();
}
function getkleur($score){
$kleur ='#ffffff';
if ($this->kleuren){
$kleur = $this->kleuren->kleur1;
if ($score >= $this->kleuren->grens1) $kleur =$this->kleuren->kleur2;
if ($score >= $this->kleuren->grens2) $kleur =$this->kleuren->kleur3;
if ($score >= $this->kleuren->grens3) $kleur =$this->kleuren->kleur4;
}
if ($score === '' || $score === null || $score = 0) $kleur = "#dcdcdc";
return $kleur;
}
function getScoreKleur($score, $kleuren){
$kleur ='#ffffff';
if ($kleuren){
$kleur = $kleuren->kleur1;
if ($score >= $kleuren->grens1) $kleur = $kleuren->kleur2;
if ($score >= $kleuren->grens2) $kleur = $kleuren->kleur3;
if ($score >= $kleuren->grens3) $kleur = $kleuren->kleur4;
}
if ($score === '' || $score === null || $score = 0) $kleur = "#dcdcdc";
return $kleur;
}
function getnummer($score){
$nummer =0;
if ($this->kleuren){
$nummer = 1;
if ($score >= $this->kleuren->grens1) $nummer =2;
if ($score >= $this->kleuren->grens2) $nummer =3;
if ($score >= $this->kleuren->grens3) $nummer =4;
}
return $nummer;
}
function setkleurcodes(){
// $this->kleuren=$this->getkleurcodesfromdatabase();
$this->kleuren = new stdClass();
$this->kleuren->grens1 = '60';
$this->kleuren->grens2 = '80';
$this->kleuren->grens3 = '90';
$this->kleuren->grens4 = '100';
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
}
function setkleurcodesBijScoretype($type){
// $this->kleuren=$this->getkleurcodesfromdatabase();
if($type != 7) return;
$this->kleuren = new stdClass();
$this->kleuren->grens1 = '33';
$this->kleuren->grens2 = '66';
$this->kleuren->grens3 = '100';
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
}
function getkleurlegenda(){
$this->setkleurcodes();
$data = array("kleuren" => $this->kleuren);
$html = $this->CI->load->view('templates/kleurtabel' , $data, true);
return $html;
}
public function getkleurlegendaSop($kleuren){
$this->kleurensop = $kleuren;
$data = array("kleuren" => $this->kleurensop);
$html = $this->CI->load->view('templates/kleurtabel' , $data, true);
return $html;
}
function getkleurlegendaType($scoretype){
$this->setkleurcodesBijScoretype($scoretype);
$data = array("kleuren" => $this->kleuren);
$html = $this->CI->load->view('templates/kleurtabeltype' , $data, true);
return $html;
}
function getkleurlegendainspectie(){
$this->setkleurcodes();
$data = array("kleuren" => $this->kleuren);
$html = $this->CI->load->view('templates/kleurtabelinspectie' , $data, true);
return $html;
}
public function getkleurlegendainspectieSop(){
$this->setkleurcodes();
$data = array("kleuren" => $this->kleuren);
$html = $this->CI->load->view('templates/kleurtabelinspectie' , $data, true);
return $html;
}
function getkleurcodesfromdatabase(){
$clusterID = $this->CI->Modules_model->get(['sysnr'=>$this->CI->module],'cluster_id', true);
$swvID = $this->CI->Organisaties_model->get_swvid($this->CI->globorgid);
if (! $swvID) $swvID = 0;
if (! $clusterID) $clusterID = 0;
$sql = " SELECT *
FROM tb_kleurcodes KC
WHERE (organisatie_id = {$swvID} OR organisatie_id = 0)
AND (cluster_id = {$clusterID} OR cluster_id = 0)
order by organisatie_id desc, cluster_id DESC
limit 1";
$query = $this->CI->db->query($sql);
$codes = $query->row();
return $codes;
}
public function getKleurcodesOrg($clusterid = FALSE, $swvid){
if (! $clusterid) $clusterid = 0;
$sql = " SELECT *
FROM tb_kleurcodes KC
WHERE (organisatie_id = {$swvid} OR organisatie_id = 0)
AND (cluster_id = {$clusterid})
order by organisatie_id desc, cluster_id DESC
limit 1";
$query = $this->CI->db->query($sql);
$codes = $query->row();
return $codes;
}
}
@@ -0,0 +1,379 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class SchoolAfbeeldingen {
private $CI;
private $swvid;
private $scores;
private $score;
private $somscore;
private $ambities;
private $wensen;
private $wens;
private $ijkpunten;
private $aantalY;
private $labels;
private $kleuren;
private $kleurcodes;
private $orgversie;
private $vantm;
private $gemiddelde;
private $nummer;
private $gem;
private $adviezen= [];
private $rij = 708;
private $standaardorg = 250;
private $aantal = 15;
private $kolombreedte;
private $orgbreedte;
private $aantalscores = 0;
private $ijkpuntenok = 0;
private $welkehoogste = 0;
private $hoogstescore = -1;
private $welkelaagste = 0;
private $laagstescore = 101;
private $schoolafbeeldingen;
private $resultaten;
public function __construct(Schoolscores $schoolscores, $modulenr, $orgversieid, $clusterid, $orgid){
$this->CI = & get_instance();
$this->schoolscores = $schoolscores;
$this->modulenr = $modulenr;
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->clusterid = $clusterid;
$this->setScores();
$this->setAmbities();
$this->setWensen();
$this->setIJkpunten();
$this->handle();
}
public function getSchoolAfbeeldingen(){
return $this->schoolafbeeldingen;
}
public function getIJkpunten(){
return $this->ijkpunten;
}
public function getLabels(){
return $this->labels;
}
public function getScores(){
return $this->scores;
}
public function getAmbities(){
return $this->ambities;
}
public function getOrgVersie(){
return $this->orgversie;
}
public function getResultaten(){
$gem = "";
if($this->gemiddelde){
$gem = $this->gemiddelde->gem;
}
$this->resultaten = [
'totgem' => $gem,
'ijkpuntenok' => $this->ijkpuntenok,
'welkehoogste' => $this->welkehoogste,
'hoogstescore' => round($this->hoogstescore, 1),
'welkelaagste' => $this->welkelaagste,
'laagstescore' => round($this->laagstescore, 1),
];
return $this->resultaten;
}
public function getVantm(){
return $this->vantm;
}
public function getAdviezen(){
return $this->adviezen;
}
private function setScores(){
$this->scores = $this->schoolscores->getScores();
}
private function setAmbities(){
$this->ambities = $this->schoolscores->getAmbities();
}
private function setWensen(){
$this->wensen = $this->schoolscores->getWensen();
}
private function setIJkpunten(){
$this->ijkpunten = $this->schoolscores->getIJKpunten();
}
private function handle(){
$this->setSwvid();
$this->setLabels();
$this->telIJkpunten();
$this->setPeriode();
$this->setKleurcodes();
$this->setKleuren();
$this->loopScores1();
$this->setGemiddeldeScore();
$this->addGemiddeldeScore();
$this->loopScores2();
$this->setKolombreedte();
$this->setOrgbreedte();
$this->setSchoolAfbeeldingen();
}
private function setSwvid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setLabels(){
$this->labels = $this->CI->Labels_model->getalllabels($this->modulenr);
if(! $this->labels){
$this->labels = $this->CI->Labels_model->getalllabels(1);
}
}
private function telIJkpunten(){
if($this->ijkpunten){
$this->aantalY = count($this->ijkpunten);
}
}
private function setPeriode(){
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
$this->vantm = "Gegevens uit periode ".$this->orgversie->periodenummer." van ".mysql2date($this->orgversie->geldigvanaf)." t/m ".mysql2date($this->orgversie->geldigtm);
}
private function setKleurcodes(){
$this->kleurcodes = new Kleurcodes();
}
private function setKleuren(){
// $this->kleuren = $this->kleurcodes->getKleurcodesOrg($this->clusterid, $this->swvid);
// if(!$this->kleuren || $this->kleuren == " ") {
$this->kleuren = new stdClass();
$this->kleuren->cluster_id = $this->clusterid;
$this->kleuren->grens1 = '60';
$this->kleuren->grens2 = '80';
$this->kleuren->grens3 = '90';
$this->kleuren->grens4 = '100';
if($this->orgversie->scoretype== 7){
$this->kleuren->grens1 = '33';
$this->kleuren->grens2 = '66';
$this->kleuren->grens3 = '100';
}
// $this->kleuren->kleur1 = '#fe2219';
// $this->kleuren->kleur2 = '#fea719';
// $this->kleuren->kleur3 = '#15d029';
// $this->kleuren->kleur4 = '#1558d0';
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
$this->kleuren->organisatie_id = '0';
// }
}
private function loopScores1(){
if(!$this->scores) return;
foreach ($this->scores as $index => $this->score) {
$this->setScoreSom();
$this->setAantalScores($index);
}
}
private function setScoreSom(){
$this->somscore = $this->somscore + $this->score->gem;
}
private function setAantalScores($index){
$this->aantalscores = $index + 1;
}
private function setGemiddeldeScore(){
if(!$this->scores || $this->aantalscores == 0) return;
$this->gemiddelde = new stdClass();
$this->gemiddelde->gem = $this->somscore / $this->aantalY;
$this->gemiddelde->nummer = 'gem';
$this->score = $this->gemiddelde;
}
private function addGemiddeldeScore(){
if(!$this->scores || ! $this->gemiddelde) return;
array_push($this->scores, $this->score);
}
private function loopScores2()
{
if (!$this->scores) return;
foreach ($this->scores as $index => $this->score) {
$this->setScoreNummer();
$this->rondScoresAf();
$this->setScoreKleuren();
$this->addGewensteScores($index);
$this->setWensKleuren();
$this->setAdvies();
$this->setResultatenOverzicht();
$this->telIJKpuntenok();
}
}
private function setScoreNummer(){
$this->score->huidig = 1;
if ($this->score->gem >= $this->kleuren->grens1) $this->score->huidig =2;
if ($this->score->gem >= $this->kleuren->grens2) $this->score->huidig =3;
if ($this->score->gem >= $this->kleuren->grens3) $this->score->huidig =4;
if($this->orgversie->scoretype == 7){
if ($this->score->gem == $this->kleuren->grens3) $this->score->huidig = 4;
if ($this->score->gem < $this->kleuren->grens3) $this->score->huidig = 3;
if ($this->score->gem <= $this->kleuren->grens2) $this->score->huidig = 2;
if ($this->score->gem <= $this->kleuren->grens1) $this->score->huidig = 1;
}
}
private function rondScoresAf(){
$this->score->gem = round($this->score->gem);
}
private function setScoreKleuren(){
switch ($this->score->huidig) {
case 1:
$this->score->kleur = $this->kleuren->kleur1;
break;
case 2:
$this->score->kleur = $this->kleuren->kleur2;
break;
case 3:
$this->score->kleur = $this->kleuren->kleur3;
break;
case 4:
$this->score->kleur = $this->kleuren->kleur4;
break;
default:
$this->score->kleur = '#ffffff';
}
}
private function addGewensteScores($index){
$this->score->wens = 3;
if ($this->wensen && $index < $this->aantalscores) {
$this->score->wens = $this->wensen[$index]->wens;
}
}
private function setWensKleuren(){
if(! isset($this->wensen)) return;
if(!isset($this->score->wens)) return;
switch ($this->score->wens) {
case 1:
$this->score->wenskleur = $this->kleuren->kleur1;
break;
case 2:
$this->score->wenskleur = $this->kleuren->kleur2;
break;
case 3:
$this->score->wenskleur = $this->kleuren->kleur3;
break;
case 4:
$this->score->wenskleur = $this->kleuren->kleur4;
break;
default:
$this->score->wenskleur = '#ffffff';
}
}
private function setAdvies(){
if(isset($this->score->wens) && $this->score->huidig < $this->score->wens && $this->score->huidig != 0 && $this->score->wens!= 0){
$omschrijving = "";
if(isset($this->score->omschrijving)){
$omschrijving = $this->score->omschrijving;
}
array_push($this->adviezen, ["nummer"=> $this->score->nummer, "omschrijving" =>$omschrijving]);
}
}
private function setResultatenOverzicht()
{
if ($this->score->gem > $this->hoogstescore) {
$this->hoogstescore = $this->score->gem;
$this->welkehoogste = $this->score->nummer;
}
if ($this->score->gem <= $this->laagstescore) {
$this->laagstescore = $this->score->gem;
$this->welkelaagste = $this->score->nummer;
}
}
private function telIJkpuntenok()
{
if ($this->ambities && $this->score->gem >= $this->ambities->zprocent) {
$this->ijkpuntenok++;
}
}
private function setKolombreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$kolombreedte = floor(($this->rij - $this->standaardorg)/$this->aantal);
$this->kolombreedte = $kolombreedte . 'px';
}
private function setOrgbreedte(){
if($this->aantalY > 1) $this->aantal = $this->aantalY;
$orgbreedte = floor($this->rij - ($this->aantal * $this->kolombreedte));
$this->orgbreedte = $orgbreedte . 'px';
}
private function setSchoolAfbeeldingen()
{
//nagaan of het tabelid altijd klopt
if (!$this->scores) {
$this->schoolafbeeldingen = false;
}
if ($this->scores) {
$this->schoolafbeeldingen = [
"module" => $this->modulenr,
"scores" => $this->scores,
"labels" => $this->labels,
"kleuren" => $this->kleuren,
"vantm" => $this->vantm,
"ambitie" => $this->ambities,
"adviezen" => $this->adviezen,
"ijkpunten" => $this->ijkpunten,
'ijkpuntenok' => $this->ijkpuntenok,
'welkehoogste' => $this->welkehoogste,
'hoogstescore' => round($this->hoogstescore, 1),
'welkelaagste' => $this->welkelaagste,
'laagstescore' => round($this->laagstescore, 1),
"aantalY" => $this->aantalY,
"totgem" => $this->gemiddelde->gem,
"orgbreedte" => $this->orgbreedte,
"kolombreedte" => $this->kolombreedte,
];
}
}
}
@@ -0,0 +1,74 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class SchoolScores
{
private $CI;
private $ijkpunten;
private $scores;
private $ambities;
private $wensen;
private $schoolScores;
public function __construct( $orgversieid, $orgid)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->handle();
}
public function getScores(){
return $this->scores;
}
public function getAmbities(){
return $this->ambities;
}
public function getWensen(){
return $this->wensen;
}
public function getSchoolScores()
{
return $this->schoolScores;
}
public function getIJkpunten(){
return $this->ijkpunten;
}
private function handle()
{
$this->setIJkpunten();
$this->setScores();
$this->setAmbities();
$this->setWensen();
$this->setSchoolScores();
}
private function setIJkpunten(){
$this->ijkpunten = $this->CI->Orgversies_model->getijkpunten($this->orgversieid);
}
private function setScores(){
$this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgid);
}
private function setAmbities(){
$this->ambities = $this->CI->Ambities_model->getOrgAmbities($this->orgversieid, $this->orgid);
}
private function setWensen(){
$this->wensen = $this->CI->Wenssituaties_model->getgewenst( $this->orgversieid, $this->orgid);
}
private function setSchoolScores(){
$this->schoolScores = [
$this->ijkpunten, $this->scores, $this->ambities, $this->wensen];
}
}
@@ -0,0 +1,138 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class
SchooljaarVersies
{
private $CI;
private $chapterid;
private $profielid;
private $profiel;
private $schooltype;
private $schooljaarid;
private $filledversies =[];
private $aantallln;
private $sopversies =[];
private $versie;
private $schooljaarversies = [];
private $sopaanwezig = 'F';
private $versies;
public function __construct($chapterid, $profielid, $modulenr)
{
$this->CI =& get_instance();
$this->chapterid = $chapterid;
$this->profielid = $profielid;
$this->modulenr = $modulenr;
$this->handle();
}
public function getModuleNummer(){
return $this->modulenr;
}
public function getSopAanwezig(){
return $this->sopaanwezig;
}
public function getFilledVersies(){
return $this->filledversies;
}
public function getSchooljaarid(){
return $this->schooljaarid;
}
private function handle()
{
$this->setProfiel();
$this->setSchooltype();
$this->setSchoolJaarVersies();
$this->loopSchooljaarVersies();
$this->setSopVersies();
$this->setSopAanwezig();
$this->setSchooljaarid();
$this->setVersies();
}
private function setProfiel(){
$this->profiel = $this->CI->Sop_model->get_record_by_id($this->profielid);
}
private function setSchooltype(){
if(!$this->modulenr) return;
if($this->modulenr == 2 || $this->modulenr == 660) $this->schooltype = 'R';
if ($this->modulenr == 270) $this->schooltype = 'SBO';
}
private function setSchooljaarVersies(){
$this->schooljaarversies = $this->CI->Schooljaren_model->getschooljaren();
}
private function loopSchooljaarVersies(){
if(!$this->modulenr) return;
foreach($this->schooljaarversies as $index =>$this->versie){
$this->setGevuldeVersies();
}
}
private function setGevuldeVersies(){
if(!$this->modulenr) return;
$this->aantallln = $this->CI->Groepen_model->getversiesmetleerlingen(
$this->CI->globorgid, $this->versie->schooljaarnr, $this->schooltype, $this->modulenr);
if(isset($this->aantallln)){
if ($this->aantallln > 0) {
array_push($this->filledversies, $this->versie);
}
}
}
private function setSopVersies(){
if(!$this->modulenr) return;
foreach($this->filledversies as $index=> $this->versie){
if($this->versie->start >= $this->profiel->van
&& $this->versie->eind <= $this->profiel->tm){
array_push($this->sopversies, $this->versie);
}
}
}
private function setSopAanwezig(){
if(!$this->modulenr) return;
if($this->sopversies) $this->sopaanwezig = "T";
}
private function setSchooljaarid(){
if (!$this->filledversies) return;
if($this->sopaanwezig === 'F'){
$this->schooljaarid = $this->filledversies[0]->schooljaarnr;
}
if($this->sopaanwezig === 'T'){
$this->schooljaarid = $this->sopversies[0]->schooljaarnr;
}
}
private function setVersies(){
if(!$this->modulenr) $this->versies = [];
$this->versies =[
"orgversieid" => $this->schooljaarid,
"filledversies" => $this->filledversies,
"aanwezig" => $this->sopaanwezig
];
}
}
+168
View File
@@ -0,0 +1,168 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class SopKeuze
{
private $orgid;
private $sops;
private $soplabels = [];
private $label;
private $sop;
private $sopid;
private $labelids = [];
private $stringlabelids;
private $standaardlabels = [];
private $hfstlabels =[];
private $stringids;
private $hoofdstukids = [];
private $keuzelabels = [];
private $labels;
private $sopkeuze;
private $CI;
public function __construct($sopid)
{
$this->CI =& get_instance();
$this->sopid = $sopid;
$this->handle();
}
public function getSopKeuze(){
return $this->sopkeuze;
}
public function getSops(){
return $this->sops;
}
public function getLabels(){
return $this->labels;
}
public function getHoofdstukLabels(){
return $this->hfstlabels;
}
private function handle()
{
$this->setOrgid();
$this->setSops();
$this->setSopLabels();
$this->setLabelids();
$this->setLabelidsInString();
$this->setStandaardLabels();
$this->setHoofdstukLabels();
$this->loopHoofdstukLabels();
$this->hoofdstukIdsInString();
$this->setKeuzeLabels();
$this->plaatsBuitenSop();
$this->setLabels();
$this->setSopKeuze();
}
private function setOrgid(){
$this->orgid = $this->CI->globorgid;
}
private function setSops(){
$this->sops = $this->CI->Sop_model->getnieuwesops($this->orgid);
}
private function setSopLabels(){
if(!$this->sops) return;
if($this->sopid === 0){
$this->sopid = $this->sops[0]->profielID;
}
$this->soplabels = $this->CI->Hoofdstukken_model->getHoofdstukLabelsSop($this->sopid);
}
private function setLabelids(){
$this->labelsids = [];
if(!$this->sops) return;
if(!$this->soplabels) return;
foreach($this->soplabels as $index =>$this->label){
array_push($this->labelids, $this->label->id);
}
}
private function setLabelidsInString(){
if(!$this->sops) return;
if(!$this->soplabels) return;
$this->stringlabelids = implode(",", $this->labelids);
}
private function setStandaardLabels(){
if(!$this->sops) return;
$this->standaardlabels= $this->CI->Hoofdstukken_model->getStandaardLabelsSop($this->stringlabelids);
}
private function setHoofdstukLabels(){
if(!$this->sops) return;
$this->hfstlabels = [];
if(!$this->soplabels){
$this->hfstlabels = $this->standaardlabels;
}
if(!$this->standaardlabels){
$this->hfstlabels = $this->soplabels;
}
if($this->soplabels && $this->standaardlabels) {
$this->hfstlabels = $this->standaardlabels + $this->soplabels;
}
}
private function loopHoofdstukLabels(){
if(!$this->sops) return;
if(!$this->hfstlabels) return;
foreach($this->hfstlabels as $index => $this->label){
$this->plaatsInSop();
$this->setHoofdstukids();
}
}
private function plaatsInSop(){
$this->label->sop = 'T';
}
private function setHoofdstukids(){
array_push($this->hoofdstukids, $this->label->id);
}
private function hoofdstukIdsInString(){
if(!$this->sops) return;
if(!$this->hoofdstukids) return;
$this->stringids = implode(",", $this->hoofdstukids);
}
private function setKeuzeLabels(){
if(!$this->stringids){$this->stringids = 0;}
$this->keuzelabels = $this->CI->Hoofdstukken_model->getKeuzelabelsSop($this->orgid, $this->stringids);
}
private function plaatsBuitenSop(){
if(!$this->keuzelabels) return;
foreach($this->keuzelabels as $index => $this->label){
$this->label->sop = 'F';
}
}
private function setLabels(){
if(!$this->keuzelabels) {
$this->labels = $this->hfstlabels;
}
if($this->keuzelabels){
$this->labels = array_merge($this->hfstlabels, $this->keuzelabels);
}
}
private function setSopKeuze(){
$this->sopkeuze =[
"sops" => $this->sops,
"labels" => $this->labels
];
}
}
+139
View File
@@ -0,0 +1,139 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Tabellen
{
private $hoofdstukkeuze;
private $orgversie;
private $versie;
private $content;
private $views;
private $view;
private $tab;
//ls okt 2020 private $imagecode;
private tabelid;
private $imagedata;
private $sopinhoud;
private $updateid;
private $CI;
public function getUpdateId(){
return $this->updateid;
}
public function __construct($sopinhoudid, $orgversie = false){
$this->CI =& get_instance();
$this->sopinhoudid = $sopinhoudid;
$this->orgversie = $orgversie;
$this->handle();
}
private function handle(){
$this->setSopinhoud();
$this->setInhoud();
$this->setHoofdstukKeuze();
$this->setSchool();
$this->setVersie();
$this->setViews();
$this->loopViews();
$this->updateContent();
}
private function setSopinhoud(){
$this->sopinhoud = $this->CI->Sopinhouden_model->get_record_by_id($this->sopinhoudid);
}
private function setInhoud(){
$this->content = $this->sopinhoud->content;
}
private function setHoofdstukKeuze(){
if( $this->orgversie == "false"){
$this->orgversie = $this->sopinhoud->orgversieid;};
$hoofdstukkeuze =
new HoofdstukKeuze($this->sopinhoud->chapter_id, $this->orgversie);
$this->hoofdstukkeuze = $hoofdstukkeuze->getHoofdstukKeuze();
}
private function setSchool(){
if( !($this->hoofdstukkeuze['data']) ) return;
$this->hoofdstukkeuze['data']['school'] = $this->CI->Organisaties_model->get_record_by_id($this->CI->globorgid);
}
private function setVersie(){
if( !($this->hoofdstukkeuze['data']) ) return;
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->sopinhoud->orgversieid);
$this->versie = $this->CI->Versies_model->get_record_by_id($this->orgversie->versie_id);
$this->versie->naam = $this->versie->naam.', periode: '. $this->orgversie->periodenummer.':
'.$this->orgversie->geldigvanaf.' - '.$this->orgversie->geldigtm;
$this->hoofdstukkeuze['data']['versie'] = $this->versie;
}
private function setViews(){
$this->views = $this->CI->Sopviews_model->get_records_where (['soort' =>$this->hoofdstukkeuze['soort']]);
}
private function loopViews(){
if(! $this->views) return;
if( !($this->hoofdstukkeuze['data']) ) return;
foreach ($this->views as $index => $this->view) {
$this->loadView();
$this->maakAfbeelding();
$this->plaatsVerversteAfbeelding();
}
}
private function loadView(){
$pad = $this->view->pad;
$this->view->tab = $this->CI->load->view("monpas/sopkeuze/" . $pad, ['data' => $this->hoofdstukkeuze['data']], TRUE);
}
private function maakAfbeelding(){
if ($this->view->type != 'GRA') return;
$this->view->grafiek = $this->CI->Phantom_model->create_img($this->view->tab, 'test', FALSE, FALSE, array(650, 0));
//ls okt 2020 $this->imagedata = "<img src='data:image/png;base64," . $this->view->grafiek . "' id='" . $this->view->imagecode . "' />";
$this->imagedata = "<img src='data:image/png;base64," . $this->view->grafiek . "' id='" . $this->view->tabelid . "' />";
}
private function plaatsVerversteAfbeelding(){
$afbeelding = '';
if($this->view->type === 'GRA'){
$afbeelding = $this->imagedata;
}
if($this->view->type === 'TAB'){
$afbeelding = $this->view->tab;
}
if($afbeelding == '') return;
$vervangstart = $this->view->css;
$vervangstartlengte = strlen($vervangstart)+2;
$vervangeind = $this->view->csseind;
$posstart = strpos($this->content,$vervangstart);
$posstart = $posstart + $vervangstartlengte;
$poseind = strpos($this->content, $vervangeind);
$lengte = $poseind - $posstart - 12; // de div, het woord class etc.
if (strpos($this->content, $vervangstart)) {
$this->content = substr_replace($this->content, $afbeelding, $posstart, $lengte);
}
}
private function updateContent(){
if( !($this->hoofdstukkeuze['data'])) return false;
$data = ['content' => $this->content];
$this->CI->Sopinhouden_model->update_record(
$data, $this->sopinhoudid);
}
}
+215
View File
@@ -0,0 +1,215 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Versions
{
private $CI;
private $chapterid;
private $profielid;
private $clusterid;
private $profiel;
private $orgversieid;
private $oordelen;
private $standaarden = 'NVT';
private $filledversies =[];
private $gevuldeversies;
private $heeftijkpunten;
private $sopversies;
private $versie;
private $vormtekst;
private $geopendeversies = [];
private $sopaanwezig = 'F';
private $versies;
public function __construct($chapterid, $profielid, $modulenr)
{
$this->CI =& get_instance();
$this->chapterid = $chapterid;
$this->profielid = $profielid;
$this->modulenr = $modulenr;
$this->handle();
}
public function getorgversieid(){
return $this->orgversieid;
}
public function getFilledversies(){
return $this->filledversies;
}
public function getModuleNummer(){
return $this->modulenr;
}
public function getSopAanwezig(){
return $this->sopaanwezig;
}
public function getStandaarden(){
return $this->standaarden;
}
public function getVersies(){
return $this->versies;
}
public function getMetIjkpunten(){
return $this->heeftijkpunten;
}
private function handle()
{
$this->setProfiel();
$this->setClusterid();
$this->setLijstVersies();
$this->loopGeopendeVersies();
$this->setMetIJkpunten();
$this->setSopVersies();
$this->setOrgversieid();
$this->setVersies();
}
private function setProfiel(){
$this->profiel = $this->CI->Sop_model->getnieuwsop($this->profielid);
}
private function setClusterid(){
if(!$this->modulenr) return;
$this->clusterid = $this->CI->Modules_model->get_fieldvalue([ "sysnr"=> $this->modulenr], "cluster_id");
}
private function setLijstVersies(){
if(!$this->modulenr) return;
$this->geopendeversies = $this->CI->Filledversions_model->getfilledversionsperorg(
$this->CI->globorgid, $this->modulenr); //id = orgversieid
}
private function loopGeopendeVersies(){
if(!$this->modulenr) return;
if(!$this->geopendeversies) return;
foreach($this->geopendeversies as $index =>$this->versie){
$this->checkStandaarden();
$this->setGevuldeVersies();
}
}
private function checkStandaarden(){
if(!$this->clusterid || $this->clusterid != 4) return;
$this->versie->standaarden = 'F';
$this->standaarden = 'F';
$this->oordelen = $this->CI->Scores_model->telOordelen($this->CI->globorgid, $this->versie->id);
if ($this->oordelen >= 2) {
$this->versie->standaarden = 'T';
$this->standaarden = 'T';
}
}
private function setGevuldeVersies(){
if(!$this->modulenr) return;
if(!$this->geopendeversies) return;
$this->gevuldeversies = $this->CI->Scores_model->fGetGevuldeVersies(
$this->versie->id, $this->CI->globorgid);
if($this->gevuldeversies) {
if ($this->standaarden == 'NVT' || $this->versie->standaarden == 'T') {
if($this->versie->vorm == 1){
$this->vormtekst = 'schoolversie';
}
if($this->versie->vorm == 2){
$this->vormtekst = 'individuele versie';
}
$this->versie->naam = $this->versie->naam . ', periode: ' . $this->versie->periodenummer . ':
' . $this->versie->geldigvanaf . ' - ' . $this->versie->geldigtm .', '.
$this->vormtekst;
$this->versie->naamkort = 'Periode: ' . $this->versie->periodenummer . ':
' . $this->versie->geldigvanaf . ' - ' . $this->versie->geldigtm;
$this->filledversies [] = $this->versie;
}
}
}
private function setMetIJkpunten(){
switch ($this->clusterid){
case 0: $this->heeftijkpunten = 'T';
break;
case 1: $this->heeftijkpunten = 'F';
break;
case 2:
case 3:
case 4:
case 5: $this->heeftijkpunten = 'T';
break;
case 6:
case 7: $this->heeftijkpunten = 'F';
break;
case 8: $this->heeftijkpunten = 'T';
break;
case 10: $this->heeftijkpunten = 'T';
break;
default: $this->heeftijkpunten = 'F';
break;
}
}
private function setSopVersies(){
if(!$this->modulenr) return;
if($this->standaarden == 'F') return;
if(!$this->filledversies) return;
// $this->sopversies = $this->CI->Filledversions_model->getversiesperorgperperiode(
// $this->CI->globorgid, $this->modulenr,$this->profiel->van, $this->profiel->tm);
foreach($this->filledversies as $index => $this->versie){
$this->versie->insop = 'F';
$valterin = $this->CI->Filledversions_model->checkperiode($this->versie->id,$this->profiel->van,
$this->profiel->tm );
if($valterin){
$this->versie->insop = 'T';
$this->sopaanwezig = "T";
}
}
}
private function setOrgversieid(){
if (!$this->filledversies) return;
if($this->sopaanwezig === 'F'){
$this->orgversieid = $this->filledversies[0]->id;
}
if($this->sopaanwezig === 'T'){
foreach($this->filledversies as $index =>$this->versie){
if($this->versie->insop == 'T'){
$this->orgversieid = $this->versie->id;
return;
}
}
}
}
private function setVersies(){
if(!$this->modulenr) $this->versies = [];
$this->versies =[
"orgversieid" => $this->orgversieid,
"filledversies" => $this->filledversies,
"aanwezig" => $this->sopaanwezig,
"standaarden" => $this->standaarden,
];
}
}
@@ -0,0 +1,460 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class CompacteOnderdelen
{
private $CI;
private $onderdeel;
private $omvangjaren;
private $omvangjaar;
private $jaar;
private $schooljaar;
private $schooljaarV;
private $school;
private $schoolgegevens;
private $schoolpartial = [];
private $swvid;
private $organisatie;
private $kleurcodes;
private $kleuren;
private $legenda;
private $logo;
private $tlvs;
private $arrangementen;
private $aantallen;
private $diversiteit;
private $ijkpunten;
private $scorevorm;
private $selectie;
private $selecties = [];
private $vorm;
private $jaarnummer;
private $subsoorten;
private $subsoort;
private $somE;
private $somB;
private $uitgavetypen;
private $type;
private $typesom;
private $naam;
private $data;
private $html;
private $onderdeelcs;
private $onderdelencs;
private $compacteonderdelen;
public function __construct($schooljaarnr, $onderdelen, $omvangjaren){
$this->CI = &get_instance();
$this->schooljaarnr = $schooljaarnr;
$this->onderdelen = $onderdelen;
$this->omvangjaren = $omvangjaren;
$this->handle();
}
public function getCompacteOnderdelen(){
return $this->compacteonderdelen;
}
public function getSchooljaar(){
return $this->schooljaar->naam;
}
public function getSchoolnaam(){
return $this->organisatie->naam;
}
private function handle()
{
$this->setSchooljaar();
$this->setOrganisatie();
$this->setSchool();
$this->setSchoolGegevens();
$this->setSchoolPartial();
$this->setSWVid();
$this->setKleurcodes();
$this->setKleuren();
$this->setLegenda();
$this->loopOnderdelen();
$this->setCompacteOnderdelen();
}
private function setSchooljaar(){
$jaarid = $this->CI->Schooljaren_model->get_fieldvalue(['schooljaarnr' => $this->schooljaarnr], 'id');
$this->schooljaar = $this->CI->Schooljaren_model->get_record_by_id($jaarid);
}
private function setOrganisatie(){
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->CI->globorgid);
}
private function setSchool(){
$this->school = $this->CI->Schooldetails_model->get_details($this->CI->globorgid);
}
private function setSchoolGegevens(){
$test = $this->CI->rootpath;
$logo = false;
if($this->school && $this->school->logo) {
$logo = $this->CI->config->item('vendor_url') . '/images/logos/' . $this->school->logo;
}
$this->schoolgegevens = [
'organisatie' => $this->organisatie,
'naamkort' => $this->organisatie->naamkort,
'school' => $this->school,
'schooljaar' => $this->schooljaar->naam,
'schooljaarnr' => $this->schooljaarnr,
'datum' => date("d-m-Y"),
'logo' => $logo
];
}
private function setSchoolpartial()
{
$this->schoolpartial['data'] = $this->schoolgegevens;
$this->schoolpartial['html'] = 'monpas/compactsop/schoolgegevenscompact';
}
private function setSWVid()
{
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->CI->globorgid);
}
private function setKleurcodes()
{
$this->kleurcodes = new Kleurcodes();
}
private function setKleuren()
{
// $this->kleuren = $this->kleurcodes->getKleurcodesOrg(0, $this->swvid);
if (!$this->kleuren || $this->kleuren == " ") {
$this->kleuren = new stdClass();
$this->kleuren->cluster_id = 0;
$this->kleuren->grens1 = '60';
$this->kleuren->grens2 = '80';
$this->kleuren->grens3 = '90';
$this->kleuren->grens4 = '100';
// $this->kleuren->kleur1 = '#fe2219';
// $this->kleuren->kleur2 = '#fea719';
// $this->kleuren->kleur3 = '#15d029';
// $this->kleuren->kleur4 = '#1558d0';
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
}
}
private function setLegenda()
{
$this->legenda['data'] = $this->kleuren;
$this->legenda['html'] = "monpas/compactsop/legendacompact";
}
private function loopOnderdelen()
{
if (!$this->onderdelen) return;
foreach ($this->onderdelen as $index => $this->onderdeel) {
$this->data = "";
$this->html = "";
$this->setOnderdeelNaam();
$this->setHTMLPad();
$this->switchOnderdelen();
$this->setOnderdeel();
$this->setOnderdelen();
}
}
private function setOnderdeelNaam()
{
if (!$this->onderdeel['onderdeelnr']) return;
$this->naam = $this->CI->Compactsoponderdelen_model->get_fieldvalue(['nummer' => $this->onderdeel['onderdeelnr']], 'naam');
}
private function setHTMLPad(){
if (!$this->onderdeel['onderdeelnr']) return;
$this->html = $this->CI->Compactsoponderdelen_model->get_fieldvalue(['nummer' => $this->onderdeel['onderdeelnr']], 'pad');
}
private function switchOnderdelen()
{
if (!$this->onderdeel['onderdeelnr']) return;
switch ($this->onderdeel['onderdeelnr']) {
case 1:
$this->setDiversiteit();
break;
case 2:
$this->setIJkpunten();
break;
case 3:
$this->setSetOmvang();
break;
case 4:
case 5:
case 6:
$this->setIJkpunten();
break;
case 7:
$this->setMiddelen();
break;
case 8:
$this->setIJkpunten();
}
}
private function setDiversiteit()
{
$divcompact = New Diversiteit($this->schooljaarnr, $this->CI->globorgid, $this->onderdeel['modulenr']);
$divdata = $divcompact->getDiversiteit();
$divafbeelding = New DiversiteitAfbeeldingen($divdata, $this->onderdeel['modulenr'], $this->schooljaarnr);
$this->diversiteit = $divafbeelding->getDiversiteitAfbeeldingen();
$data = [
'schooljaar' => $this->schooljaar->naam,
'groepen' => $this->diversiteit['groepen'],
'schooldq' => $this->diversiteit['schooldq'],
'schooldiversiteit' => $this->diversiteit['totdiversiteit'],
];
$this->data = $data;
}
private function setSetOmvang(){
if(! isset($this->omvangjaren) || count($this->omvangjaren) < 1 || !$this->omvangjaren) return;
$jaren = implode("','", $this->omvangjaren);
$jaren = "'" . $jaren . "'";
$arrs = $this->CI->Arrangementen_model->getArrangementnamenSop($jaren,$this->CI->globorgid );
if($arrs) {
$kleuren = ['#ffcc80', '#ffb84d', '#ffa31a', '#e68a00', '#b36b00', '#804d00', '#4d2e00', '#ffe0b3', '#fff5e6'];
$index = 0;
foreach ($arrs as $arr) {
if ($index >= count($kleuren)) $index = 0;
$arr->kleur = $kleuren[$index];
$index++;
}
}
foreach($this->omvangjaren as $index => $this->omvangjaar) {
$this->jaar = new stdClass();
$this->jaar->aantallen =
$this->CI->Aantalleerlingen_model->get_omvang($this->omvangjaar, $this->CI->globorgid);
$this->jaar->tlvs =
$this->CI->Tlvs_model->getAantalLeerlingenMetTLV($this->omvangjaar, $this->CI->globorgid);
$this->jaar->arrangementen =
$this->CI->Arrangementen_model->getArrangementenMetAantallenSop($this->CI->globorgid,$this->omvangjaar );
if($this->jaar->arrangementen) {
foreach ($this->jaar->arrangementen as $arrangement) {
foreach ($arrs as $arr) {
if ($arrangement->id == $arr->id) {
$arrangement->kleur = $arr->kleur;
}
$arrangement->naamkort = $arrangement->naam;
if (strlen($arrangement->naam)> 10){
$arrangement->naamkort = substr($arrangement->naam, 0, 12);
$arrangement->naamkort = $arrangement->naamkort. '..';
}
}
}
}
$this->data [] = $this->jaar;
}
}
private function setMiddelen()
{
$this->setUitgavetypen();
$this->loopUitgavetypen();
$this->setTypeSom();
// $this->typesom = $this->setBedragNL($this->typesom);
$this->setSubsoorten();
$this->loopSubsoorten();
$this->setSomSubsoort();
// $this->somB = $this->setBedragNL($this->somB);
// $this->somE = $this->setBedragNL($this->somE);
$this->setMiddelenData();
}
private function setUitgavetypen()
{
$this->jaarnummer = $this->CI->Kalenderjaren_model->get_fieldvalue(['naam' => $this->onderdeel['orgversieid']], 'jaarnr');
$this->uitgavetypen = $this->CI->Finbestemmingen_model->getUitgavenPerType($this->CI->globorgid, $this->jaarnummer);
}
private function loopUitgavetypen()
{
if (!$this->uitgavetypen) return;
foreach ($this->uitgavetypen as $index => $this->type) {
$this->afrondenType();
// $this->type->bedragNL = $this->setBedragNL($this->type->format);
$this->lowercase();
}
}
private function afrondenType(){
$euros= number_format(($this->type->bedrag /100) , 0,',','.');
$this->type->euros = $euros;
$this->type->bedragNL =$euros;
// $euros = round(($this->type->bedrag / 100), 2);
// $this->type->euros = $euros;
}
private function setBedragNL($bedrag){
$metpunt = str_replace(',', '.', $bedrag);
$lengte = strlen($metpunt);
$deel1 = substr($metpunt, 0, ($lengte - 3));
$deel2 = substr($metpunt, ($lengte - 2), 2);
return $deel1 . ',' . $deel2;
}
private function lowercase(){
$klein = strtolower($this->type->uitgavetype);
$eerste = ucfirst($klein);
$this->type->uitgavetype = $eerste;
}
private function setTypeSom(){
$this->typesom = $this->CI->Finbestemmingen_model->getTotaalSchoolBestedingen($this->CI->globorgid, $this->jaarnummer);
$this->typesom = number_format(($this->typesom / 100), 0,',','.');
}
private function setSubsoorten(){
$this->subsoorten = $this->CI->Finbestemmingen_model->getUitgavenPerSubsoortSchool($this->CI->globorgid, $this->jaarnummer);
}
private function loopSubsoorten(){
if (!$this->subsoorten) return;
foreach ($this->subsoorten as $index => $this->subsoort) {
$this->afrondenSoort();
//$this->subsoort->bedragNL = $this->setBedragNL($this->subsoort->format);
}
}
private function afrondenSoort(){
$euros= number_format(($this->subsoort->bedrag /100) , 0,',','.');
$this->subsoort->euros = $euros;
$this->subsoort->bedragNL =$euros;
}
private function setSomSubsoort(){
$this->somB = $this->CI->Finbestemmingen_model->setSomSubsoort(
$this->CI->globorgid, $this->jaarnummer, 'BASIS');
$this->somB = str_replace(',','', $this->somB);
$this->somB = number_format(($this->somB ), 0,',','.');
$this->somE = $this->CI->Finbestemmingen_model->setSomSubsoort(
$this->CI->globorgid, $this->jaarnummer, 'EXTRA');
$this->somE = str_replace(',','', $this->somE);
$this->somE = number_format(($this->somE ), 0,',','.');
}
private function setMiddelenData()
{
$data = ['subsoorten' => $this->subsoorten,
'typesom' => $this->typesom,
'somB' => $this->somB,
'somE' => $this->somE,
'uitgaventypen' => $this->uitgavetypen,
'versie' => $this->onderdeel['orgversieid']
];
$this->data = $data;
}
private function setIJkpunten()
{
$this->setScorevorm();
$this->setSelecties();
$this->setLijsten();
$this->setIJkpuntenGegevens();
}
private function setScorevorm(){
if(!$this->onderdeel['orgversieid']) return;
if($this->onderdeel['onderdeelnr'] == 7) return;
$this->scorevorm =
$this->CI->Orgversies_model->get_fieldvalue( ['id' => $this->onderdeel['orgversieid'] ],'vorm');
}
private function setSelecties(){
$this->selectie =[];
$this->selecties = [];
$this->selectie = [
'orgversieid' => $this->onderdeel['orgversieid'],
'vorm' => $this->scorevorm
];
$this->selecties[] = $this->selectie;
if($this->onderdeel['vergelijkid'] ){
// foreach($this->onderdeel['vergelijkids'] as $index => $this->vergelijkingid){
$this->vorm = $this->CI->Orgversies_model->get_fieldvalue(['id' => $this->onderdeel['vergelijkid']], 'vorm');
$this->selectie = ['orgversieid' => $this->onderdeel['vergelijkid'],
'vorm' => $this->vorm];
$this->selecties [] = $this->selectie;
// }
}
}
private function setLijsten(){
$this->ijkpunten = "";
$lijsten = new Lijsten($this->CI->globorgid, $this->selecties);
$this->ijkpunten = $lijsten->getSopInfo();
}
private function setIJkpuntenGegevens(){
$this->data= "";
$this->data = $this->ijkpunten;
}
private function setOnderdeel(){
$this->onderdeelcs = $this->onderdeel;
$this->onderdeelcs['breed'] = 'F';
if($this->html) {
$this->onderdeelcs['html'] = $this->html;
}
if($this->data && $this->naam) {
$this->onderdeelcs['data'] =
['data' =>$this->data,
'naam' =>$this->naam];
}
}
private function setOnderdelen(){
$this->onderdelencs []= $this->onderdeelcs;
}
private function setCompacteOnderdelen(){
$this->compacteonderdelen= [
'schoolgegevens' => $this->schoolpartial,
'legenda' => $this->legenda,
'onderdelen' => $this->onderdelencs,
'schooljaarnr' => $this->schooljaarnr,
'schooljaar' => $this->schooljaar->naam,
'schoolnaam' => $this->organisatie->naam
];
}
}
@@ -0,0 +1,262 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class CompactePaginas
{
private $CI;
private $schooljaarnr;
private $schooljaar;
private $schoolnaam;
private $onderdeel;
private $onderdelen;
private $onderdelendef;
private $schoolgegevens;
private $legenda;
private $paginahtml;
private $pagina;
private $paginas;
private $vorigepagina = 1;
private $aantalpaginas;
private $divBreed = 'F';
private $middelenBreed = 'F';
private $inspectieBreed = 'F';
private $compactarray;
private $boven;
private $onder;
private $linksboven;
private $rechtsboven;
private $linksonder;
private $rechtsonder;
private $blokjeshtml;
private $html;
private $sopid;
private $gegevens;
private $gegevensarray = [];
public function __construct($onderdelen){
$this->CI = &get_instance();
$this->compacteonderdelen = $onderdelen;
$this->handle();
}
public function getHtml(){
return $this->html;
}
public function getSopId(){
return $this->sopid;
}
private function handle(){
$this->setSchoolgegevens();
$this->setLegenda();
$this->setOnderdelen();
$this->setSchooljaarnr();
$this->SetSchooljaar();
$this->setSchoolnaam();
$this->loopOnderdelen();
$this->setAantalPaginas();
$this->maakPaginas();
$this->loopPaginas();
$this->loopGegevensArray();
$this->setHtml();
}
private function setSchoolgegevens(){
$this->schoolgegevens = $this->compacteonderdelen['schoolgegevens'];
}
private function setLegenda(){
$this->legenda = $this->compacteonderdelen['legenda'];
}
private function setOnderdelen(){
$this->onderdelen = $this->compacteonderdelen['onderdelen'];
}
private function setSchooljaarnr(){
$this->schooljaarnr = $this->compacteonderdelen['schooljaarnr'];
}
private function setSchooljaar(){
$this->schooljaar = $this->compacteonderdelen['schooljaar'];
}
private function setSchoolnaam(){
$this->schoolnaam = $this->compacteonderdelen['schoolnaam'];
}
private function loopOnderdelen(){
foreach($this->onderdelen as $index => $this->onderdeel ) {
$this->setDivBreedte();
$this->setMiddelenBreedte();
$this->setInspectieBreedte();
$this->setOnderdelenDef();
}
}
private function setDivBreedte(){
if (!$this->onderdeel['onderdeelnr']) return;
if($this->onderdeel['onderdeelnr'] != 1 || $this->divBreed== 'T') return;
$aantalGroepen = count($this->onderdeel['data']['data']['groepen']);
if($aantalGroepen > 8){
$this->divBreed = 'T';
$this->onderdeel['breed'] = 'T';
}
}
private function setMiddelenBreedte(){
if (!$this->onderdeel['onderdeelnr']) return;
if($this->onderdeel['onderdeelnr'] != 7 || $this->middelenBreed == 'T') return;
$this->middelenBreed = 'T';
$this->onderdeel['breed'] = 'T';
}
private function setInspectieBreedte(){
if (!$this->onderdeel['onderdeelnr']) return;
if($this->onderdeel['onderdeelnr'] != 8 || $this->inspectieBreed == 'T') return;
$this->inspectieBreed = 'T';
$this->onderdeel['breed'] = 'T';
}
private function setOnderdelenDef(){
$this->onderdelendef[] = $this->onderdeel;
}
private function setAantalPaginas(){
$ruimte = count($this->onderdelen);
if($this->divBreed == 'T'){
$ruimte = $ruimte + 1;
}
if($this->middelenBreed == 'T'){
$ruimte = $ruimte + 1;
}
if($this->inspectieBreed == 'T'){
$ruimte = $ruimte + 1;
}
$this->aantalpaginas = ceil($ruimte/4);
}
private function maakPaginas(){
for ($i = 0; $i < $this->aantalpaginas; $i++) {
$this->pagina = new stdClass;
$this->paginas [] = $this->pagina;
}
}
private function loopPaginas(){
foreach($this->paginas as $index=>$this->pagina){
$this->maakPaginaNummer($index);
$this->loopOnderdelendef();
$this->verzamelGegevens();
$this->setGegevensArray();
}
}
private function maakPaginaNummer($index){
$this->pagina->paginanummer = $index + 1;
}
private function loopOnderdelendef(){
foreach($this->onderdelendef as $index=> $this->onderdeel){
if(!$this->onderdeel['onderdeelnr']) continue;
if(intval($this->onderdeel['paginanr'])== $this->pagina->paginanummer) {
$this->setCompactArray();
$this->plaatsOnderdelenBreed();
$this->plaatsOnderdelenSmal();
}
}
}
private function setCompactArray(){
if(! isset($this->onderdeel['html']) || ! isset($this->onderdeel['data'])) return;
$this->compactarray = ['html' => $this->onderdeel['html'],
'data' => $this->onderdeel['data'] ];
}
private function plaatsOnderdelenBreed(){
if(! isset($this->onderdeel['html']) || ! isset($this->onderdeel['data'])) return;
if ($this->onderdeel['breed'] == 'F') return;
if ($this->onderdeel['bloknr'] == 1 || $this->onderdeel['bloknr'] == 2) $this->pagina->boven = $this->compactarray;
if ($this->onderdeel['bloknr'] == 3 || $this->onderdeel['bloknr'] == 4) $this->pagina->onder = $this->compactarray;
}
private function plaatsOnderdelenSmal(){
if(! isset($this->onderdeel['html']) || ! isset($this->onderdeel['data'])) return;
if ($this->onderdeel['breed']== 'T') return;
switch( $this->onderdeel['bloknr']){
case 1: $this->pagina->linksboven = $this->compactarray;
break;
case 2: $this->pagina->rechtsboven = $this->compactarray;
break;
case 3: $this->pagina->linksonder = $this->compactarray;
break;
case 4: $this->pagina->rechtsonder = $this->compactarray;
}
}
private function verzamelGegevens(){
$boven = false;
if(isset($this->pagina->boven) && $this->pagina->boven) $boven = $this->pagina->boven;
$linksboven = false;
if(isset($this->pagina->linksboven)&& $this->pagina->linksboven) $linksboven = $this->pagina->linksboven;
$rechtsboven = false;
if(isset($this->pagina->rechtsboven)&& $this->pagina->rechtsboven)$rechtsboven = $this->pagina->rechtsboven;
$onder = "";
if(isset($this->pagina->onder)&& $this->pagina->onder) $onder = $this->pagina->onder;
$linksonder = false;
if(isset($this->pagina->linksonder)&&$this->pagina->linksonder) $linksonder = $this->pagina->linksonder;
$rechtsonder = false;
if(isset($this->pagina->rechtsonder)&& $this->pagina->rechtsonder)$rechtsonder = $this->pagina->rechtsonder;
$this->gegevens = ['schoolgegevens' => $this->schoolgegevens,
'legenda' => $this->legenda,
'boven' => $boven,
'onder' => $onder,
'linksboven' => $linksboven,
'rechtsboven' => $rechtsboven,
'linksonder' => $linksonder,
'rechtsonder' => $rechtsonder,
'paginanummer' => $this->pagina->paginanummer,
'nieuwepagina' => false];
}
private function setGegevensArray(){
$this->gegevensarray[] = $this->gegevens;
}
private function loopGegevensArray(){
foreach($this->gegevensarray as $index => $this->gegevens){
$this->paginahtml = "";
$this->maakHtmlBlokjes();
$this->setBlokjesHtml();
}
}
private function maakHtmlBlokjes(){
$this->gegevens['nieuwepagina'] = false;
if ($this->pagina->paginanummer <> $this->vorigepagina) {
$this->gegevens['nieuwepagina'] = true;
$this->vorigepagina = $this->pagina->paginanummer;
}
$this->paginahtml = $this->CI->load->view("monpas/compactsop/blokjescompact", $this->gegevens, true);
}
private function setBlokjesHtml(){
if(!$this->paginahtml) return;
if ($this->blokjeshtml <= '') $this->blokjeshtml=$this->paginahtml;
else $this->blokjeshtml = $this->blokjeshtml .'<div style="page-break-before: always"></div>' .$this->paginahtml;
}
private function setHtml()
{
if (!$this->blokjeshtml) return;
$data = ['schooljaar' => $this->schooljaar];
$html = $this->CI->load->view("monpas/compactsop/paginacompact", $data, true);
$this->html = str_replace('##PLACEHOLDER##', $this->blokjeshtml, $html);
}
}
@@ -0,0 +1,238 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class CompacteVersies
{
private $CI;
private $schooljaar;
private $kalenderjaar1;
private $kalenderjaar2;
private $jaarnr1;
private $jaarnr2;
private $modulenr;
private $licentie;
private $selected;
private $erIsDiversiteit;
private $groepen;
private $aantallln;
private $onderdelen;
private $onderdeel;
private $erZijnBudgetten = 'F';
private $budgetten;
private $geopendeversies;
private $versie;
private $erIsEenVersie = 'F';
private $gevuldeversies;
private $gevuldeschooljaren;
private $gevuldschooljaar;
private $vormtekst;
private $filledversies;
private $filledversie;
public function getOnderdelen(){
return $this->onderdelen;
}
public function __construct( $schooljaarnr)
{
$this->CI =& get_instance();
$this->schooljaarnr = $schooljaarnr;
$this->handle();
}
private function handle()
{
$this->setSchooljaar();
$this->setKalenderjaren();
$this->setCompactSopOnderdelen();
$this->loopCompactSop();
}
private function setSchooljaar(){
$jaarid = $this->CI->Schooljaren_model->get_fieldvalue(['schooljaarnr'=>$this->schooljaarnr],'id');
$this->schooljaar = $this->CI->Schooljaren_model->get_record_by_id($jaarid);
}
private function setKalenderjaren(){
$this->kalenderjaar1 = substr($this->schooljaar->naam, 0, 4 );
$this->kalenderjaar2 = substr($this->schooljaar->naam, 5, 4);
$this->jaarnr1 = $this->CI->Kalenderjaren_model->get_fieldvalue(['naam' =>$this->kalenderjaar1], 'jaarnr');
$this->jaarnr2 = $this->CI->Kalenderjaren_model->get_fieldvalue(['naam' =>$this->kalenderjaar2], 'jaarnr');
if(!$this->jaarnr2) $this->jaarnr2 = intval($this->jaarnr1) + 1;
}
private function setCompactSopOnderdelen(){
$this->onderdelen = $this->CI->Compactsoponderdelen_model->getOnderdelen();
}
private function loopCompactSop(){
if ($this->onderdelen){
foreach($this->onderdelen as $index=> $this->onderdeel) {
$this->onderdeel->licentie = 'F';
$this->onderdeel->gegevens = 'F';
$this->setModuleMetLicentie();
$this->setExtraOmvang();
$this->setDivSchooltypes();
$this->setDiversiteit();
$this->setBudgetten();
$this->setGeopendeVersies();
$this->loopGeopendeVersies();
$this->setSelectedLijstOnderdelen();
}
}
}
private function setModuleMetLicentie(){
$this->onderdeel->modulenr = $this->CI->Compactsoponderdelen_model->getModuleMetLicentie($this->CI->globorgid, $this->onderdeel->nummer);
if($this->onderdeel->modulenr) $this->onderdeel->licentie = 'T';
}
private function setDivSchooltypes(){
if(!isset($this->onderdeel->modulenr)) return;
switch($this->onderdeel->modulenr){
case 1: $this->onderdeel->schooltype = 'Alle';
break;
case 2:
case 6: $this->onderdeel->schooltype = 'R';
break;
case 30:
case 40:
case 230: $this->onderdeel->schooltype = 'Alle';
break;
case 270:
case 300: $this->onderdeel->schooltype = 'SBO';
break;
case 340: $this->onderdeel->schooltype = 'R';
break;
case 350: $this->onderdeel->schooltype = 'SBO';
break;
case 360: $this->onderdeel->schooltype = 'SO';
break;
case 630: $this->onderdeel->schooltype = 'Alle';
break;
default: $this->onderdeel->schooltype = 'Alle';
}
}
private function setDiversiteit(){
if($this->onderdeel->nummer != 1) return;
$module = 2;
$this->aantallln = $this->CI->Groepen_model->getversiesmetleerlingen(
$this->CI->globorgid, $this->schooljaarnr, $this->onderdeel->schooltype, $module);
if(isset($this->aantallln)){
if ($this->aantallln > 0) {
$this->onderdeel->groepen = $this->CI->Groepen_model->get_AantalGroepen($this->schooljaarnr, $this->CI->globorgid, $module);
$this->onderdeel->erIsDiversiteit = 'T';
$this->onderdeel->gegevens = 'T';
if($this->onderdeel->schooltype = 'R') $this->onderdeel->schoolsoort = 'PO';
$this->onderdeel->versie = $this->schooljaar->naam. ', '. $this->onderdeel->schoolsoort;
}
}
}
private function setExtraOmvang(){
if($this->onderdeel->nummer != 3 || $this->onderdeel->licentie == 'F') return;
$schooljaren = $this->CI->Aantalleerlingen_model->get_gevuldeschooljaren_Sop($this->schooljaarnr, $this->CI->globorgid);
if($schooljaren && count($schooljaren) > 0) {
$this->onderdeel->gegevens = 'T';
$this->onderdeel->gevuldeschooljaren = $schooljaren;
foreach ($this->onderdeel->gevuldeschooljaren as $this->gevuldschooljaar) {
$this->gevuldschooljaar->erZijnTLVs = false;
$this->gevuldschooljaar->erZijnArrangementen = false;
$tlvs = $this->CI->Tlvs_model->getAantalTLVsSop($this->gevuldschooljaar->schooljaarnr, $this->CI->globorgid);
if ($tlvs) {
if ($tlvs > 0) $this->gevuldschooljaar->erZijnTLVs = true;
}
$arr = $this->CI->Arrangementen_model->getAantalLeerlingenMetArrangement($this->gevuldschooljaar->schooljaarnr, $this->CI->globorgid);
if ($arr) {
if ($arr > 0) $this->gevuldschooljaar->erZijnArrangementen = true;
}
}
}
}
private function setBudgetten(){
if($this->onderdeel->nummer != 7 || $this->onderdeel->licentie == 'F') return;
$this->onderdeel->budgetversies = [];
$this->budgetten = $this->CI->Finbestemmingen_model->getTotaalSchoolBestedingen($this->CI->globorgid, $this->jaarnr1);
if($this->budgetten > 0){
$this->onderdeel->budgetversies [] = $this->kalenderjaar1;
$this->onderdeel->erZijnBudgetten = 'T';
$this->onderdeel->gegevens = 'T';
}
$this->budgetten = $this->CI->Finbestemmingen_model->getTotaalSchoolBestedingen($this->CI->globorgid, $this->jaarnr2);
if(intval($this->budgetten) > 0){
$this->onderdeel->budgetversies [] = $this->kalenderjaar2;
$this->onderdeel->erZijnBudgetten = 'T';
$this->onderdeel->gegevens = 'T';
}
}
private function setGeopendeVersies(){
if($this->onderdeel->ijkpunten == 'F' || $this->onderdeel->licentie =='F') return;
$this->onderdeel->geopendeversies = $this->CI->Filledversions_model->getfilledversionsperorg(
$this->CI->globorgid, $this->onderdeel->modulenr);
}
private function loopGeopendeVersies(){
if($this->onderdeel->ijkpunten == 'F'|| $this->onderdeel->licentie =='F') return;
if(!$this->onderdeel->geopendeversies) return;
$this->onderdeel->erIsEenVersie= 'F';
$this->onderdeel->gegevens= 'F';
$this->onderdeel->filledversies = [];
foreach($this->onderdeel->geopendeversies as $index => $this->versie) {
$this->setFilledVersies();
}
}
private function setFilledVersies(){
$this->gevuldeversies = $this->CI->Scores_model->fGetGevuldeVersies(
$this->versie->id, $this->CI->globorgid);
if($this->gevuldeversies) {
if($this->versie->vorm == 1){
$this->vormtekst = 'schoolversie';
}
if($this->versie->vorm == 2){
$this->vormtekst = 'individuele versie';
}
$this->versie->naam = $this->versie->naam . ', periode: ' . $this->versie->periodenummer . ': ' . $this->versie->geldigvanaf . ' - ' . $this->versie->geldigtm .', '. $this->vormtekst;
$this->versie->naamkort = 'Periode: ' . $this->versie->periodenummer . ': ' . $this->versie->geldigvanaf . ' - ' . $this->versie->geldigtm;
$this->onderdeel->filledversies [] = $this->versie;
}
}
private function setSelectedLijstOnderdelen(){
if($this->onderdeel->licentie == 'F') return;
if($this->onderdeel->ijkpunten == 'F') return;
if(!isset($this->onderdeel->filledversies) || count($this->onderdeel->filledversies) == 0) return;
$this->onderdeel->erIsEenVersie = "T";
$this->onderdeel->gegevens = "T";
foreach($this->onderdeel->filledversies as $index => $this->filledversie) {
$this->filledversie->selected = 'F';
$valterin = $this->CI->Filledversions_model->checkperiode($this->versie->id,$this->schooljaar->start,
$this->schooljaar->eind );
if($valterin){
$this->filledversie->selected = 'T';
}
}
}
}
@@ -0,0 +1,215 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Afbeeldingen {
private $CI;
private $swvid;
private $scores;
private $score;
private $somscore;
private $kleuren;
private $kleurcodes;
private $orgversie;
private $gemiddelde;
private $nummer;
private $gem;
private $aantalscores = 0;
private $ijkpuntenok = 0;
private $welkehoogste = 0;
private $hoogstescore = -1;
private $welkelaagste = 0;
private $laagstescore = 101;
private $resultaten;
public function __construct($scoresObject, $modulenr, $orgversieid, $clusterid, $orgid, $zprocent){
$this->CI = & get_instance();
$this->scoresobject = $scoresObject;
$this->modulenr = $modulenr;
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->clusterid = $clusterid;
$this->zprocent = $zprocent;
$this->handle();
}
public function getScores(){
return $this->scores;
}
public function getResultaten(){
$gem ="";
if($this->gemiddelde){
$gem = $this->gemiddelde->gem;
}
$this->resultaten = [
'totgem' => $gem,
'ijkpuntenok' => $this->ijkpuntenok,
'welkehoogste' => $this->welkehoogste,
'hoogstescore' => round($this->hoogstescore, 1),
'welkelaagste' => $this->welkelaagste,
'laagstescore' => round($this->laagstescore, 1),
];
return $this->resultaten;
}
public function getKleuren(){
return $this->kleuren;
}
private function handle(){
$this->setScores();
$this->setSWVid();
$this->setOrgversie();
$this->setKleurcodes();
$this->setKleuren();
$this->loopScores1();
$this->setGemiddeldeScore();
$this->addGemiddeldeScore();
$this->loopScores2();
}
private function setScores(){
$this->scores = $this->scoresobject->getScores();
}
private function setSWVid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setOrgversie(){
$this->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
}
private function setKleurcodes(){
$this->kleurcodes = new Kleurcodes();
}
private function setKleuren(){
// $this->kleuren = $this->kleurcodes->getKleurcodesOrg($this->clusterid, $this->swvid);
// if(!$this->kleuren || $this->kleuren == " ") {
$this->kleuren = new stdClass();
$this->kleuren->cluster_id = $this->clusterid;
$this->kleuren->grens1 = '60';
$this->kleuren->grens2 = '80';
$this->kleuren->grens3 = '90';
$this->kleuren->grens4 = '100';
if($this->orgversie->scoretype ==7){
$this->kleuren->grens1 = '33';
$this->kleuren->grens2 = '66';
$this->kleuren->grens3 = '100';
}
// $this->kleuren->kleur1 = '#fe2219';
// $this->kleuren->kleur2 = '#fea719';
// $this->kleuren->kleur3 = '#15d029';
// $this->kleuren->kleur4 = '#1558d0';
$this->kleuren->kleur1 = '#e08885';
$this->kleuren->kleur2 = '#ffcc80';
$this->kleuren->kleur3 = '#9fdf9f';
$this->kleuren->kleur4 = '#99d6ff';
$this->kleuren->organisatie_id = '0';
// }
}
private function loopScores1(){
if(!$this->scores) return;
foreach ($this->scores as $index => $this->score) {
$this->berekenGemiddelden();
$this->setScoreSom();
$this->setAantalScores($index);
}
}
private function berekenGemiddelden(){
if(!$this->scores) return;
$this->score->gem = 0;
if($this->score->num > 0 ){
// $this->score->gem = round((($this->score->somscore/ $this->score->num)* 10)/10);
$this->score->gem = $this->score->somscore/ $this->score->num;
}
}
private function setScoreSom(){
$this->somscore = $this->somscore + $this->score->gem;
}
private function setAantalScores($index){
$this->aantalscores = $index + 1;
}
private function setGemiddeldeScore(){
if(!$this->scores || $this->aantalscores == 0) return;
$this->gemiddelde = new stdClass();
$this->gemiddelde->gem = $this->somscore / $this->aantalscores;
$this->gemiddelde->nummer = 'gem';
$this->score = $this->gemiddelde;
}
private function addGemiddeldeScore(){
if(!$this->scores || ! $this->gemiddelde) return;
array_push($this->scores, $this->score);
}
private function loopScores2(){
if (!$this->scores) return;
foreach ($this->scores as $index => $this->score) {
$this->setScoreNummer();
$this->rondScoresAf();
$this->setScoreKleuren();
$this->setResultatenOverzicht();
$this->telIJkpuntenok();
}
}
private function setScoreNummer(){
$this->score->huidig = 1;
if ($this->score->gem >= $this->kleuren->grens1) $this->score->huidig =2;
if ($this->score->gem >= $this->kleuren->grens2) $this->score->huidig =3;
if ($this->score->gem >= $this->kleuren->grens3) $this->score->huidig =4;
}
private function rondScoresAf(){
$this->score->gem = round($this->score->gem);
}
private function setScoreKleuren(){
switch ($this->score->huidig) {
case 1:
$this->score->kleur = $this->kleuren->kleur1;
break;
case 2:
$this->score->kleur = $this->kleuren->kleur2;
break;
case 3:
$this->score->kleur = $this->kleuren->kleur3;
break;
case 4:
$this->score->kleur = $this->kleuren->kleur4;
break;
default:
$this->score->kleur = '#ffffff';
}
}
private function setResultatenOverzicht(){
if ($this->score->gem > $this->hoogstescore) {
$this->hoogstescore = $this->score->gem;
$this->welkehoogste = $this->score->nummer;
}
if ($this->score->gem <= $this->laagstescore) {
$this->laagstescore = $this->score->gem;
$this->welkelaagste = $this->score->nummer;
}
}
private function telIJkpuntenok(){
if ($this->score->gem >= $this->zprocent) {
$this->ijkpuntenok++;
}
}
}
@@ -0,0 +1,39 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class BestuurScores
{
private $CI;
private $organisatie;
private $scores;
public function __construct( $orgversieid, $orgid, $vorm)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->vorm = $vorm;
$this->handle();
}
public function getScores(){
return $this->scores;
}
private function handle(){
$this->setOrg();
$this->setScores();
}
private function setOrg(){
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
}
private function setScores(){
$this->scores = $this->CI->Scores_model->calculateBG($this->orgversieid, $this->orgid);
}
}
@@ -0,0 +1,44 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class IndividueleScores
{
private $CI;
private $userid;
private $scores;
private $score;
public function __construct( $orgversieid, $orguserid, $orgid)
{
$this->CI = & get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->orguserid = $orguserid;
$this->teller = 0;
$this->handle();
}
public function getScores(){
return $this->scores;
}
private function handle(){
$this->setUserid();
$this->setScores();
$this->telScores();
}
private function setUserid(){
$this->userid = $this->CI->Orgusers_model->get_fieldvalue(['id' =>$this->orguserid], 'user_id');
}
private function setScores(){
$this->scores = $this->CI->Scores_model->calculateindividualscores($this->orgversieid, $this->orgid, $this->userid);
}
private function telScores(){
foreach($this->scores as $index => $this->score){
}
}
}
@@ -0,0 +1,70 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class KamerScores
{
private $CI;
private $organisatie;
private $kamerid;
private $kamernaam;
private $orgids;
private $scores;
public function __construct( $orgversieid, $orgid, $vorm)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->vorm = $vorm;
$this->handle();
}
public function getScores(){
return $this->scores;
}
public function getOrgnaam(){
return $this->kamernaam;
}
private function handle(){
$this->setOrg();
$this->setKamerOrgid();
$this->setKamernaam();
$this->setScholenString();
$this->setScores();
}
private function setOrg(){
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
}
private function setKamerOrgid(){
switch($this->organisatie->soort){
case 2: $this->kamerid = $this->orgid;
break;
case 3: $this->kamerid = $this->organisatie->valtonder_id;
break;
case 4: $bestuursid = $this->organisatie->valtonder_id;
$this->kamerid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$bestuursid], 'valtonder_id');
}
}
private function setKamernaam(){
$this->kamernaam = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->kamerid],'naamkort');
}
private function setScholenString(){
$this->orgids = implode(',' , $this->CI->Organisaties_model->getscholenondertarget($this->kamerid));
}
private function setScores(){
if(!$this->orgids) return;
$this->scores = $this->CI->Scores_model->calculateOverScholen($this->orgversieid, $this->orgids);
}
}
@@ -0,0 +1,496 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Lijsten
{
private $CI;
private $modulenr;
private $ijkpunten;
private $clusterid;
private $orgversieid;
private $orgversie;
private $vorm;
private $label;
private $label2;
private $jaartal;
private $versienaam;
private $soort;
private $aantal;
private $vNaam;
private $schoolScores;
private $gemiddeldeScores;
private $bestuurScores;
private $kamerScores;
private $swvScores;
private $schoolAfbeeldingen;
private $gemiddeldenAfbeeldingen;
private $bestuurAfbeeldingen;
private $kamerAfbeeldingen;
private $swvAfbeeldingen;
private $scores;
private $score;
private $onderorgs;
private $zprocent;
private $vergelijking;
private $vergelijkingen;
private $aantalscholen;
private $ambitiearray = [];
private $adviezen;
private $lijst;
private $lijsten = [];
private $nieuwste = 0;
private $periodenummer;
private $nieuwsteversie;
private $kleuren;
private $org;
private $orgstring;
private $sopinfo;
public function getLijsten(){
return $this->lijsten;
}
public function getNieuwsteVersie(){
return $this->nieuwsteversie;
}
public function getIJkpunten(){
return $this->ijkpunten;
}
public function getKleuren(){
return $this->kleuren;
}
public function getSopInfo(){
return $this->sopinfo;
}
public function __construct($orgid, $selecties){
$this->CI = & get_instance();
$this->orgid = $orgid;
$this->selecties = $selecties;
$this->handle();
}
private function handle(){
$this->setModulenummer();
$this->setClusterid();
$this->setSoort();
$this->setAantal();
$this->loopSelecties();
$this->loopLijsten();
$this->setKleuren();
$this->setSopInfo();
}
private function setModulenummer(){
$orgversieid = $this->selecties[0]['orgversieid'];
$versieid = $this->CI->Orgversies_model->get_fieldvalue(['id' => $orgversieid], 'versie_id');
$this->modulenr = $this->CI->Versies_model->get_fieldvalue(['id' => $versieid], 'modulenr');
}
private function setClusterid(){
$this->clusterid = $this->CI->Modules_model->get_fieldvalue(['sysnr' =>$this->modulenr], 'cluster_id');
}
private function setSoort(){
$this->soort = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->orgid], 'soort');
}
private function setAantal(){
$this->aantal = count($this->selecties);
}
private function loopSelecties(){
for($index = 0; $index < $this->aantal; $index++){
$this->versienaam = "";
$this->schoolScores = new stdClass();
$this->gemiddeldeScores = new stdClass();
$this->bestuurScores = new stdClass();
$this->swvScores = new StdClass();
$this->schoolAfbeeldingen = new stdClass();
$this->gemiddeldenAfbeeldingen = new stdClass();
$this->bestuurAfbeeldingen = new stdClass();
$this->swvScores = new stdClass();
$this->lijst = new stdClass();
$this->setOrgversieid($index);
$this->setIJkpunten($index);
$this->setVorm($index);
$this->setOrgversie();
$this->setVersieNaam();
$this->setOrgnaam();
$this->setBrin();
$this->setLabels();
$this->setAmbities();
$this->setZprocent();
$this->setSchoolScores();
$this->setIndividueleScores();
$this->setBestuurScores();
$this->setKamerScores();
$this->setSWVScores();
$this->setLijstScores();
$this->setGemiddeldeScores();
$this->setAdviezen();
$this->setGemiddeldenAdviezen();
$this->setVNaam();
$this->loopVergelijkingScores();
$this->setSchoolMetingen();
$this->setIndividueleMetingen();
$this->setMetingenVergelijking();
$this->setMetingenVergelijkingIndividueel();
$this->setResultaten();
$this->setLijsten();
}
}
private function setOrgversieid($index){
$this->lijst->orgversieid = $this->selecties[$index]['orgversieid'];
}
private function setIJkpunten($index){
if($index != 0) return;
$ijkpunten = $this->CI->Ijkpunten_model->getijkpunten($this->lijst->orgversieid);
foreach($ijkpunten as $ijkpunt){
$indicatoren= $this->CI->Indicatoren_model->getindicatoren($ijkpunt->id);
if($indicatoren){
$this->ijkpunten[] = $ijkpunt;
}
};
}
private function setVorm($index){
$this->lijst->vorm = $this->selecties[$index]['vorm'];
}
private function setOrgversie(){
$this->lijst->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->lijst->orgversieid);
$this->lijst->periodenummer = $this->lijst->orgversie->periodenummer;
$this->lijst->jaartal = substr($this->lijst->orgversie->geldigvanaf, 2,2);
$this->lijst->vantm = "periode " . $this->lijst->orgversie->periodenummer . " van " .
mysql2date($this->lijst->orgversie->geldigvanaf) . " t/m " . mysql2date($this->lijst->orgversie->geldigtm);
}
private function setVersieNaam(){
if($this->versienaam != "") return;
$this->versienaam = $this->CI->Versies_model->get_fieldvalue(['id' => $this->lijst->orgversie->versie_id], 'naam');
}
private function setOrgnaam(){
$this->lijst->orgnaam = $this->CI->Organisaties_model->get_fieldvalue(
['id' => $this->orgid], 'naam');
}
private function setBrin(){
if($this->soort != 4) return;
$this->lijst->brin = $this->CI->Organisaties_model->get_fieldvalue(['id' => $this->orgid], 'brin');
}
private function setLabels(){
$this->lijst->label = $this->CI->Labels_model->gettabellabel($this->modulenr);
$this->lijst->label2 = $this->CI->Labels_model->getresultaatlabel($this->modulenr);
}
private function setAmbities(){
$ambitie = $this->CI->Ambities_model->getOrgAmbities($this->lijst->orgversieid, $this->orgid);
if (!in_array($ambitie, $this->ambitiearray, FALSE)) {
$this->lijst->ambities = $ambitie;
$this->ambitiearray [] = $ambitie;
}
}
private function setZprocent(){
$this->zprocent = 0;
if(isset($this->lijst->ambities)){
$this->zprocent = $this->lijst->ambities->zprocent;
}
}
private function setSchoolScores(){
if ($this->soort != 4 || $this->lijst->vorm != 1) return;
$this->schoolScores = new SchoolScores($this->lijst->orgversieid, $this->orgid);
if($this->schoolScores) {
$this->schoolAfbeeldingen = new SchoolAfbeeldingen($this->schoolScores, $this->modulenr, $this->lijst->orgversieid,
$this->clusterid, $this->orgid);
}
}
private function setIndividueleScores(){
if($this->soort !=4 || $this->lijst->vorm != 2) return;
$this->gemiddeldeScores = new GemiddeldeScores($this->lijst->orgversieid, $this->orgid);
if($this->gemiddeldeScores){
$this->gemiddeldenAfbeeldingen = new GemiddeldenAfbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->lijst->orgversieid,
$this->clusterid, $this->orgid);
}
}
private function setBestuurScores()
{
if ($this->soort != 3) return;
$this->bestuurScores = new BestuurScores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm);
if ($this->bestuurScores) {
$this->bestuurAfbeeldingen = new Afbeeldingen($this->bestuurScores, $this->modulenr, $this->lijst->orgversieid,
$this->clusterid, $this->orgid, $this->zprocent);
}
}
private function setKamerScores(){
if($this->soort == 1) return;
$this->kamerScores = new KamerScores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm);
if($this->kamerScores) {
$this->kamerAfbeeldingen = new Afbeeldingen($this->kamerScores, $this->modulenr, $this->lijst->orgversieid,
$this->clusterid, $this->orgid, $this->zprocent);
}
}
private function setSWVScores(){
if ($this->soort == 3 || $this->soort == 4 ) return;
$this->swvScores = new SWVScores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm);
if($this->swvScores) {
$this->swvAfbeeldingen = new Afbeeldingen($this->swvScores, $this->modulenr, $this->lijst->orgversieid,
$this->clusterid, $this->orgid, $this->zprocent);
}
}
private function setLijstScores(){
switch($this->soort){
case 1:
if(empty($this->swvAfbeeldingen)) return;
$this->lijst->scores = $this->swvAfbeeldingen->getScores();
break;
case 2: if(empty($this->kamerAfbeeldingen)) return;
$this->lijst->scores = $this->kamerAfbeeldingen->getScores();
$this->lijst->vergelijkingen = $this->swvAfbeeldingen->getScores();
break;
case 3: if(empty($this->bestuurAfbeeldingen)) return;
$this->lijst->scores = $this->bestuurAfbeeldingen->getScores();
$this->lijst->vergelijkingen = $this->kamerAfbeeldingen->getScores();
break;
case 4: if(empty($this->schoolAfbeeldingen) && empty($this->gemiddeldenAfbeeldingen)) return;
if(count((array) $this->schoolAfbeeldingen) > 0) {
$this->lijst->scores = $this->schoolAfbeeldingen->getScores();
}
if(count((array)$this->gemiddeldenAfbeeldingen)> 0){
$this->lijst->scores = $this->gemiddeldenAfbeeldingen->getIJkpunten();
}
$this->lijst->vergelijkingen = $this->kamerAfbeeldingen->getScores();
break;
}
}
private function setGemiddeldeScores(){
if(count((array)$this->gemiddeldenAfbeeldingen) == 0) return;
foreach($this->lijst->scores as $index => $this->score){
$this->score->gem = 0;
if($this->score->score) {
$this->score->gem = $this->score->score;
}
}
}
private function setAdviezen(){
if(count((array)$this->schoolAfbeeldingen) == 0) return;
if($this->soort != 4) return;
$this->lijst->adviezen = $this->schoolAfbeeldingen->getAdviezen();
}
private function setGemiddeldenAdviezen(){
if(count((array)$this->gemiddeldenAfbeeldingen) == 0) return;
if($this->soort != 4) return;
$this->lijst->adviezen = $this->gemiddeldenAfbeeldingen->getAdviezen();
}
private function setVNaam(){
switch($this->soort){
case 1: $this->lijst->vNaam = null;
break;
case 2: $this->lijst->vNaam = $this->swvScores->getOrgnaam();
break;
case 3:
case 4: $this->lijst->vNaam = $this->kamerScores->getOrgnaam();
break;
}
}
private function loopVergelijkingScores(){
if( (!isset($this->lijst->vergelijkingen) || !$this->lijst->vergelijkingen)) return;
for($i = 0; $i < count($this->lijst->vergelijkingen); $i++){
$this->setVergelijkingScores($i);
}
}
private function setVergelijkingScores($i){
if($this->lijst->scores[$i]) {
$this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem;
$this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur;
}
}
private function setSchoolMetingen(){
if($this->lijst->vorm != 1) return;
if(!$this->lijst->scores) $this->lijst->metingen = 0;
else if ($this->soort == 4) $this->lijst->metingen = 1;
else {
if(! isset($this->lijst->scores[0]->aantalscholen)) $this->lijst->metingen = 0;
else {
$this->lijst->metingen = $this->lijst->scores[0]->aantalscholen;
}
}
}
private function setIndividueleMetingen(){
if (!isset($this->lijst->scores)) return;
if ($this->lijst->vorm != 2) return;
$this->lijst->metingen = 0;
if ($this->soort == 4) {
$gevuld = $this->CI->Scores_model->fCountGevuldeVersies($this->lijst->orgversieid, $this->orgid);
if($gevuld){
$this->lijst->metingen = count($gevuld);}
};
if ($this->soort == 3) {
$gevuld = $this->CI->Scores_model->fCountGevuldeBestuurVersies($this->lijst->orgversieid, $this->orgid);
if($gevuld){
$this->lijst->metingen = count($gevuld);}
};
if ($this->soort == 2) {
$this->onderorgs = $this->CI->Organisaties_model->getscholenonderkamer($this->orgid);
$this->setGevuldeVersies12();
$metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSWVVersies($this->lijst->orgversieid, $this->orgstring);
if($metingen){
$this->lijst->metingen = $metingen;
}
};
if ($this->soort == 1) {
$this->onderorgs = $this->CI->Organisaties_model->getscholenonderswv($this->orgid);
$this->setGevuldeVersies12();
$metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSwvVersies($this->lijst->orgversieid, $this->orgstring);
if($metingen){
$this->lijst->metingen = $metingen;
}
};
}
private function setGevuldeVersies12(){
$orgids = [];
if (count($this->onderorgs) > 0) {
foreach ($this->onderorgs as $index => $this->org) {
$orgids[] = $this->org->id;
}
$this->orgstring = implode(',', $orgids);
} else $this->orgstring = false;
}
private function setMetingenVergelijking(){
if(!isset($this->lijst->vergelijkingen) || !($this->lijst->vergelijkingen)) return;
if($this->lijst->vorm != 1) return;
foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) {
$this->lijst->metingenV= 0;
if(! isset($this->lijst->vergelijking->aantalscholen)){continue;}
$this->lijst->metingenV = $this->lijst->vergelijking->aantalscholen;
break;
}
}
private function setMetingenVergelijkingIndividueel(){
if(! isset($this->lijst->vergelijkingen )|| ! ($this->lijst->vergelijkingen)) return;
if($this->lijst->vorm != 2) return;
$this->lijst->metingenV = new stdClass();
$this->lijst->metingenV = 0;
foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) {
if(! isset($this->lijst->vergelijking->aantallijsten)){continue;}
$this->lijst->metingenV = $this->lijst->vergelijking->aantallijsten;
break;
}
}
private function setResultaten(){
switch($this->soort) {
case 1: if(count((array)$this->swvAfbeeldingen)==0 ) return;
$this->lijst->resultaten = $this->swvAfbeeldingen->getResultaten();
break;
case 2: if(count((array)$this->kamerAfbeeldingen) ==0) return;
$this->lijst->resultaten = $this->kamerAfbeeldingen->getResultaten();
break;
case 3: if(count((array)$this->bestuurAfbeeldingen)== 0) return;
$this->lijst->resultaten = $this->bestuurAfbeeldingen->getResultaten();
break;
case 4: if (count((array)$this->schoolAfbeeldingen)==0 && count((array)$this->gemiddeldenAfbeeldingen)==0)return;
if(count((array)$this->schoolAfbeeldingen) > 0) {
$this->lijst->resultaten = $this->schoolAfbeeldingen->getResultaten();
}
if(count((array)$this->gemiddeldenAfbeeldingen) > 0){
$this->lijst->resultaten = $this->gemiddeldenAfbeeldingen->getResultaten();
}
break;
}
}
private function setLijsten(){
$this->lijsten [] = $this->lijst;
}
private function loopLijsten()
{
$this->nieuwste = 0;
foreach ($this->lijsten as $index => $this->lijst) {
if (!$this->lijst->orgversie) continue;
$this->setNieuwsteVersie();
}
}
private function setNieuwsteVersie(){
if ($this->lijst->orgversie->periodenummer > $this->nieuwste) {
$this->nieuwste = $this->lijst->orgversie->periodenummer;
$this->nieuwsteversie = $this->lijst->orgversieid;
}
}
private function setKleuren(){
if(count((array)$this->gemiddeldenAfbeeldingen)> 0){
$this->kleuren = $this->gemiddeldenAfbeeldingen->getKleuren();
}
else if(count((array)$this->kamerAfbeeldingen)> 0){
$this->kleuren = $this->kamerAfbeeldingen->getKleuren();
}
else if(count((array)$this->swvAfbeeldingen)> 0){
$this->kleuren = $this->swvAfbeeldingen->getKleuren();
}
}
private function setSopInfo(){
$this->sopinfo = [
'lijsten' => $this->lijsten,
'aantal' => $this->aantal,
'nieuwsteversie' => $this->nieuwsteversie,
'kleuren' => $this->kleuren,
'versienaam' => $this->versienaam,
];
}
}
@@ -0,0 +1,70 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class SWVScores
{
private $CI;
private $organisatie;
private $swvid;
private $swvnaam;
private $orgids;
private $scores;
public function __construct( $orgversieid, $orgid, $vorm)
{
$this->CI =& get_instance();
$this->orgversieid = $orgversieid;
$this->orgid = $orgid;
$this->vorm = $vorm;
$this->handle();
}
public function getScores(){
return $this->scores;
}
public function getOrgnaam(){
return $this->swvnaam;
}
private function handle(){
$this->setOrg();
$this->setSWVid();
$this->setSWVnaam();
$this->setScholenString();
$this->setScores();
}
private function setOrg(){
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
}
private function setSWVid(){
switch($this->organisatie->soort){
case 1: $this->swvid = $this->orgid;
break;
case 2: $this->swvid = $this->organisatie->valtonder_id;
break;
case 3: $kamerid = $this->organisatie->valtonder_id;
$this->swvid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$kamerid], 'valtonder_id');
break;
case 4: $bestuurid = $this->organisatie->valtonder_id;
$kamerid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$bestuurid], 'valtonder_id');
$this->swvid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$kamerid], 'valtonder_id');
}
}
private function setSWVnaam(){
$this->swvnaam = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->swvid],'naamkort');
}
private function setScholenString(){
$this->orgids = implode(',' , $this->CI->Organisaties_model->getscholenondertarget($this->swvid));
}
private function setScores(){
$this->scores = $this->CI->Scores_model->calculateOverScholen($this->orgversieid, $this->orgids);
}
}
@@ -0,0 +1,192 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class UserLijsten
{
private $CI;
private $modulenr;
private $clusterid;
private $individueleScores;
private $kamerScores;
private $gemiddeldeScores;
private $individueleAfbeeldingen;
private $kamerAfbeeldingen;
private $gemiddeldenAfbeeldingen;
private $orgversieid;
private $scores;
private $vNaam;
private $zprocent;
private $vergelijking;
private $vergelijkingen;
private $ambitiearray = [];
private $lijst;
private $lijsten = [];
private $nieuwste = 0;
private $nieuwsteversie;
public function getLijsten(){
return $this->lijsten;
}
public function getNieuwsteVersie(){
return $this->nieuwsteversie;
}
public function __construct($orguserid, $orgid, $orgversies){
$this->CI =& get_instance();
$this->orguserid = $orguserid;
$this->orgid = $orgid;
$this->orgversies = $orgversies;
$this->handle();
}
private function handle(){
$this->setModulenummer();
$this->setClusterid();
$this->loopOrgVersies();
$this->loopLijsten();
}
private function setModulenummer(){
$this->modulenr = $this->CI->session->userdata('module');
}
private function setClusterid(){
$this->clusterid = $this->CI->Modules_model->get_fieldvalue(['sysnr' =>$this->modulenr], 'cluster_id');
}
private function loopOrgVersies(){
foreach($this->orgversies as $index => $this->orgversieid){
$this->lijst = new stdClass();
$this->setOrgversie();
$this->setLabels();
$this->setAmbities();
$this->setZprocent();
$this->setIndividueleAfbeeldingen();
$this->setKamerAfbeeldingen();
$this->setLijstScores();
$this->setGemiddeldenAfbeeldingen();
$this->loopVergelijkingScores();
$this->setIndividueleMetingen();
$this->setMetingenVergelijkingIndividueel();
$this->setVNaam();
$this->setResultaten();
$this->setLijsten();
}
}
private function setOrgversie(){
$this->lijst->orgversie = $this->CI->Orgversies_model->get_record_by_id($this->orgversieid);
$this->lijst->vantm = "periode " . $this->lijst->orgversie->periodenummer . " van " .
mysql2date($this->lijst->orgversie->geldigvanaf) . " t/m " . mysql2date($this->lijst->orgversie->geldigtm);
}
private function setLabels(){
$this->lijst->labels = $this->CI->Labels_model->getalllabels($this->modulenr);
}
private function setAmbities(){
$ambitie = $this->CI->Ambities_model->getOrgAmbities($this->orgversieid, $this->orgid);
if (!in_array($ambitie, $this->ambitiearray, FALSE)) {
$this->lijst->ambities = $ambitie;
$this->ambitiearray [] = $ambitie;
}
}
private function setZprocent(){
$this->zprocent = 0;
if(isset($this->lijst->ambities)){
$this->zprocent = $this->lijst->ambities->zprocent;
}
}
private function setIndividueleAfbeeldingen(){
$this->individueleScores = new IndividueleScores($this->orgversieid, $this->orguserid, $this->orgid);
$this->individueleAfbeeldingen = new Afbeeldingen($this->individueleScores, $this->modulenr, $this->orgversieid, $this->clusterid, $this->orgid, $this->zprocent);
}
private function setKamerAfbeeldingen(){
$vorm = 2;
$this->kamerScores = new KamerScores($this->orgversieid, $this->orgid, $vorm);
if($this->kamerScores){
$this->kamerAfbeeldingen = new Afbeeldingen($this->kamerScores, $this->modulenr, $this->orgversieid,
$this->clusterid, $this->orgid, $this->zprocent);
}
}
private function setLijstScores(){
if (!$this->kamerAfbeeldingen || !$this->individueleAfbeeldingen) return; {
$this->lijst->scores = $this->individueleAfbeeldingen->getScores();
$this->lijst->vergelijkingen = $this->kamerAfbeeldingen->getScores();
}
}
private function setGemiddeldenAfbeeldingen(){
$this->gemiddeldeScores= new GemiddeldeScores($this->orgversieid, $this->orgid);
if($this->gemiddeldeScores){
$this->gemiddeldenAfbeeldingen = new GemiddeldenAfbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->orgversieid, $this->clusterid,$this->orgid);
}
}
private function loopVergelijkingScores(){
if( (!isset($this->lijst->vergelijkingen))) return;
for($i = 0; $i < count($this->lijst->vergelijkingen); $i++){
$this->setVergelijkingScores($i);
}
}
private function setVergelijkingScores($i){
if($this->lijst->scores[$i]) {
$this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem;
$this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur;
}
}
private function setIndividueleMetingen(){
if(!isset($this->lijst->scores)) return;
$this->lijst->metingen = $this->gemiddeldeScores->getAantalLeerkrachten();
}
private function setMetingenVergelijkingIndividueel(){
if(! isset($this->lijst->vergelijkingen)) return;
foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) {
$this->lijst->metingenV = $this->lijst->vergelijking->aantallijsten;
return;
}
}
private function setVNaam(){
$this->lijst->vNaam = $this->kamerScores->getOrgnaam();
}
private function setResultaten(){
if(!$this->gemiddeldenAfbeeldingen) return;
$this->lijst->resultaten = $this->gemiddeldenAfbeeldingen->getResultaten();
}
private function setLijsten(){
$this->lijsten [] = $this->lijst;
}
private function loopLijsten()
{
$this->nieuwste = 0;
foreach ($this->lijsten as $index => $this->lijst) {
if (!$this->lijst->orgversie) continue;
$this->setNieuwsteVersie();
}
}
private function setNieuwsteVersie(){
if ($this->lijst->orgversie->periodenummer > $this->nieuwste) {
$this->nieuwste = $this->lijst->orgversie->periodenummer;
$this->nieuwsteversie = $this->lijst->orgversie->id;
}
}
}
@@ -0,0 +1,203 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class VergelijkbareVersies
{
private $CI;
private $soort;
private $orgids;
private $versies;
private $versie;
private $versieid;
private $vergelijkbaar = false;
private $versiesarray = [];
private $checkarray = [];
private $versieinfo;
private $series = [];
private $aantal;
private $teller = 0;
private $orgversieid;
private $periode;
private $specificaties = [];
private $filledids;
public function getSeries(){
return $this->series;
}
public function __construct($orgid, $modulenr){
$this->CI =& get_instance();
$this->orgid = $orgid;
$this->modulenr = $modulenr;
$this->handle();
}
private function handle(){
$this->setOrgSoort();
$this->setScholenString();
$this->setSchoolVersies();
$this->loopVersies();
$this->setAantal();
$this->loopVersiesarray();
$this->LoopSeries();
}
private function setOrgSoort(){
$this->soort = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->orgid], 'soort');
}
private function setScholenString(){
$this->orgids = implode(',', $this->CI->Organisaties_model->getscholenondertarget($this->orgid));
}
private function setSchoolVersies(){
if($this->soort == 4){
$this->versies = $this->CI->Filledversions_model->gettevergelijkenschoolversies1school(
$this->orgid, $this->modulenr);
}
else {
$this->versies = $this->CI->Filledversions_model->gettevergelijkenschoolversies(
$this->orgids, $this->modulenr);
}
}
private function loopVersies(){
if(!$this->versies) return;
foreach($this->versies as $index => $this->versie){
$this->setGevuldeVersiesArray();
}
}
private function setGevuldeVersiesArray(){
if($this->soort ==4){
$this->filledids = $this->CI->Scores_model->fGetGevuldeVersies($this->versie->orgversieid, $this->orgid);
}
else {
if($this->orgids){
$this->filledids = $this->CI->Scores_model->fGetGevuldeSWVVersies($this->versie->orgversieid, $this->orgids);
}
}
if($this->filledids){
$this->versiesarray [] = $this->versie;
}
}
private function setAantal(){
if(!$this->versiesarray) return;
$this->aantal = count($this->versiesarray);
}
private function loopVersiesarray(){
if(!$this->versiesarray) return;
for($i = 0; $i < $this->aantal; $i++) {
$this->setEersteWaardeVerzamelarray($i);
$this->setCheckarray($i);
$this->setTeller();
$this->innerLoopVersiesArray($i);
$this->setSeries();
}
}
private function setEersteWaardeVerzamelarray($i){
$this->versieinfo = new stdClass();
$this->versieinfo->status = 'F';
if($this->vergelijkbaar == true) return;
if(in_array($this->versiesarray[$i]->orgversieid, $this->checkarray)) return;
$this->versieinfo->status = 'T';
$this->versieinfo->versieid = $this->versiesarray[$i]->versieid;
$this->versieinfo->naam = $this->versiesarray[$i]->naam;
$this->versieinfo->scoretype = $this->versiesarray[$i]->scoretype;
$this->versieinfo->omschrijving = $this->versiesarray[$i]->omschrijving;
$this->versieinfo->orgversieids = [];
$this->versieinfo->orgversieids [] = $this->versiesarray[$i]->orgversieid;
$this->versieinfo->specificaties = [];
}
private function setTeller(){
if($this->teller === false) return;
if($this->teller < $this->aantal) {
$this->teller ++;
}
else{
$this->teller = false;
}
}
private function innerLoopVersiesArray($i){
if($this->teller === false) return;
if($this->aantal <= 1) return;
for($x = $this->teller; $x < $this->aantal; $x++) {
$this->checkVergelijkbaar($i, $x);
$this->setOrgversieid($x);
}
}
private function checkVergelijkbaar($i, $x){
if($this->aantal <= 1) return;
if($this->versiesarray[$i]->orgversieid == $this->versiesarray[$x]->orgversieid) return;
if($this->versiesarray[$i]->versieid == $this->versiesarray[$x]->versieid &&
// $this->versiesarray[$i]->vorm == $this->versiesarray[$x]->vorm &&
$this->versiesarray[$i]->scoretype == $this->versiesarray[$x]->scoretype){
$this->checkarray [] = $this->versiesarray[$x]->orgversieid;
$this->vergelijkbaar = true;
}
else{
$this->vergelijkbaar = false;
}
}
private function setOrgversieid($x){
if ($this->vergelijkbaar == false) return;
$this->versieinfo->orgversieids [] = $this->versiesarray[$x]->orgversieid;
}
private function setCheckarray($x){
$this->checkarray [] = $this->versiesarray[$x]->orgversieid;
}
private function setSeries(){
if($this->teller === false) return;
if($this->versieinfo->status == 'F') return;
$this->series [] = $this->versieinfo;
}
private function LoopSeries(){
if (!$this->series) return;
foreach($this->series as $index => $this->versieinfo) {
$this->loopOrgversieIDs();
}
}
private function loopOrgversieIDs(){
$this->specificaties = [];
if(!isset($this->versieinfo->orgversieids)) return;
foreach($this->versieinfo->orgversieids as $key => $this->orgversieid){
$this->setPeriode();
$this->vulSpecificaties();
$this->setSpecificaties();
}
}
private function setPeriode(){
$this->periode = $this->CI->Orgversies_model->getVersieInfo($this->orgversieid);
}
private function vulSpecificaties(){
$this->specificaties[]=$this->periode;
}
private function setSpecificaties(){
$this->versieinfo->specificaties = $this->specificaties;
}
}
@@ -0,0 +1,458 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class DivMonitor
{
private $CI;
private $orgid;
private $swvid;
private $normaantallen;
private $groep12 = 22;
private $groep38 = 24;
private $factoren;
private $indeling;
private $criterium;
private $criteriumtot;
private $criteriumgem;
private $scholen;
private $school;
private $groep;
private $leerjaren;
private $combiwaarde =0;
private $combitot = 0;
private $llnschool =0;
private $llncriterium = 0;
private $aantallln = 0;
private $normschooltot = 0;
private $niveau;
private $aantal;
private $aantalgroepen;
private $aantalschoolgroepen;
private $aantalgroepencrit;
private $aantallenpercat;
private $aantalpercat;
private $aantalmetvraag;
private $schooltgd;
private $oov = 0;
private $dq =0;
private $tgd =0;
private $usedaantalscholen;
private $grandtotals;
private $maxdq;
private $mindq;
private $maxoov;
private $criteriumcat1;
private $criteriumoov;
private $criteriumtgd;
private $criteriumdq;
private $beschikbaar = 'F';
private $monitor;
public function __construct($schooljaarnr, $criteriumid, $module, $indeling){
$this->CI =& get_instance();
$this->schooljaarnr = $schooljaarnr;
$this->criteriumid = $criteriumid;
$this->module = $module;
$this->indeling = $indeling;
$this->handle();
}
public function getMonitor(){
return $this->monitor;
}
private function handle()
{
$this->setOrgid();
$this->setSWVid();
$this->setNormaantallen();
$this->setCombifactoren();
$this->setNulwaardenGrandtotals();
$this->loopIndeling();
$this->setBeschikbareGegevens();
$this->setMonitor();
}
private function setOrgid(){
$this->orgid = $this->CI->globorgid;
}
private function setSWVid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setNormaantallen(){
$normaantallen = $this->CI->Diversiteits_model->getnormaantallen($this->orgid, 'REGULIER');
if($normaantallen){
$this->normaantallen = $normaantallen;
}
else{
$this->normaantallen->groep12 = $this->groep12;
$this->normaantallen->groep38 = $this->groep38;
}
}
private function setCombifactoren(){
$this->factoren = $this->CI->Combifactoren_model->getfactoren($this->swvid);
}
private function setNulwaardenGrandtotals(){
$this->grandtotals = new stdClass();
$this->grandtotals->llng = new stdClass();
$this->grandtotals->cat1 = new stdClass();
$this->grandtotals->cat2 = new stdClass();
$this->grandtotals->cat3 = new stdClass();
$this->grandtotals->cat4 = new stdClass();
$this->grandtotals->llng = 0;
$this->grandtotals->cat1 = 0;
$this->grandtotals->cat2 = 0;
$this->grandtotals->cat3 = 0;
$this->grandtotals->cat4 = 0;
}
private function loopIndeling(){
$this->maxdq = new stdClass();
$this->mindq = new stdClass();
$this->maxoov = new stdClass();
$this->maxdq->dq = 0;
$this->mindq->dq = 100;
$this->maxoov->oov = 0;
foreach($this->indeling as $index => $this->criterium){
if(isset($this->criterium->scholen)){
$this->criterium->aantallln = 0;
$this->usedaantalscholen = 0;
$this->llncriterium = 0;
$this->criterium->aantal = 0;
$this->criterium->aantalgroepen = 0;
$this->aantalgroepencrit = 0;
$this->criteriumoov = 0;
$this->criteriumtgd = 0;
$this->criteriumdq = 0;
$this->criteriumcat1 = 0;
$this->criterium->cat1 = 0;
$this->criterium->cat2 = 0;
$this->criterium->cat3 = 0;
$this->criterium->cat4 = 0;
$this->loopScholen();
$this->setCriteriumWaarden();
$this->setCriteriumTotaal();
$this->setGemiddelden();
}
}
}
private function loopScholen(){
if(! $this->criterium->scholen) return;
foreach($this->criterium->scholen as $index => $this->school){
$this->llnschool = 0;
$this->school->combiwaarde = 0;
$this->school->aantalgroepen = 0;
$this->aantalschoolgroepen = 0;
$this->normschooltot = 0;
$this->school->oov = 0;
$this->aantallenPerCat();
$this->getGroepen();
$this->loopGroepen();
$this->setLeerlingenSchool();
$this->telScholenCriterium();
$this->setGroepenSchool();
$this->loopAantallenPerCat();
$this->setSchoolwaarden();
$this->telCriteriumwaarden();
$this->setGrandtotals();
$this->setMaxenMinDQ();
$this->setOOV();
}
}
private function aantallenPerCat(){
$this->aantallenpercat= $this->CI->Diversiteits_model->getaantallenpercategorie(
$this->school->id,$this->schooljaarnr,"R", $this->module);
}
private function getGroepen(){
$this->school->groepen = $this->CI->Groepen_model->getgroepen(
$this->school->id, $this->schooljaarnr, $this->module);
}
private function loopGroepen(){
if(!$this->school->groepen) return;
foreach($this->school->groepen as $index => $this->groep){
$this->setLeerjaren();
$this->telLeerjaren();
$this->setCombiwaarde();
$this->setCombiwaardeSchool();
$this->telAantalLeerlingenSchool();
$this->telGroepenSchool();
$this->setAantalLeerlingenCriterium();
$this->setNormSchoolTotaal();
}
}
private function setLeerjaren(){
$this->leerjaren = explode(';',$this->groep->niveau);
}
private function telLeerjaren(){
$this->groep->combi = count($this->leerjaren);
}
private function setCombiwaarde(){
if(! $this->factoren ) return;
// || $this->factoren->addtoschool != "T"
$this->groep->combiwaarde = 0;
if ($this->groep->combi ==2 && $this->groep->totaantal > 0)
$this->groep->combiwaarde = $this->factoren->combi2;
if ($this->groep->combi >= 3 && $this->groep->totaantal > 0)
$this->groep->combiwaarde = $this->factoren->combi3;
}
private function setCombiwaardeSchool(){
if(! $this->factoren ) return;
$this->school->combiwaarde = $this->school->combiwaarde + $this->groep->combiwaarde;
}
private function telAantalLeerlingenSchool(){
if($this->groep->totaantal == 0) return;
$this->llnschool = $this->llnschool + $this->groep->totaantal;
}
private function telGroepenSchool(){
$this->aantalschoolgroepen++;
}
private function telScholenCriterium(){
if($this->school->aantallln == 0) return;
$this->usedaantalscholen ++;
}
private function setAantalLeerlingenCriterium(){
$this->llncriterium = $this->llncriterium + $this->groep->totaantal;
}
private function setNormSchoolTotaal(){
if ((strpos($this->groep->niveau, '1') !== false) || (strpos($this->groep->niveau, '2') !== false) ){
$this->normschooltot = $this->normschooltot + $this->normaantallen->groep12;
}
else {
$this->normschooltot = $this->normschooltot + $this->normaantallen->groep38;
};
}
private function setLeerlingenSchool(){
$this->school->aantallln = $this->llnschool;
}
private function setGroepenSchool(){
if(!$this->school->groepen) return;
$this->school->aantalgroepen = $this->aantalschoolgroepen;
}
private function loopAantallenPerCat(){
$this->aantalmetvraag = 0;
$this->schooltgd = 0;
if(! $this->aantallenpercat) return;
foreach($this->aantallenpercat as $index=> $this->aantalpercat){
$this->setAantalMetVraag();
$this->setAantalPerCat();
$this->setCriteriumAantalPerCat();
$this->setGewogenAantal();
}
}
private function setAantalMetVraag(){
if(! $this->aantallenpercat) return;
$this->aantalmetvraag = $this->aantalmetvraag + $this->aantalpercat->sum;
}
private function setAantalPerCat()
{
if ($this->aantalpercat->nivo == 1) return;
$this->school->{'cat' . $this->aantalpercat->nivo} = $this->aantalpercat->sum;
}
private function setCriteriumAantalPerCat(){
switch($this->aantalpercat->nivo){
case 1:
break;
case 2: $this->criterium->cat2 = $this->criterium->cat2 + $this->aantalpercat->sum;
break;
case 3: $this->criterium->cat3 = $this->criterium->cat3 + $this->aantalpercat->sum;
break;
case 4: $this->criterium->cat4 = $this->criterium->cat4 + $this->aantalpercat->sum;
break;
}
}
private function setGewogenAantal(){
if($this->aantalpercat->nivo == 1) return;
switch($this->aantalpercat->nivo){
case 2:
$factor = 1.5;
break;
case 3:
$factor = 2;
break;
case 4:
$factor = 4;
break;
};
if($factor) {
$this->schooltgd = $this->schooltgd + ($this->aantalpercat->sum * $factor);
}
}
private function setSchoolwaarden(){
$this->school->cat1 = 0;
$this->school->oov = 0;
$this->school->dq = 0;
$this->school->tgd = 0;
if ($this->school->aantallln > 0) {
$this->school->oov = round(($this->aantalmetvraag / $this->school->aantallln) * 100);
$this->school->cat1 = $this->school->aantallln - $this->aantalmetvraag;
$this->school->tgd = $this->schooltgd + $this->school->combiwaarde + $this->school->cat1;
if ($this->normschooltot > 0) {
$this->school->dq = round(($this->school->tgd / $this->normschooltot), 2) ;
}
}
}
private function telCriteriumwaarden(){
$this->aantalgroepencrit = $this->aantalgroepencrit + $this->aantalschoolgroepen;
$this->criterium->cat1 = $this->criterium->cat1 + $this->school->cat1;
$this->criteriumoov = $this->criteriumoov + $this->school->oov;
$this->criteriumtgd = $this->criteriumtgd + $this->school->tgd;
$this->criteriumdq= $this->criteriumdq + $this->school->dq;
}
private function setGrandtotals(){
if($this->school->aantallln == 0) return;
$this->grandtotals->llng =$this->grandtotals->llng + $this->school->aantallln;
$this->grandtotals->cat1 = $this->grandtotals->cat1 + $this->school->cat1;
if (isset($this->school->cat2)) $this->grandtotals->cat2 = $this->grandtotals->cat2 + $this->school->cat2;
if (isset($this->school->cat3)) $this->grandtotals->cat3 = $this->grandtotals->cat3 + $this->school->cat3;
if (isset($this->school->cat4)) $this->grandtotals->cat4 = $this->grandtotals->cat4 + $this->school->cat4;
$this->grandtotals->cat234 = $this->grandtotals->cat2 + $this->grandtotals->cat3 + $this->grandtotals->cat4;
}
private function setMaxenMinDQ()
{
if (isset($this->school->dq) && $this->school->dq > 0) {
if ($this->school->dq > $this->maxdq->dq) {
$this->maxdq->school = $this->school->brin . " - " . $this->school->naamkort;
$this->maxdq->dq = $this->school->dq;
}
if ($this->school->dq < $this->mindq->dq) {
$this->mindq->school = $this->school->brin . " - " . $this->school->naamkort;
$this->mindq->dq = $this->school->dq;
}
}
}
private function setOOV(){
if (! isset($this->school->oov) || $this->school->oov <= $this->maxoov->oov) return;
$this->maxoov->school = $this->school->brin." - ".$this->school->naamkort;
$this->maxoov->oov = $this->school->oov;
}
private function setCriteriumWaarden(){
$this->criterium->aantalgroepen = 0;
$this->criterium->aantallln = 0;
// $this->criterium->cat1 = 0;
$this->criterium->oov = 0;
$this->criterium->tgd = 0;
$this->criterium->dq = 0;
if($this->llncriterium > 0) {
$this->criterium->aantallln = $this->llncriterium;
$this->criterium->aantalgroepen = $this->aantalgroepencrit;
// $this->criterium->cat1 = $this->criteriumcat1;
$this->criterium->oov = $this->criteriumoov;
$this->criterium->tgd = $this->criteriumtgd;
$this->criterium->dq = $this->criteriumdq;
}
}
private function setCriteriumTotaal(){
if(! $this->criterium->scholen) return;
$this->criteriumtot = new stdClass();
$this->criteriumtot->brin = '';
$this->criteriumtot->naam='Totaal '.$this->criterium->naam;
$this->criteriumtot->aantallln = $this->criterium->aantallln;
$this->criteriumtot->aantalgroepen = $this->criterium->aantalgroepen;
$this->criteriumtot->cat1= $this->criterium->cat1;
$this->criteriumtot->cat2= $this->criterium->cat2;
$this->criteriumtot->cat3= $this->criterium->cat3;
$this->criteriumtot->cat4= $this->criterium->cat4;
$this->criteriumtot->oov= null;
$this->criteriumtot->tgd= round($this->criterium->tgd);
$this->criteriumtot->dq=null;
array_push($this->criterium->scholen, $this->criteriumtot);
}
private function setGemiddelden(){
if(! $this->criterium->scholen) return;
$this->criteriumgem = new stdClass();
$this->criteriumgem->brin = '';
$this->criteriumgem->naam='Gemiddeld '.$this->criterium->naam;
$this->criteriumgem->aantallln = 0;
$this->criteriumgem->groepen = 0;
$this->criteriumgem->cat1 = 0;
$this->criteriumgem->cat2 = 0;
$this->criteriumgem->cat3 = 0;
$this->criteriumgem->cat4 = 0;
$this->criteriumgem->oov = 0;
$this->criteriumgem->tgd = 0;
$this->criteriumgem->dq = 0;
if($this->usedaantalscholen > 0) {
$this->criteriumgem->aantallln = round($this->criterium->aantallln / $this->usedaantalscholen);
$this->criteriumgem->groepen = round($this->criterium->aantalgroepen / $this->usedaantalscholen);
$this->criteriumgem->cat1 = round($this->criterium->cat1 / $this->usedaantalscholen);
$this->criteriumgem->cat2 = round($this->criterium->cat2 / $this->usedaantalscholen);
$this->criteriumgem->cat3 = round($this->criterium->cat3 / $this->usedaantalscholen);
$this->criteriumgem->cat4 = round($this->criterium->cat4 / $this->usedaantalscholen);
$this->criteriumgem->oov = round($this->criterium->oov / $this->usedaantalscholen);
$this->criteriumgem->tgd = round($this->criterium->tgd / $this->usedaantalscholen);
$this->criteriumgem->dq = round(($this->criterium->dq / $this->usedaantalscholen) * 100) / 100;
}
array_push($this->criterium->scholen,$this->criteriumgem);
}
private function setBeschikbareGegevens(){
if($this->grandtotals->llng > 0){
$this->beschikbaar = 'T';
}
}
private function setMonitor(){
$this->monitor = [
'bg' => $this->indeling,
'maxdq' => $this->maxdq,
'mindq' => $this->mindq,
'maxoov' => $this->maxoov,
'grandtotals' => $this->grandtotals,
'beschikbaar' => $this->beschikbaar
];
}
}
@@ -0,0 +1,170 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class IngedeeldeScholen
{
private $CI;
private $orgid;
private $orgsoort;
private $swvid;
private $indeling;
private $label;
private $scholen;
private $school;
private $schoolids = [];
private $schoollabel;
private $schoollabels =[];
private $verschil;
public function __construct($criteriumid, $module){
$this->CI =& get_instance();
$this->criteriumid = $criteriumid;
$this->module = $module;
$this->handle();
}
public function getIndeling(){
return $this->indeling;
}
private function handle()
{
$this->setOrgid();
$this->setOrgsoort();
$this->setSWVid();
$this->setIndelingPerBestuur();
$this->seteigenIndeling();
$this->setScholen();
$this->loopScholen();
$this->setVerschil();
$this->setNietIngedeeld();
$this->loopScholen2();
$this->voegNietIngedeeldToe();
}
private function setOrgid(){
$this->orgid = $this->CI->globorgid;
}
private function setOrgsoort(){
$this->orgsoort = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->orgid], "soort");
}
private function setSWVid(){
$this->swvid = $this->CI->Organisaties_model->get_swvid($this->orgid);
}
private function setIndelingPerBestuur(){
if($this->criteriumid != 0) return;
$this->indeling = $this->CI->Diversiteits_model->getbgsenscholenmetlicentie($this->orgid, $this->module);
}
private function setEigenIndeling(){
if($this->criteriumid == 0) return;
$this->indeling = $this->CI->Sorteerlabels_model->get_labels($this->criteriumid);
}
private function setScholen(){
if($this->criteriumid == 0) return;
switch ($this->orgsoort) {
case 3:
$this->scholen = $this->CI->Organisaties_model->getOrgsOnderBestuurMetLicentie($this->orgid, $this->module);
break;
case 2:
$this->scholen = $this->CI->Organisaties_model->getScholenOnderKamerMetLicentie($this->orgid, $this->module);
break;
case 1:
$this->scholen = $this->CI->Organisaties_model->getScholenOnderSwvMetLicentie($this->orgid, $this->module);
break;
}
}
private function loopScholen(){
if(!$this->scholen || !$this->indeling ||$this->criteriumid == 0) return;
foreach($this->scholen as $index => $this->school){
$this->setSchoolids();
$this->setSchoollabel();
$this->loopLabels();
}
}
private function setSchoolids(){
if($this->criteriumid == 0) return;
array_push($this->schoolids, $this->school->id);
}
private function setSchoolLabel(){
if($this->criteriumid == 0) return;
$this->school->schoollabel = $this->CI->Sorteerlabels_model->
getSchoolLabel($this->school->id, $this->criteriumid);
}
private function loopLabels(){
if( ! $this->school->schoollabel ||$this->criteriumid == 0) return;
foreach ($this->indeling as $index => $this->label){
if($this->label->waardeid == $this->school->schoollabel){
$this->setLabelOrgs();
$this->setSchoolLabels();
}
}
}
private function setLabelOrgs(){
if($this->criteriumid == 0) return;
if(! isset($this->label->scholen)){
$this->label->scholen = [];
}
array_push($this->label->scholen, $this->school);
}
private function setSchoolLabels(){
if($this->criteriumid == 0) return;
array_push($this->schoollabels, $this->school->id);
}
private function setVerschil()
{
if (!$this->scholen|| !$this->indeling ||$this->criteriumid == 0) return;
$this->verschil = array_diff($this->schoolids, $this->schoollabels);
}
private function setNietIngedeeld(){
if (!$this->scholen || ! $this->verschil||$this->criteriumid == 0) return;
$this->label = new stdClass();
$this->label->id = 0;
$this->label->sortering_id = $this->criteriumid;
$this->label->naam = 'niet ingedeeld';
$this->label->volgorde = 'LAATST';
$this->label->scholen = [];
}
private function loopScholen2(){
if(!$this->scholen|| !$this->indeling|| $this->criteriumid == 0) return;
foreach($this->scholen as $index=>$this->school){
$this->setScholenNietIngedeeld();
}
}
private function setScholenNietIngedeeld(){
if($this->criteriumid == 0) return;
if (in_array($this->school->id, $this->verschil)) {
array_push($this->label->scholen, $this->school);
}
}
private function voegNietIngedeeldToe(){
if(!$this->scholen|| !$this->indeling || !$this->verschil|| $this->criteriumid == 0) return;
array_push($this->indeling, $this->label);
}
}
@@ -0,0 +1,70 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Partituur_home {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
var $tokensecret;
function __construct(){
$CI =& get_instance();
$this->ci = $CI;
$models = array('shared/Organisaties_model',
'shared/Users_model',
'ijkpartituur/Pages_model',
'ijkpartituur/Partituurs_model',
'ijkpartituur/Reports_model',
'ijkpartituur/Modhelpdesk');
$this->ci->load->model($models);
}
public function index(){
if(!$this->ci->userid){
$this->ci->load->helper('url');
$this->ci->load->view('login_view');
}else {
// afhankelijk van de inloggegevens een pagina openen
// home_view verwacht een array $submenu
// als er geen partituur is, moet de pagina pijlers met popup nieuwe partituur worden geopend
// tenzij de organisatie = system
$orgnaam = $this->ci->Organisaties_model->get_record_by_id($this->ci->globorgid, 'naamkort');
$role = $this->ci->session->userdata('role');
if ($this->ci->globorgid == SYSTEM){
$menu = $this->ci->Pages_model->get_usermenu_ls($role, 0);
}
else {
$menu = $this->ci->Pages_model->get_usermenu_ls($role, 1);
}
$reports = $this->ci->Reports_model->get_reports_by_level();
$data = array("menu" => $menu ,
"orgnaam" => $orgnaam ,
"fullname" => $this->ci->Users_model->get_fullname($this->ci->userid) ,
'reports' => $reports
);
$this->ci->load->view('ijkpartituur/partituur_view', $data);
}
}
public function loadPartituur(){
$this->ci->session->userdata('partituur');
}
}
@@ -0,0 +1,130 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 28/01/2017
* Time: 14:00
*/
class ConvertToPdf {
private $ci;
private $dossier;
private $wordExtensions = ['.DOC', '.DOCX'];
private $pdfExtensions = ['.PDF'];
private $excelExtensions = ['.XLS', '.XSLX'];
private $word;
private $pdf;
private $excel;
private $conversionStatus;
public function __construct()
{
$this->ci = &get_instance();
$this->ci->load->library( 'services/curl/CurlWrapper' );
$this->ci->load->library( 'services/ConvertWord2PDF' );
$this->ci->load->config('conversionentities');
}
public function getConversionStatus()
{
return $this->conversionStatus;
}
public function handle( $dossier )
{
$this->setDossier( $dossier );
$this->setUploadType();
$this->convertContent();
$this->setNonConversion();
}
private function setdossier( $dossier )
{
$this->dossier = $dossier;
}
private function setUploadType()
{
$this->setWord();
$this->setPDF();
$this->setExcel();
}
private function setWord()
{
if ( in_array( strtoupper( $this->dossier->extension ), $this->wordExtensions ) )
return $this->word = TRUE;
$this->word = FALSE;
}
private function setPDF()
{
if ( in_array( strtoupper( $this->dossier->extension ), $this->pdfExtensions ) )
return $this->pdf = TRUE;
$this->pdf = FALSE;
}
private function setExcel()
{
if ( in_array( strtoupper( $this->dossier->extension ), $this->excelExtensions ) )
return $this->excel = TRUE;
$this->excel = FALSE;
}
private function convertContent()
{
$this->convertWord();
$this->convertPDF();
$this->convertExcel();
}
private function convertWord()
{
if ( ! $this->word ) return;
$this->ci->convertword2pdf->handle( $this->dossier );
if ( ! $this->ci->convertword2pdf->getConversionResult() )
return $this->conversionStatus = $this->ci->config->item('failedconversion');
$this->conversionStatus = $this->ci->config->item('wordpdfconversionsuccess');
}
private function convertPDF()
{
if ( ! $this->pdf ) return;
$this->conversionStatus = $this->ci->config->item('ispdfdocument');
}
private function convertExcel()
{
if ( ! $this->excel ) return;
$this->conversionStatus = $this->ci->config->item('nonconversion');
}
private function setNonConversion()
{
if ( $this->word ) return;
if ( $this->pdf ) return;
if ( $this->excel ) return;
$this->conversionStatus = $this->ci->config->item('nonconversion');
}
}
@@ -0,0 +1,124 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 28/01/2017
* Time: 14:20
*/
class ConvertWord2PDF {
private $ci;
private $pdf;
private $dossier;
private $remoteURL;
private $fileContent;
private $pdfFileLocation;
private $dossierFileName;
private $conversionResult;
public function __construct()
{
$this->ci = &get_instance();
$this->ci->config->load('remote_urls');
}
public function getConversionResult()
{
return $this->conversionResult;
}
public function handle( $dossier )
{
$this->setDossier( $dossier );
$this->setDossierFileName();
log_message('error', 'voor excists');
if ( ! $this->checkIfFileExists() ) return $this->conversionResult = FALSE;
log_message('error', 'file excist');
$this->setRemoteURL();
$this->setFileContent();
$this->ci->curlwrapper->handle(
$this->remoteURL, 'POST', ['filecontents' => $this->fileContent] );
$this->setPDF();
$this->setPdfFileLocation();
$this->checkAndCreatePdfFileLocation();
$this->setConversionResult();
if ( ! $this->conversionResult ) return;
$this->persistPdfFile();
}
private function setDossier( $dossier )
{
$this->dossier = $dossier;
}
private function setDossierFileName()
{
$this->dossierFileName =
$this->ci->dossierpath . $this->dossier->subfolder . $this->dossier->new_name;
}
private function checkIfFileExists()
{
if ( file_exists( $this->dossierFileName ) ) return TRUE;
return FALSE;
}
private function setRemoteURL()
{
$this->remoteURL =
$this->ci->config->item( 'PENSARE_SERVICE_URL' ) .
$this->ci->config->item( 'WORDPDF' );
}
private function setFileContent()
{
$this->fileContent =
file_get_contents( $this->dossierFileName );
$this->fileContent = base64_encode( $this->fileContent );
}
private function setPDF()
{
$this->pdf = $this->ci->curlwrapper->getResult();
}
private function setPdfFileLocation()
{
$this->pdfFileLocation = $this->ci->pdfpath;
}
private function checkAndCreatePdfFileLocation()
{
if ( file_exists( $this->pdfFileLocation ) ) return;
mkdir( $this->pdfFileLocation, 0755, TRUE );
}
private function setConversionResult()
{
if ( is_null( $this->pdf ) ) return $this->conversionResult = FALSE;
if ( ! $this->pdf ) return $this->conversionResult = FALSE;
$this->conversionResult = TRUE;
}
private function persistPdfFile()
{
file_put_contents(
$this->pdfFileLocation . $this->dossier->new_name, $this->pdf );
}
}
@@ -0,0 +1,88 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 27/11/2016
* Time: 16:00
*/
class CurlWrapper {
private $curl;
private $remoteURL;
private $method;
private $data;
private $result;
public function __construct()
{
}
public function getResult()
{
return $this->result;
}
public function handle( $remoteURL, $method = 'POST', $data = [] )
{
$this->initialize();
$this->setRemoteURL( $remoteURL );
$this->setMethod( $method );
$this->setData( $data );
$this->setCurlOptions();
$this->performRemoteCall();
$this->closeCurl();
// echo $this->result;
}
private function initialize()
{
$this->curl = curl_init();
}
private function setRemoteURL( $remoteURL )
{
$this->remoteURL = $remoteURL;
}
private function setMethod( $method )
{
$this->method = $method;
}
private function setData( $data )
{
$this->data = $data;
}
private function setCurlOptions()
{
curl_setopt_array( $this->curl, [
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $this->remoteURL,
CURLOPT_POST => $this->method == 'POST' ? TRUE : FALSE,
CURLOPT_POSTFIELDS => $this->data
]
);
}
private function performRemoteCall()
{
$this->result = curl_exec( $this->curl );
}
private function closeCurl()
{
curl_close( $this->curl );
}
}
@@ -0,0 +1,16 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 12/02/2017
* Time: 10:09
*/
use GuzzleHttp\Client;
class GuzzleWrapper {
}