Merge branch 'feature/streefcijfersperorg' into develop
# Conflicts: # application/core/MY_Controller.php # application/libraries/monpas/Schoolafbeeldingen.php
This commit is contained in:
@@ -16,9 +16,9 @@ class Gemiddeldenafbeeldingen {
|
||||
private $wens;
|
||||
private $ambities;
|
||||
private $adviezen = [];
|
||||
private $labels;
|
||||
// private $labels;
|
||||
private $kleuren;
|
||||
private $kleurcodes;
|
||||
// private $kleurcodes;
|
||||
private $orgversie;
|
||||
private $vantm;
|
||||
private $gemiddelde;
|
||||
@@ -50,347 +50,348 @@ class Gemiddeldenafbeeldingen {
|
||||
$this->setAmbities();
|
||||
$this->setIJkpunten();
|
||||
$this->setWensen();
|
||||
$this->handle();
|
||||
// $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';
|
||||
// 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->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){
|
||||
//// foreach($this->ijkpunten as $ijkpunt){
|
||||
//// if($ijkpunt->disabled == 'F'){
|
||||
//// $this->aantalY++;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
//// 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 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 || $this->ijkpunt->disabled =='T') {continue;};
|
||||
// $this->telScoresOp();
|
||||
// $this->setAantalScores();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
private function loopIJkpunten(){
|
||||
foreach($this->ijkpunten as $index =>$this->ijkpunt){
|
||||
if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score || $this->ijkpunt->disabled =='T') {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){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->orgversie->scoretype, $score);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
|
||||
return $kleur;
|
||||
}
|
||||
|
||||
private function setGemiddeldeScore(){
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->score = 0;
|
||||
$deler = $this->aantalY - $this->disablenvt;
|
||||
if($deler > 0) $this->gemiddelde->score = round($this->somscore / $deler);
|
||||
|
||||
|
||||
$this->gemiddelde->nummer = 'gem';
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$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(){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->orgversie->scoretype, $this->ijkpunt->score);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->ijkpunt->kleur = $kleur;
|
||||
|
||||
|
||||
|
||||
|
||||
// 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;
|
||||
// $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){
|
||||
// $kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->orgversie->scoretype, $score);
|
||||
// $kleur = $kleur->kleurcode;
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
//
|
||||
// return $kleur;
|
||||
// }
|
||||
//
|
||||
// private function setGemiddeldeScore(){
|
||||
// $this->gemiddelde = new stdClass();
|
||||
// $this->gemiddelde->score = 0;
|
||||
// $deler = $this->aantalY - $this->disablenvt;
|
||||
// if($deler > 0) $this->gemiddelde->score = round($this->somscore / $deler);
|
||||
//
|
||||
//
|
||||
// $this->gemiddelde->nummer = 'gem';
|
||||
// $this->gemiddelde->disabled = 'F';
|
||||
// $this->gemiddelde->disablenvt = 'F';
|
||||
// $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 addGewensteScores($index)
|
||||
{
|
||||
$this->ijkpunt->wens = 3;
|
||||
|
||||
if (isset($this->wensen) && isset($this->wensen[$index]) ) {
|
||||
$this->ijkpunt->wens = $this->wensen[$index]->wens;
|
||||
}
|
||||
}
|
||||
|
||||
private function setWensKleuren(){
|
||||
if(!isset($this->ijkpunt->wens)) return;
|
||||
|
||||
$kleur = $this->CI->Scorekleuren_model->getWensKleur($this->orgversie->scoretype, $this->ijkpunt->wens);
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->ijkpunt->wenskleur = $kleur;
|
||||
|
||||
|
||||
|
||||
// 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 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;
|
||||
// }
|
||||
}
|
||||
|
||||
private function setAdvies(){
|
||||
if(isset($this->ijkpunt->wens) &&
|
||||
$this->ijkpunt->huidig < $this->ijkpunt->wens &&
|
||||
|
||||
$this->ijkpunt->wens!= 0 &&
|
||||
isset($this->ijkpunt->omschrijving ) &&
|
||||
$this->ijkpunt->disabled == 'F' &&
|
||||
$this->ijkpunt->disablenvt == 'F'){
|
||||
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
|
||||
];
|
||||
}
|
||||
// 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(){
|
||||
// $kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->orgversie->scoretype, $this->ijkpunt->score);
|
||||
// $kleur = $kleur->kleurcode;
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
// $this->ijkpunt->kleur = $kleur;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//// 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) && isset($this->wensen[$index]) ) {
|
||||
// $this->ijkpunt->wens = $this->wensen[$index]->wens;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private function setWensKleuren(){
|
||||
// if(!isset($this->ijkpunt->wens)) return;
|
||||
//
|
||||
// $kleur = $this->CI->Scorekleuren_model->getWensKleur($this->orgversie->scoretype, $this->ijkpunt->wens);
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
// $this->ijkpunt->wenskleur = $kleur;
|
||||
//
|
||||
//
|
||||
//
|
||||
//// 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->wens!= 0 &&
|
||||
// isset($this->ijkpunt->omschrijving ) &&
|
||||
// $this->ijkpunt->disabled == 'F' &&
|
||||
// $this->ijkpunt->disablenvt == 'F'){
|
||||
// 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
|
||||
// ];
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -7,28 +7,42 @@ class Gemiddeldescores
|
||||
private $ijkpunt;
|
||||
private $leerkrachten;
|
||||
private $leerkracht;
|
||||
private $scores = [];
|
||||
private $score;
|
||||
private $wensen;
|
||||
private $aantalY;
|
||||
private $ijkpuntenok = 0;
|
||||
private $scoreteller;
|
||||
private $slaover = false;
|
||||
private $ambities;
|
||||
private $gemiddeldescores;
|
||||
private $adviezen= [] ;
|
||||
private $resultaten;
|
||||
private $metingen = [];
|
||||
private $aantalnvt = 0;
|
||||
private $aantalscores;
|
||||
private $somscore = 0;
|
||||
private $welkelaagste;
|
||||
private $welkehoogste;
|
||||
private $laagstescore = 110;
|
||||
private $hoogstescore = 0;
|
||||
|
||||
public function __construct($orgversieid, $orgid)
|
||||
|
||||
|
||||
public function __construct($orgversieid, $orgid, $scoretype)
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->scoretype = $scoretype;
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
public function getResults(){
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
public function getGemiddeldeScores()
|
||||
{
|
||||
return $this->gemiddeldescores->leerkrachten ? $this->gemiddeldescores : false;
|
||||
return $this->results->leerkrachten ? $this->results : false;
|
||||
}
|
||||
|
||||
public function getLeerkrachten()
|
||||
@@ -60,34 +74,108 @@ class Gemiddeldescores
|
||||
private function handle()
|
||||
{
|
||||
$this->setIJkpunten();
|
||||
$this->setOrg();
|
||||
$this->setKleuren();
|
||||
$this->setLeerkrachten();
|
||||
$this->setLeerkrachtScores();
|
||||
$this->setMetingen();
|
||||
$this->telIJkpunten();
|
||||
$this->loopIJkpunten();
|
||||
$this->setAmbities();
|
||||
$this->setWensen();
|
||||
$this->setGemiddeldeScores();
|
||||
$this->loopIJkpunten2();
|
||||
$this->setGemiddelde();
|
||||
$this->addGemiddeldeScore();
|
||||
$this->setResults();
|
||||
}
|
||||
|
||||
private function setIJkpunten(){
|
||||
$this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
}
|
||||
|
||||
private function setLeerkrachten()
|
||||
{
|
||||
private function setOrg(){
|
||||
$this->org = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$this->orgnaam = $this->org->brin? $this->org->brin . ' ' . $this->org->naamkort : $this->org->naamkort;
|
||||
}
|
||||
|
||||
private function setKleuren(){
|
||||
$this->kleuren = new stdClass();
|
||||
$this->kleuren->grens1 = '60';
|
||||
$this->kleuren->grens2 = '80';
|
||||
$this->kleuren->grens3 = '90';
|
||||
$this->kleuren->grens4 = '100';
|
||||
if($this->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 setLeerkrachten(){
|
||||
$this->leerkrachten = $this->CI->Filledversions_model->getlks($this->orgid, $this->orgversieid);
|
||||
}
|
||||
|
||||
private function setLeerkrachtScores()
|
||||
{
|
||||
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 setMetingen(){
|
||||
if (!isset($this->leerkrachten)) return;
|
||||
$this->metingen = new stdClass();
|
||||
$this->metingen->aantal = 0;
|
||||
$this->metingen->aantalorgs = 0;
|
||||
|
||||
if ($this->org->soort == 4) {
|
||||
$gevuld = $this->CI->Scores_model->fCountGevuldeVersies($this->orgversieid, $this->orgid);
|
||||
if($gevuld ){
|
||||
$this->metingen->aantal = $gevuld->aantal;
|
||||
$this->metingen->aantalorgs = 1;
|
||||
}
|
||||
};
|
||||
|
||||
if ($this->org->soort == 3) {
|
||||
$gevuld = $this->CI->Scores_model->fCountGevuldeBestuurVersies($this->orgversieid, $this->orgid);
|
||||
if($gevuld){
|
||||
$this->metingen->aantal = $gevuld->aantal;
|
||||
$this->metingen->aantalorgs = $gevuld->aantalorgs;}
|
||||
};
|
||||
|
||||
if ($this->org->soort == 2) {
|
||||
|
||||
$this->onderorgs = $this->CI->Organisaties_model->getscholenonderkamer($this->orgid);
|
||||
$this->setGevuldeVersies12();
|
||||
$metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSWVVersies($this->orgversieid, $this->orgstring);
|
||||
if($metingen){
|
||||
$this->metingen->aantal = $metingen->aantal;
|
||||
$this->metingen->aantalorgs = $metingen->aantalorgs;
|
||||
}
|
||||
};
|
||||
|
||||
if ($this->org->soort == 1) {
|
||||
$this->onderorgs = $this->CI->Organisaties_model->getscholenonderswv($this->orgid);
|
||||
$this->setGevuldeVersies12();
|
||||
$metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSwvVersies($this->orgversieid, $this->orgstring);
|
||||
if($metingen){
|
||||
$this->metingen->aantal = $metingen->aantal;
|
||||
$this->metingen->aantalorgs = $metingen->aantalorgs;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private function telIJkpunten(){
|
||||
if($this->ijkpunten){
|
||||
foreach($this->ijkpunten as $ijkpunt){
|
||||
@@ -109,6 +197,8 @@ class Gemiddeldescores
|
||||
$this->loopLeerkrachten();
|
||||
$this->setNietvanToepassing();
|
||||
$this->setIJkpuntGemiddeldeScores();
|
||||
$this->telScoresOp();
|
||||
$this->setAantalIJkpuntScores();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,6 +224,7 @@ class Gemiddeldescores
|
||||
$this->scoreteller = 0;
|
||||
foreach ($this->leerkracht->scores as $index => $this->score) {
|
||||
$this->setAantalScores();
|
||||
|
||||
if ($this->slaover == false) {
|
||||
$this->setIJkpuntTotaal();
|
||||
$this->telNietVanToepassing();
|
||||
@@ -147,6 +238,7 @@ class Gemiddeldescores
|
||||
$this->scoreteller++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function setIJkpuntTotaal()
|
||||
@@ -183,32 +275,222 @@ class Gemiddeldescores
|
||||
}
|
||||
}
|
||||
|
||||
private function setIJkpuntGemiddeldeScores()
|
||||
{
|
||||
private function setIJkpuntGemiddeldeScores(){
|
||||
if ($this->ijkpunt->aantallkrtn > 0) {
|
||||
$this->ijkpunt->score = $this->ijkpunt->totaal / $this->ijkpunt->aantallkrtn;
|
||||
$this->ijkpunt->score = round($this->ijkpunt->totaal / $this->ijkpunt->aantallkrtn);
|
||||
$this->ijkpunt->gem = round($this->ijkpunt->totaal / $this->ijkpunt->aantallkrtn);
|
||||
}
|
||||
else{
|
||||
$this->ijkpunt->score = 0;
|
||||
$this->ijkpunt->gem = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private function setAmbities()
|
||||
{
|
||||
$this->ambities = $this->CI->Ambities_model->getOrgAmbities($this->orgversieid, $this->orgid);
|
||||
private function telScoresOp(){
|
||||
if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score || $this->ijkpunt->disabled =='T') return;
|
||||
|
||||
$this->somscore = $this->somscore + $this->ijkpunt->score;
|
||||
}
|
||||
private function setAantalIJkpuntScores(){
|
||||
if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score || $this->ijkpunt->disabled =='T') return;
|
||||
if(!$this->ijkpunt->score) return;
|
||||
$this->aantalscores++;
|
||||
}
|
||||
|
||||
private function setWensen()
|
||||
{
|
||||
|
||||
|
||||
private function getKleur ($score){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $score);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
|
||||
return $kleur;
|
||||
}
|
||||
|
||||
|
||||
private function setAmbities(){
|
||||
$ambitieorgs = '';
|
||||
|
||||
$ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
$ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
|
||||
$toporgsarray = explode(',', $ambitieorgs);
|
||||
$toporgs = '';
|
||||
$index = 0;
|
||||
for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
if($index < 2) {
|
||||
$toporgs .= $toporgsarray[$i] . ',';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
$toporgs = rtrim($toporgs, ',' );
|
||||
|
||||
$this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
|
||||
}
|
||||
|
||||
private function setWensen(){
|
||||
$this->wensen = $this->CI->Wenssituaties_model->getgewenst($this->orgversieid, $this->orgid);
|
||||
}
|
||||
|
||||
private function setGemiddeldeScores()
|
||||
{
|
||||
private function loopIJkpunten2(){
|
||||
if(!$this->ijkpunten) return;
|
||||
|
||||
$this->gemiddeldescores = [
|
||||
"ijkpunten" => $this->ijkpunten,
|
||||
"leerkrachten" => $this->leerkrachten,
|
||||
"ambities" => $this->ambities,
|
||||
"wensen" => $this->wensen
|
||||
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->setAdviezen();
|
||||
$this->setResultatenOverzicht();
|
||||
$this->telIJkpuntenok();
|
||||
}
|
||||
}
|
||||
|
||||
private function setScoreNummer(){
|
||||
if($this->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->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(){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $this->ijkpunt->score);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->ijkpunt->kleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function addGewensteScores($index){
|
||||
$this->ijkpunt->wens = 3;
|
||||
|
||||
if (isset($this->wensen) && isset($this->wensen[$index]) ) {
|
||||
$this->ijkpunt->wens = $this->wensen[$index]->wens;
|
||||
}
|
||||
}
|
||||
|
||||
private function setWensKleuren(){
|
||||
if(!isset($this->ijkpunt->wens)) return;
|
||||
|
||||
$kleur = $this->CI->Scorekleuren_model->getWensKleur($this->scoretype, $this->ijkpunt->wens);
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->ijkpunt->wenskleur = $kleur;
|
||||
}
|
||||
|
||||
private function setAdviezen(){
|
||||
if(isset($this->ijkpunt->wens) &&
|
||||
$this->ijkpunt->huidig < $this->ijkpunt->wens &&
|
||||
|
||||
$this->ijkpunt->wens!= 0 &&
|
||||
isset($this->ijkpunt->omschrijving ) &&
|
||||
$this->ijkpunt->disabled == 'F' &&
|
||||
$this->ijkpunt->disablenvt == 'F'){
|
||||
$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->disablenvt == 'F') {
|
||||
$this->ijkpuntenok++;
|
||||
}
|
||||
}
|
||||
|
||||
private function setGemiddelde(){
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->score = 0;
|
||||
$deler = $this->aantalY - $this->aantalnvt;
|
||||
if($deler > 0) $this->gemiddelde->score = round($this->somscore / $deler);
|
||||
$this->gemiddelde->gem = $this->gemiddelde->score;
|
||||
$this->gemiddelde->nummer = 'gem';
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$this->gemiddelde->kleur = $this->getKleur ($this->gemiddelde->score);
|
||||
|
||||
}
|
||||
|
||||
private function addGemiddeldeScore(){
|
||||
if(! $this->gemiddelde) return;
|
||||
array_push($this->ijkpunten, $this->gemiddelde);
|
||||
|
||||
}
|
||||
|
||||
private function setResults()
|
||||
{
|
||||
$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),
|
||||
];
|
||||
|
||||
$this->results= [
|
||||
'orgnaam' => $this->orgnaam,
|
||||
'ijkpunten' => $this->ijkpunten,
|
||||
'leerkrachten' => $this->leerkrachten,
|
||||
'metingen' => $this->metingen,
|
||||
'ambities' => $this->ambities,
|
||||
'kleuren' => $this->kleuren,
|
||||
'wensen' => $this->wensen,
|
||||
'resultaten' => $this->resultaten,
|
||||
'adviezen' => $this->adviezen,
|
||||
'aantalY' => $this->aantalY
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ class Hoofdstuk
|
||||
private $sopkeuze;
|
||||
private $view;
|
||||
private $tab;
|
||||
//private $imagecode;
|
||||
private $tabelid;
|
||||
private $imagedata;
|
||||
private $vervangingscode;
|
||||
|
||||
@@ -29,162 +29,162 @@ class Inspectieafbeeldingen {
|
||||
$this->inspectieoordelen = $inspectieOordelen;
|
||||
$this->orgid = $orgid;
|
||||
$this->clusterid = 4;
|
||||
$this->handle();
|
||||
// $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
|
||||
];
|
||||
}
|
||||
// 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
|
||||
// ];
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -15,57 +15,57 @@ class Inspectieoordelen
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->clusterid = $clusterid;
|
||||
$this->handle();
|
||||
// $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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -40,354 +40,353 @@ class Schoolafbeeldingen {
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->clusterid = $clusterid;
|
||||
$this->setScores();
|
||||
$this->setAmbities();
|
||||
$this->setWensen();
|
||||
$this->setIJkpunten();
|
||||
$this->handle();
|
||||
// $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;
|
||||
}
|
||||
|
||||
public function getSomscore(){
|
||||
return $this->somscore;
|
||||
}
|
||||
|
||||
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->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){
|
||||
foreach($this->ijkpunten as $ijkpunt){
|
||||
if($ijkpunt->disabled == 'F'){
|
||||
$this->aantalY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 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';
|
||||
// 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;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function loopScores1(){
|
||||
if(!$this->scores) return;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
|
||||
$this->somscore = $this->somscore + $this->score->gem;
|
||||
|
||||
$this->aantalscores++;
|
||||
}
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){
|
||||
$this->disablenvt++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function setGemiddeldeScore(){
|
||||
if(!$this->scores || $this->aantalscores == 0) return;
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->gem = 0;
|
||||
$deler = $this->aantalY - $this->disablenvt;
|
||||
if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$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;
|
||||
$scoretype = $this->scores[0]->scoretype;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
$this->setScoreNummer();
|
||||
$this->rondScoresAf();
|
||||
$this->setScoreKleuren($scoretype);
|
||||
$this->addGewensteScores($index);
|
||||
$this->setWensKleuren($scoretype);
|
||||
$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($scoretype){
|
||||
|
||||
|
||||
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($scoretype, $this->score->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->kleur = $kleur;
|
||||
|
||||
|
||||
// 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';
|
||||
// $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;
|
||||
// }
|
||||
//
|
||||
// public function getSomscore(){
|
||||
// return $this->somscore;
|
||||
// }
|
||||
//
|
||||
// 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->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 addGewensteScores($index){
|
||||
$this->score->wens = 3;
|
||||
if ($this->wensen && $index < $this->aantalscores) {
|
||||
$this->score->wens = $this->wensen[$index]->wens;
|
||||
}
|
||||
}
|
||||
|
||||
private function setWensKleuren($scoretype){
|
||||
if(! isset($this->wensen)) return;
|
||||
if(!isset($this->score->wens)) return;
|
||||
$kleur = $this->CI->Scorekleuren_model->getWensKleur($scoretype, $this->score->wens);
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->wenskleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function setAdvies(){
|
||||
|
||||
if(isset($this->score->wens) &&
|
||||
$this->score->huidig < $this->score->wens &&
|
||||
$this->score->wens!= 0 &&
|
||||
$this->score->disabled == 'F' &&
|
||||
$this->score->disablenvt == 'F'){
|
||||
$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->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
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->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
if ($this->ambities && $this->score->gem >= $this->ambities->zprocent && $this->score->disabled == 'F') {
|
||||
$this->ijkpuntenok++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setKolombreedte(){
|
||||
if($this->aantalY > 1) $this->aantal = $this->aantalY;
|
||||
$kolombreedte = floor(($this->rij - $this->standaardorg)/$this->aantal);
|
||||
$this->kolomInt = $kolombreedte;
|
||||
$this->kolombreedte = $kolombreedte . 'px';
|
||||
}
|
||||
private function setOrgbreedte(){
|
||||
if($this->aantalY > 1){
|
||||
$this->aantal = $this->aantalY;}
|
||||
$orgbreedte = floor($this->rij - ($this->aantal * $this->kolomInt));
|
||||
$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,
|
||||
];
|
||||
}
|
||||
}
|
||||
// }
|
||||
//
|
||||
// private function telIJkpunten(){
|
||||
// if($this->ijkpunten){
|
||||
// foreach($this->ijkpunten as $ijkpunt){
|
||||
// if($ijkpunt->disabled == 'F'){
|
||||
// $this->aantalY++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// 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 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) {
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
//
|
||||
// $this->somscore = $this->somscore + $this->score->gem;
|
||||
//
|
||||
// $this->aantalscores++;
|
||||
// }
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){
|
||||
// $this->disablenvt++;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private function setGemiddeldeScore(){
|
||||
// if(!$this->scores || $this->aantalscores == 0) return;
|
||||
// $this->gemiddelde = new stdClass();
|
||||
// $this->gemiddelde->gem = 0;
|
||||
// $deler = $this->aantalY - $this->disablenvt;
|
||||
// if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
//
|
||||
// $this->gemiddelde->disabled = 'F';
|
||||
// $this->gemiddelde->disablenvt = 'F';
|
||||
// $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;
|
||||
// $scoretype = $this->scores[0]->scoretype;
|
||||
// foreach ($this->scores as $index => $this->score) {
|
||||
// $this->setScoreNummer();
|
||||
// $this->rondScoresAf();
|
||||
// $this->setScoreKleuren($scoretype);
|
||||
// $this->addGewensteScores($index);
|
||||
// $this->setWensKleuren($scoretype);
|
||||
// $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($scoretype){
|
||||
//
|
||||
//
|
||||
// $kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($scoretype, $this->score->gem);
|
||||
// $kleur = $kleur->kleurcode;
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
// $this->score->kleur = $kleur;
|
||||
//
|
||||
//
|
||||
//// 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($scoretype){
|
||||
// if(! isset($this->wensen)) return;
|
||||
// if(!isset($this->score->wens)) return;
|
||||
// $kleur = $this->CI->Scorekleuren_model->getWensKleur($scoretype, $this->score->wens);
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
// $this->score->wenskleur = $kleur;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private function setAdvies(){
|
||||
//
|
||||
// if(isset($this->score->wens) &&
|
||||
// $this->score->huidig < $this->score->wens &&
|
||||
// $this->score->wens!= 0 &&
|
||||
// $this->score->disabled == 'F' &&
|
||||
// $this->score->disablenvt == 'F'){
|
||||
// $omschrijving = "";
|
||||
// if(isset($this->score->omschrijving)){
|
||||
// $omschrijving = $this->score->omschrijving;
|
||||
// }
|
||||
// array_push($this->adviezen, ["nummer"=> $this->score->nummer, "omschrijving" =>$omschrijving]);
|
||||
// }
|
||||
// }
|
||||
// private function telIJkpuntenok()
|
||||
// {
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
// if ($this->ambities && $this->score->gem >= $this->ambities->zprocent && $this->score->disabled == 'F') {
|
||||
// $this->ijkpuntenok++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private function setResultatenOverzicht()
|
||||
// {
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
// 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 setKolombreedte(){
|
||||
// if($this->aantalY > 1) $this->aantal = $this->aantalY;
|
||||
// $kolombreedte = floor(($this->rij - $this->standaardorg)/$this->aantal);
|
||||
// $this->kolomInt = $kolombreedte;
|
||||
// $this->kolombreedte = $kolombreedte . 'px';
|
||||
// }
|
||||
// private function setOrgbreedte(){
|
||||
// if($this->aantalY > 1){
|
||||
// $this->aantal = $this->aantalY;}
|
||||
// $orgbreedte = floor($this->rij - ($this->aantal * $this->kolomInt));
|
||||
// $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,
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ class Schoolscores
|
||||
private $CI;
|
||||
private $ijkpunten;
|
||||
private $scores;
|
||||
private $score;
|
||||
private $ambities;
|
||||
private $wensen;
|
||||
private $schoolScores;
|
||||
@@ -16,59 +15,86 @@ class Schoolscores
|
||||
$this->CI =& get_instance();
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->handle();
|
||||
// $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->Ijkpunten_model->getijkpuntenMetIndicatoren($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];
|
||||
}
|
||||
// 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->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
// }
|
||||
//
|
||||
// private function setScores(){
|
||||
// $this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgid);
|
||||
// }
|
||||
//
|
||||
// private function setAmbities(){
|
||||
// $ambitieorgs = '';
|
||||
// $ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
// $ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
//
|
||||
// $toporgsarray = explode(',', $ambitieorgs);
|
||||
// $toporgs = '';
|
||||
// $index = 0;
|
||||
// for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
// if($index < 2) {
|
||||
// $toporgs .= $toporgsarray[$i] . ',';
|
||||
// $index++;
|
||||
// }
|
||||
// }
|
||||
// $toporgs = rtrim($toporgs, ',' );
|
||||
//
|
||||
// $this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
// }
|
||||
//
|
||||
// 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];
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
// $ambitieorgs .= $orgid . ',';
|
||||
// $valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
// if($valtonder != $orgid){
|
||||
// return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
// }
|
||||
//
|
||||
// return $ambitieorgs;
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Scores
|
||||
{
|
||||
private $CI;
|
||||
private $ijkpunten;
|
||||
private $aantalY = 0;
|
||||
private $scores;
|
||||
private $score;
|
||||
private $somscore;
|
||||
private $org;
|
||||
private $ambities;
|
||||
private $resultaten;
|
||||
private $wensen;
|
||||
private $adviezen= [];
|
||||
private $aantaldisablenvt = 0;
|
||||
private $aantalscores = 0;
|
||||
private $ijkpuntenok = 0;
|
||||
private $welkelaagste;
|
||||
private $welkehoogste;
|
||||
private $laagstescore = 110;
|
||||
private $hoogstescore = 0;
|
||||
private $gemiddelde;
|
||||
|
||||
|
||||
public function __construct( $orgversieid, $orgid, $scoretype, $isVergelijking)
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->scoretype= $scoretype;
|
||||
$this->isVergelijking = $isVergelijking;
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
public function getScores(){
|
||||
return $this->scores;
|
||||
}
|
||||
|
||||
public function getAmbities(){
|
||||
return $this->ambities;
|
||||
}
|
||||
|
||||
public function getWensen(){
|
||||
return $this->wensen;
|
||||
}
|
||||
|
||||
public function getIJkpunten(){
|
||||
return $this->ijkpunten;
|
||||
}
|
||||
|
||||
public function getResults(){
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
private function handle()
|
||||
{ $this->setIJkpunten();
|
||||
$this->telIJkpunten();
|
||||
$this->setOrglist();
|
||||
$this->setOrg();
|
||||
$this->setScores();
|
||||
$this->setMetingen();
|
||||
$this->setAmbities();
|
||||
$this->setWensen();
|
||||
$this->setKleuren();
|
||||
$this->loopScores1();
|
||||
$this->loopScores2();
|
||||
$this->setGemiddeldeScore();
|
||||
$this->addGemiddeldeScore();
|
||||
|
||||
$this->setResults();
|
||||
}
|
||||
|
||||
|
||||
private function setIJkpunten(){
|
||||
$this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
}
|
||||
|
||||
private function telIJkpunten(){
|
||||
if($this->ijkpunten){
|
||||
foreach($this->ijkpunten as $ijkpunt){
|
||||
if($ijkpunt->disabled == 'F'){
|
||||
$this->aantalY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setOrglist(){
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, []);
|
||||
if($orglist) {
|
||||
$this->orgstring = implode(',', $orglist);
|
||||
}
|
||||
}
|
||||
private function setOrg(){
|
||||
$this->org = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$this->orgnaam = $this->org->brin? $this->org->brin . ' ' . $this->org->naamkort : $this->org->naamkort;
|
||||
}
|
||||
|
||||
private function setScores(){
|
||||
$this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgstring);
|
||||
}
|
||||
|
||||
private function setMetingen(){
|
||||
$this->metingen = new stdClass();
|
||||
if(count($this->scores)==0)
|
||||
$this->metingen->aantal= 0;
|
||||
$this->metingen->aantalorgs = 0;
|
||||
|
||||
if($this->org->soort == 4) {
|
||||
$this->metingen->aantal = 1;
|
||||
$this->metingen->aantalorgs = 1;
|
||||
}
|
||||
else {
|
||||
$this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgstring);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function setAmbities(){
|
||||
$ambitieorgs = '';
|
||||
|
||||
$ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
$ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
|
||||
$toporgsarray = explode(',', $ambitieorgs);
|
||||
$toporgs = '';
|
||||
$index = 0;
|
||||
for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
if($index < 2) {
|
||||
$toporgs .= $toporgsarray[$i] . ',';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
$toporgs = rtrim($toporgs, ',' );
|
||||
|
||||
$this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
}
|
||||
|
||||
|
||||
private function setWensen(){
|
||||
if($this->isVergelijking =='T' ) {$this->wensen = false;
|
||||
return;
|
||||
}
|
||||
$this->wensen = $this->CI->Wenssituaties_model->getgewenst( $this->orgversieid, $this->orgid);
|
||||
}
|
||||
|
||||
private function setKleuren(){
|
||||
|
||||
$this->kleuren = new stdClass();
|
||||
$this->kleuren->grens1 = '60';
|
||||
$this->kleuren->grens2 = '80';
|
||||
$this->kleuren->grens3 = '90';
|
||||
$this->kleuren->grens4 = '100';
|
||||
if($this->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 loopScores1(){
|
||||
if(!$this->scores) return;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
$this->somscore = $this->somscore + $this->score->gem;
|
||||
$this->aantalscores++;
|
||||
}
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){
|
||||
$this->aantaldisablenvt++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function loopScores2(){
|
||||
if (!$this->scores) return;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
$this->setScoreNummer();
|
||||
$this->rondScoresAf();
|
||||
$this->setScoreKleuren();
|
||||
$this->telIJkpuntenok();
|
||||
$this->setResultaten();
|
||||
$this->addGewensteScores($index);
|
||||
$this->setWenskleuren();
|
||||
$this->setAdviezen();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function setScoreNummer(){
|
||||
if($this->isVergelijking =='T' ) return;
|
||||
$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->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(){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $this->score->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->kleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function telIJkpuntenok(){
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
$zprocent = 60;
|
||||
if(isset($this->ambities) && $this->ambities ) $zprocent = $this->ambities->zprocent;
|
||||
if ($this->score->gem >= $zprocent ) {
|
||||
$this->ijkpuntenok++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setResultaten(){
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
|
||||
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 addGewensteScores($index){
|
||||
if($this->isVergelijking =='T' ) return;
|
||||
|
||||
$this->score->wens = 3;
|
||||
if ($this->wensen && $index < $this->aantalscores) {
|
||||
$this->score->wens = $this->wensen[$index]->wens;
|
||||
}
|
||||
}
|
||||
|
||||
private function setWensKleuren(){
|
||||
if($this->isVergelijking =='T' ) return;
|
||||
|
||||
if(! isset($this->wensen)) return;
|
||||
if(!isset($this->score->wens)) return;
|
||||
$kleur = $this->CI->Scorekleuren_model->getWensKleur($this->scoretype, $this->score->wens);
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->wenskleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function setAdviezen(){
|
||||
if($this->isVergelijking =='T' ) {
|
||||
$this->adviezen = false;
|
||||
return;
|
||||
}
|
||||
if(isset($this->score->wens) &&
|
||||
$this->score->huidig < $this->score->wens &&
|
||||
$this->score->wens!= 0 &&
|
||||
$this->score->disabled == 'F' &&
|
||||
$this->score->disablenvt == 'F'){
|
||||
$omschrijving = "";
|
||||
if(isset($this->score->omschrijving)){
|
||||
$omschrijving = $this->score->omschrijving;
|
||||
}
|
||||
$this->adviezen[] = ["nummer"=> $this->score->nummer, "omschrijving" =>$omschrijving];
|
||||
}
|
||||
}
|
||||
|
||||
private function setGemiddeldeScore(){
|
||||
if(!$this->scores || $this->aantalscores == 0) return;
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->gem = 0;
|
||||
$this->gemiddelde->score = 0;
|
||||
$deler = $this->aantalY - $this->aantaldisablenvt;
|
||||
if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$this->gemiddelde->nummer = 'gem';
|
||||
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $this->gemiddelde->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->gemiddelde->kleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function addGemiddeldeScore(){
|
||||
if(!$this->scores || ! $this->gemiddelde) return;
|
||||
array_push($this->scores, $this->gemiddelde);
|
||||
}
|
||||
|
||||
|
||||
private function setResults(){
|
||||
|
||||
$this->resultaten = [
|
||||
'totgem' => $this->gemiddelde->gem,
|
||||
'ijkpuntenok' => $this->ijkpuntenok,
|
||||
'welkehoogste' => $this->welkehoogste,
|
||||
'hoogstescore' => round($this->hoogstescore, 1),
|
||||
'welkelaagste' => $this->welkelaagste,
|
||||
'laagstescore' => round($this->laagstescore, 1),
|
||||
];
|
||||
|
||||
$this->results= [
|
||||
'orgnaam' => $this->orgnaam,
|
||||
'ijkpunten' => $this->ijkpunten,
|
||||
'scores' => $this->scores,
|
||||
'metingen' => $this->metingen,
|
||||
'ambities' => $this->ambities,
|
||||
'kleuren' => $this->kleuren,
|
||||
'wensen' => $this->wensen,
|
||||
'resultaten' => $this->resultaten,
|
||||
'adviezen' => $this->adviezen,
|
||||
'aantalY' => $this->aantalY
|
||||
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class Compacteonderdelen
|
||||
}
|
||||
|
||||
public function getSchoolnaam(){
|
||||
return $this->organisatie->naam;
|
||||
return $this->organisatie->naamkort;
|
||||
}
|
||||
|
||||
private function handle()
|
||||
@@ -437,7 +437,7 @@ class Compacteonderdelen
|
||||
'onderdelen' => $this->onderdelenNew,
|
||||
'schooljaarnr' => $this->schooljaarnr,
|
||||
'schooljaar' => $this->schooljaar->naam,
|
||||
'orgnaam' => $this->organisatie->naam
|
||||
'orgnaam' => $this->organisatie->naamkort
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,255 +2,254 @@
|
||||
|
||||
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;
|
||||
private $disablenvt = 0;
|
||||
private $ijkpunten;
|
||||
private $aantalY = 0;
|
||||
|
||||
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->setIJkpunten();
|
||||
$this->telIJkpunten();
|
||||
$this->setScores();
|
||||
$this->setSWVid();
|
||||
$this->setOrgversie();
|
||||
// $this->setKleurcodes();
|
||||
$this->setKleuren();
|
||||
$this->loopScores1();
|
||||
$this->setGemiddeldeScore();
|
||||
$this->addGemiddeldeScore();
|
||||
$this->loopScores2();
|
||||
}
|
||||
|
||||
private function setIJkpunten(){
|
||||
$this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
}
|
||||
|
||||
private function telIJkpunten(){
|
||||
if($this->ijkpunten){
|
||||
foreach($this->ijkpunten as $ijkpunt){
|
||||
if($ijkpunt->disabled == 'F'){
|
||||
$this->aantalY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 $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;
|
||||
// private $disablenvt = 0;
|
||||
// private $ijkpunten;
|
||||
// private $aantalY = 0;
|
||||
//
|
||||
// public function __construct($scoresObject, $modulenr, $orgversieid, $clusterid, $orgid){
|
||||
// $this->CI = & get_instance();
|
||||
// $this->scoresobject = $scoresObject;
|
||||
// $this->modulenr = $modulenr;
|
||||
// $this->orgversieid = $orgversieid;
|
||||
// $this->orgid = $orgid;
|
||||
// $this->clusterid = $clusterid;
|
||||
// $this->handle();
|
||||
// }
|
||||
//
|
||||
// public function getScores(){
|
||||
// return $this->scores;
|
||||
// }
|
||||
//
|
||||
// public function getResultaten(){
|
||||
// $gem ="";
|
||||
// if($this->gemiddelde){
|
||||
// $gem = $this->gemiddelde->gem;
|
||||
// }
|
||||
}
|
||||
|
||||
private function loopScores1(){
|
||||
if(!$this->scores) return;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
// $this->berekenGemiddelden();
|
||||
$this->setScoreSom();
|
||||
$this->setAantalScores($index);
|
||||
}
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){
|
||||
$this->disablenvt++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
//
|
||||
// $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->setIJkpunten();
|
||||
// $this->telIJkpunten();
|
||||
// $this->setScores();
|
||||
// $this->setSWVid();
|
||||
// $this->setOrgversie();
|
||||
//// $this->setKleurcodes();
|
||||
// $this->setKleuren();
|
||||
// $this->loopScores1();
|
||||
// $this->setGemiddeldeScore();
|
||||
// $this->addGemiddeldeScore();
|
||||
// $this->loopScores2();
|
||||
// }
|
||||
//
|
||||
// private function setIJkpunten(){
|
||||
// $this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
// }
|
||||
//
|
||||
// private function telIJkpunten(){
|
||||
// if($this->ijkpunten){
|
||||
// foreach($this->ijkpunten as $ijkpunt){
|
||||
// if($ijkpunt->disabled == 'F'){
|
||||
// $this->aantalY++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private function setScoreSom(){
|
||||
|
||||
$this->somscore = $this->somscore + $this->score->gem;
|
||||
|
||||
}
|
||||
|
||||
private function setAantalScores($index){
|
||||
$this->aantalscores++;
|
||||
}
|
||||
|
||||
private function setGemiddeldeScore(){
|
||||
if(!$this->scores || $this->aantalscores == 0) return;
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->gem = 0;
|
||||
$deler = $this->aantalY - $this->disablenvt;
|
||||
if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$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;
|
||||
$scoretype = $this->scores[0]->scoretype;
|
||||
foreach ($this->scores as $index => $this->score) {
|
||||
$this->setScoreNummer();
|
||||
$this->rondScoresAf();
|
||||
$this->setScoreKleuren($scoretype);
|
||||
$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($scoretype){
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($scoretype, $this->score->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->kleur = $kleur;
|
||||
|
||||
|
||||
// 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 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) {
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
//// $this->berekenGemiddelden();
|
||||
// $this->setScoreSom();
|
||||
// $this->setAantalScores($index);
|
||||
// }
|
||||
// if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){
|
||||
// $this->disablenvt++;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// 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++;
|
||||
// }
|
||||
//
|
||||
// private function setGemiddeldeScore(){
|
||||
// if(!$this->scores || $this->aantalscores == 0) return;
|
||||
// $this->gemiddelde = new stdClass();
|
||||
// $this->gemiddelde->gem = 0;
|
||||
// $deler = $this->aantalY - $this->disablenvt;
|
||||
// if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
//
|
||||
// $this->gemiddelde->disabled = 'F';
|
||||
// $this->gemiddelde->disablenvt = 'F';
|
||||
// $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;
|
||||
// $scoretype = $this->scores[0]->scoretype;
|
||||
// foreach ($this->scores as $index => $this->score) {
|
||||
// $this->setScoreNummer();
|
||||
// $this->rondScoresAf();
|
||||
// $this->setScoreKleuren($scoretype);
|
||||
// $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($scoretype){
|
||||
// $kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($scoretype, $this->score->gem);
|
||||
// $kleur = $kleur->kleurcode;
|
||||
// if(!$kleur) $kleur = '#ffffff';
|
||||
// $this->score->kleur = $kleur;
|
||||
//
|
||||
//
|
||||
//// 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->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
//
|
||||
// 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->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
// if ($this->score->gem >= $this->zprocent) {
|
||||
// $this->ijkpuntenok++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private function setResultatenOverzicht(){
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
|
||||
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->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
if ($this->score->gem >= $this->zprocent) {
|
||||
$this->ijkpuntenok++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ class Bestuurscores
|
||||
private $scores;
|
||||
private $orgstring;
|
||||
private $metingen;
|
||||
private $ambities;
|
||||
|
||||
|
||||
public function __construct( $orgversieid, $orgid, $vorm)
|
||||
@@ -14,40 +15,73 @@ class Bestuurscores
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->vorm = $vorm;
|
||||
$this->handle();
|
||||
// $this->handle();
|
||||
}
|
||||
|
||||
public function getScores(){
|
||||
return $this->scores;
|
||||
}
|
||||
|
||||
public function getMetingen(){
|
||||
return $this->metingen;
|
||||
}
|
||||
|
||||
|
||||
private function handle(){
|
||||
|
||||
|
||||
$this->setOrglist();
|
||||
$this->setScores();
|
||||
$this->setMetingen();
|
||||
}
|
||||
|
||||
|
||||
private function setOrglist(){
|
||||
$orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, []);
|
||||
if($orglist) {
|
||||
$this->orgstring = implode(',', $orglist);
|
||||
}
|
||||
}
|
||||
|
||||
private function setScores(){
|
||||
$this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgstring);
|
||||
}
|
||||
|
||||
private function setMetingen(){
|
||||
$this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgstring);
|
||||
}
|
||||
// public function getScores(){
|
||||
// return $this->scores;
|
||||
// }
|
||||
//
|
||||
// public function getMetingen(){
|
||||
// return $this->metingen;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private function handle(){
|
||||
//
|
||||
//
|
||||
// $this->setOrglist();
|
||||
// $this->setScores();
|
||||
// $this->setMetingen();
|
||||
// $this->setAmbities();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private function setOrglist(){
|
||||
// $orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, []);
|
||||
// if($orglist) {
|
||||
// $this->orgstring = implode(',', $orglist);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private function setScores(){
|
||||
// $this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgstring);
|
||||
// }
|
||||
//
|
||||
// private function setMetingen(){
|
||||
// $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgstring);
|
||||
// }
|
||||
//
|
||||
// private function setAmbities(){
|
||||
//
|
||||
// $ambitieorgs = '';
|
||||
// $ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
// $ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
//
|
||||
// $toporgsarray = explode(',', $ambitieorgs);
|
||||
// $toporgs = '';
|
||||
// $index = 0;
|
||||
// for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
// if($index < 2) {
|
||||
// $toporgs .= $toporgsarray[$i] . ',';
|
||||
// $index++;
|
||||
// }
|
||||
// }
|
||||
// $toporgs = rtrim($toporgs, ',' );
|
||||
//
|
||||
// $this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
// $ambitieorgs .= $orgid . ',';
|
||||
// $valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
// if($valtonder != $orgid){
|
||||
// return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
// }
|
||||
//
|
||||
// return $ambitieorgs;
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -4,16 +4,32 @@ class Individuelescores
|
||||
{
|
||||
private $CI;
|
||||
private $userid;
|
||||
private $aantalY = 0;
|
||||
private $scores;
|
||||
private $score;
|
||||
private $ambities;
|
||||
private $kleuren;
|
||||
private $aantaldisablenvt = 0;
|
||||
private $aantalscores = 0;
|
||||
private $ijkpuntenok = 0;
|
||||
private $results;
|
||||
private $gemiddelde;
|
||||
private $resultaten;
|
||||
private $adviezen;
|
||||
private $somscore = 0;
|
||||
private $welkelaagste;
|
||||
private $welkehoogste;
|
||||
private $laagstescore = 110;
|
||||
private $hoogstescore = 0;
|
||||
|
||||
public function __construct( $orgversieid, $orguserid, $orgid)
|
||||
|
||||
public function __construct( $orgversieid, $orguserid, $orgid, $scoretype)
|
||||
{
|
||||
$this->CI = & get_instance();
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->orguserid = $orguserid;
|
||||
$this->teller = 0;
|
||||
$this->scoretype = $scoretype;
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
@@ -21,42 +37,242 @@ class Individuelescores
|
||||
return $this->scores;
|
||||
}
|
||||
|
||||
public function getResults(){
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
private function handle(){
|
||||
$this->setUserid();
|
||||
$this->setOrg();
|
||||
$this->setIJkpunten();
|
||||
$this->telIJkpunten();
|
||||
$this->setScores();
|
||||
$this->setAmbities();
|
||||
$this->setKleuren();
|
||||
$this->loopScores();
|
||||
$this->setGemiddeldeScore();
|
||||
$this->addGemiddeldeScore();
|
||||
$this->setResults();
|
||||
|
||||
}
|
||||
|
||||
private function setUserid(){
|
||||
$this->userid = $this->CI->Orgusers_model->get_fieldvalue(['id' =>$this->orguserid], 'user_id');
|
||||
}
|
||||
private function setOrg(){
|
||||
$this->org = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
$this->orgnaam = $this->org->brin? $this->org->brin . ' ' . $this->org->naamkort : $this->org->naamkort;
|
||||
}
|
||||
|
||||
private function setIJkpunten(){
|
||||
$this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid);
|
||||
}
|
||||
|
||||
private function telIJkpunten(){
|
||||
if($this->ijkpunten){
|
||||
foreach($this->ijkpunten as $ijkpunt){
|
||||
if($ijkpunt->disabled == 'F'){
|
||||
$this->aantalY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setScores(){
|
||||
$this->scores = $this->CI->Scores_model->calculateindividualscores($this->orgversieid, $this->orgid, $this->userid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function setAmbities(){
|
||||
$ambitieorgs = '';
|
||||
|
||||
$ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
$ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
|
||||
$toporgsarray = explode(',', $ambitieorgs);
|
||||
$toporgs = '';
|
||||
$index = 0;
|
||||
for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
if($index < 2) {
|
||||
$toporgs .= $toporgsarray[$i] . ',';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
$toporgs = rtrim($toporgs, ',' );
|
||||
|
||||
$this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
|
||||
}
|
||||
|
||||
private function setKleuren(){
|
||||
|
||||
$this->kleuren = new stdClass();
|
||||
$this->kleuren->grens1 = '60';
|
||||
$this->kleuren->grens2 = '80';
|
||||
$this->kleuren->grens3 = '90';
|
||||
$this->kleuren->grens4 = '100';
|
||||
if($this->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 loopScores(){
|
||||
$this->aantaldisablenvt = 0;
|
||||
if(! isset($this->scores) || $this->scores == false ) return;
|
||||
foreach($this->scores as $this->score) {
|
||||
$this->setNietVanToepassing();
|
||||
$this->setGem();
|
||||
$this->setSomscores();
|
||||
$this->setScoreKleuren();
|
||||
$this->telIJkpuntenok();
|
||||
$this->setResultaten();
|
||||
$this->setAdviezen();
|
||||
}
|
||||
}
|
||||
|
||||
private function setNietVanToepassing(){
|
||||
if(! isset($this->scores) || $this->scores == false ) return;
|
||||
$this->score->disablenvt = 'F';
|
||||
if($this->score->aantalvier> 0 && $this->score->aantalvier == $this->score->aantalnvt)
|
||||
if($this->score->aantalvier> 0 && $this->score->aantalvier == $this->score->aantalnvt){
|
||||
$this->score->disablenvt = 'T';
|
||||
$this->aantaldisablenvt++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function setGem(){
|
||||
if(! isset($this->scores) || $this->scores == false ) return;
|
||||
$this->score->gem = 0;
|
||||
if(isset($this->score->somscore) && $this->score->num > 0) {
|
||||
$this->score->gem = $this->score->somscore/$this->score->num;
|
||||
$this->score->gem = round($this->score->somscore/$this->score->num);
|
||||
}
|
||||
}
|
||||
|
||||
private function setSomscores()
|
||||
{ if(! isset($this->scores) || $this->scores == false ) return;
|
||||
if ($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
$this->somscore = $this->somscore + $this->score->gem;
|
||||
$this->aantalscores++;
|
||||
}
|
||||
}
|
||||
|
||||
private function setScoreKleuren(){
|
||||
if(! isset($this->scores) || $this->scores == false ) return;
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $this->score->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->score->kleur = $kleur;
|
||||
|
||||
}
|
||||
|
||||
private function telIJkpuntenok(){
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
if ($this->score->gem >= $this->ambities->zprocent) {
|
||||
$this->ijkpuntenok++;
|
||||
}
|
||||
}
|
||||
}
|
||||
private function setResultaten(){
|
||||
if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') {
|
||||
|
||||
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 setAdviezen(){
|
||||
if(! isset($this->scores) || $this->scores == false ) return;
|
||||
if(isset($this->score->wens) &&
|
||||
$this->score->huidig < $this->score->wens &&
|
||||
$this->score->wens!= 0 &&
|
||||
$this->score->disabled == 'F' &&
|
||||
$this->score->disablenvt == 'F'){
|
||||
$omschrijving = "";
|
||||
if(isset($this->score->omschrijving)){
|
||||
$omschrijving = $this->score->omschrijving;
|
||||
}
|
||||
$this->adviezen[] = ["nummer"=> $this->score->nummer, "omschrijving" =>$omschrijving];
|
||||
}
|
||||
}
|
||||
private function setGemiddeldeScore(){
|
||||
if(!$this->scores || $this->aantalscores == 0) return;
|
||||
$this->gemiddelde = new stdClass();
|
||||
$this->gemiddelde->gem = 0;
|
||||
$deler = $this->aantalY - $this->aantaldisablenvt;
|
||||
if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler);
|
||||
|
||||
$this->gemiddelde->disabled = 'F';
|
||||
$this->gemiddelde->disablenvt = 'F';
|
||||
$this->gemiddelde->nummer = 'gem';
|
||||
|
||||
$kleur = $this->CI->Scorekleuren_model->getGemiddeldeKleur($this->scoretype, $this->gemiddelde->gem);
|
||||
$kleur = $kleur->kleurcode;
|
||||
if(!$kleur) $kleur = '#ffffff';
|
||||
$this->gemiddelde->kleur = $kleur;
|
||||
|
||||
}
|
||||
private function addGemiddeldeScore(){
|
||||
if(!$this->scores || ! $this->gemiddelde) return;
|
||||
array_push($this->scores, $this->gemiddelde);
|
||||
}
|
||||
|
||||
private function setResults(){
|
||||
if($this->scores) {
|
||||
$this->resultaten = [
|
||||
'totgem' => $this->gemiddelde->gem,
|
||||
'ijkpuntenok' => $this->ijkpuntenok,
|
||||
'welkehoogste' => $this->welkehoogste,
|
||||
'hoogstescore' => round($this->hoogstescore, 1),
|
||||
'welkelaagste' => $this->welkelaagste,
|
||||
'laagstescore' => round($this->laagstescore, 1),
|
||||
];
|
||||
}
|
||||
|
||||
$this->results= [
|
||||
'orgnaam' => $this->orgnaam,
|
||||
'ijkpunten' => $this->ijkpunten,
|
||||
'scores' => $this->scores ? $this->scores : false,
|
||||
'ambities' => $this->ambities,
|
||||
'kleuren' => $this->kleuren,
|
||||
'resultaten' => $this->resultaten,
|
||||
'adviezen' => $this->adviezen,
|
||||
'aantalY' => $this->aantalY
|
||||
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ class Kamerscores
|
||||
private $orgids;
|
||||
private $scores;
|
||||
private $metingen;
|
||||
private $ambities;
|
||||
|
||||
public function __construct( $orgversieid, $orgid, $vorm)
|
||||
{
|
||||
@@ -16,64 +17,77 @@ class Kamerscores
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->vorm = $vorm;
|
||||
$this->handle();
|
||||
// $this->handle();
|
||||
}
|
||||
|
||||
public function getScores(){
|
||||
return $this->scores;
|
||||
}
|
||||
public function getMetingen(){
|
||||
return $this->metingen;
|
||||
}
|
||||
// public function getScores(){
|
||||
// return $this->scores;
|
||||
// }
|
||||
// public function getMetingen(){
|
||||
// return $this->metingen;
|
||||
// }
|
||||
//
|
||||
// public function getOrgnaam(){
|
||||
// return $this->kamernaam;
|
||||
// }
|
||||
//
|
||||
// private function handle(){
|
||||
//
|
||||
// $this->setOrg();
|
||||
// $this->setKamerOrgid();
|
||||
// $this->setKamernaam();
|
||||
// $this->setScholenString();
|
||||
// $this->setScores();
|
||||
// $this->setMetingen();
|
||||
// $this->setAmbities();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// 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->getgemscores($this->orgversieid, $this->orgids);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private function setMetingen(){
|
||||
// $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids);
|
||||
// }
|
||||
//
|
||||
// private function setAmbities(){
|
||||
//
|
||||
// $kamer = $this->CI->Organisaties_model->get_record_by_id($this->kamerid);
|
||||
// $ambitieorgs = $this->kamerid .','. $kamer->valtonder_id;
|
||||
// $toporgs = $ambitieorgs;
|
||||
// $this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $ambitieorgs, $toporgs);
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
|
||||
public function getOrgnaam(){
|
||||
return $this->kamernaam;
|
||||
}
|
||||
|
||||
private function handle(){
|
||||
|
||||
$this->setOrg();
|
||||
$this->setKamerOrgid();
|
||||
$this->setKamernaam();
|
||||
$this->setScholenString();
|
||||
$this->setScores();
|
||||
$this->setMetingen();
|
||||
|
||||
}
|
||||
|
||||
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->getgemscores($this->orgversieid, $this->orgids);
|
||||
|
||||
}
|
||||
|
||||
private function setMetingen(){
|
||||
$this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,49 +4,39 @@ class Lijsten
|
||||
{
|
||||
private $CI;
|
||||
private $modulenr;
|
||||
private $ijkpunten;
|
||||
private $clusterid;
|
||||
private $versienaam;
|
||||
private $soort;
|
||||
private $aantal;
|
||||
private $schoolScores;
|
||||
private $gemiddeldeScores;
|
||||
private $bestuurScores;
|
||||
private $kamerScores;
|
||||
private $swvScores;
|
||||
private $schoolAfbeeldingen;
|
||||
private $gemiddeldenAfbeeldingen;
|
||||
private $bestuurAfbeeldingen;
|
||||
private $kamerAfbeeldingen;
|
||||
private $swvAfbeeldingen;
|
||||
private $score;
|
||||
private $onderorgs;
|
||||
private $zprocent;
|
||||
private $ambitiearray = [];
|
||||
private $ijkpunten;
|
||||
private $results;
|
||||
private $scores;
|
||||
private $vergelijkingen;
|
||||
private $lijst;
|
||||
private $lijsten = [];
|
||||
private $nieuwste = 0;
|
||||
private $nieuwsteversie;
|
||||
private $kleuren;
|
||||
private $org;
|
||||
private $orgstring;
|
||||
private $sopinfo;
|
||||
private $eigenambitie = 'F';
|
||||
|
||||
public function getLijsten(){
|
||||
return $this->lijsten;
|
||||
|
||||
}
|
||||
|
||||
public function getNieuwsteVersie(){
|
||||
return $this->nieuwsteversie;
|
||||
}
|
||||
|
||||
public function getEigenAmbitie(){
|
||||
return $this->eigenambitie;
|
||||
}
|
||||
|
||||
public function getIJkpunten(){
|
||||
return $this->ijkpunten;
|
||||
}
|
||||
|
||||
|
||||
public function getKleuren(){
|
||||
return $this->kleuren;
|
||||
return $this->results['kleuren'];
|
||||
}
|
||||
|
||||
public function getSopInfo(){
|
||||
@@ -62,12 +52,12 @@ class Lijsten
|
||||
|
||||
private function handle(){
|
||||
$this->setModulenummer();
|
||||
$this->setClusterid();
|
||||
$this->setOrg();
|
||||
$this->setSoort();
|
||||
$this->setAantal();
|
||||
|
||||
$this->loopSelecties();
|
||||
$this->loopLijsten();
|
||||
$this->setKleuren();
|
||||
$this->setSopInfo();
|
||||
}
|
||||
|
||||
@@ -77,61 +67,37 @@ class Lijsten
|
||||
$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 setOrg(){
|
||||
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
}
|
||||
|
||||
private function setSoort(){
|
||||
$this->soort = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$this->orgid], 'soort');
|
||||
$this->soort = $this->organisatie->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->setIJkpunten($index);
|
||||
$this->setVersieNaam();
|
||||
$this->setOrgnaam();
|
||||
$this->setBrin();
|
||||
$this->setLabels();
|
||||
$this->setResults();
|
||||
$this->setVergelijkingen();
|
||||
$this->setVergelijkingScores();
|
||||
$this->setAmbities();
|
||||
$this->setZprocent();
|
||||
$this->setSchoolScores();
|
||||
$this->setIndividueleScores();
|
||||
$this->setBestuurScores();
|
||||
$this->setKamerScores();
|
||||
$this->setSWVScores();
|
||||
$this->setLijstScores();
|
||||
$this->setMetingen();
|
||||
$this->setGemiddeldeScores();
|
||||
$this->setAdviezen();
|
||||
$this->setGemiddeldenAdviezen();
|
||||
$this->setVNaam();
|
||||
$this->loopVergelijkingScores();
|
||||
// $this->setSchoolMetingen();
|
||||
// $this->setIndividueleMetingen();
|
||||
// $this->setMetingenVergelijking();
|
||||
// $this->setMetingenVergelijkingIndividueel();
|
||||
$this->setResultaten();
|
||||
$this->setLijst();
|
||||
$this->setrapportInfo();
|
||||
$this->setLijsten();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,361 +105,123 @@ class Lijsten
|
||||
$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->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);
|
||||
}
|
||||
|
||||
private function setIJkpunten($index){
|
||||
if($index > 0 ) return;
|
||||
$this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->lijst->orgversieid);
|
||||
}
|
||||
|
||||
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 && $this->soort != 3) 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 setResults(){
|
||||
if($this->soort == 4 && $this->lijst->vorm == 2) {
|
||||
$this->gemiddelden = new Gemiddeldescores ($this->lijst->orgversieid, $this->orgid, $this->lijst->orgversie->scoretype);
|
||||
$this->results = $this->gemiddelden->getResults();
|
||||
$this->scores = $this->gemiddelden->getIJkpunten();
|
||||
}
|
||||
else {
|
||||
$this->scoresobject = new Scores($this->lijst->orgversieid, $this->orgid, $this->lijst->orgversie->scoretype, 'F');
|
||||
$this->results = $this->scoresobject->getResults();
|
||||
$this->scores = $this->scoresobject->getScores();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function setVergelijkingen(){
|
||||
if($this->soort == 1) return;
|
||||
$this->vergelijkingen = new stdClass();
|
||||
switch($this->soort){
|
||||
case 2:
|
||||
case 3: $orgid = $this->organisatie->valtonder_id;
|
||||
break;
|
||||
case 4 : $bestuurid = $this->organisatie->valtonder_id;
|
||||
$orgid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$bestuurid], 'valtonder_id');
|
||||
break;
|
||||
}
|
||||
|
||||
$this->vergelijkingen = (new Scores($this->lijst->orgversieid, $orgid, $this->lijst->orgversie->scoretype,'T' ))->getResults();
|
||||
}
|
||||
|
||||
|
||||
private function setVergelijkingScores(){
|
||||
if(!isset($this->vergelijkingen) || !$this->vergelijkingen) return;
|
||||
|
||||
foreach($this->vergelijkingen['scores'] AS $i => $vergelijking){
|
||||
$this->scores[$i]->gemV = $vergelijking->gem;
|
||||
$this->scores[$i]->kleurV = $vergelijking->kleur;
|
||||
$this->scores[$i]->disabledV = $vergelijking->disabled;
|
||||
$this->scores[$i]->disablenvtV = $vergelijking->disablenvt;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
$standaard = new stdClass();
|
||||
$standaard->ambitievan = 'standaard';
|
||||
$standaard->id = 0;
|
||||
$standaard->geldigtm = $this->lijst->orgversie->geldigtm;
|
||||
$standaard->geldigvanaf = $this->lijst->orgversie->geldigvanaf;
|
||||
$standaard->gemscore = 80;
|
||||
$standaard->naam = $this->versienaam;
|
||||
$standaard->orgversie_id = $this->lijst->orgversie->id;
|
||||
$standaard->periodenummer = $this->lijst->orgversie->periodenummer;
|
||||
$standaard->soort = 0;
|
||||
$standaard->xijkpunten = ROUND($this->results['aantalY'] * 0.8);
|
||||
$standaard->zprocent = 60;
|
||||
|
||||
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);
|
||||
$this->metingen = 0;
|
||||
$this->aantalorgs = 1;
|
||||
$somscore = $this->schoolAfbeeldingen->getSomscore();
|
||||
if($somscore > 0) $this->metingen = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private function setIndividueleScores(){
|
||||
if($this->soort !=4 || $this->lijst->vorm != 2) return;
|
||||
$this->gemiddeldeScores = new Gemiddeldescores($this->lijst->orgversieid, $this->orgid);
|
||||
if($this->results && $this->results['ambities'] && $this->results['ambities']->gemscore > 0) $this->lijst->ambities = $this->results['ambities'];
|
||||
else $this->lijst->ambities = $standaard;
|
||||
|
||||
|
||||
if(!isset($this->vergelijkingen) || !$this->vergelijkingen) return;
|
||||
|
||||
if($this->vergelijkingen['ambities'] && $this->vergelijkingen['ambities']->gemscore > 0 ) $ambitiesV = $this->vergelijkingen['ambities'];
|
||||
else $ambitiesV = $standaard;
|
||||
if($ambitiesV->ambitievan != $this->lijst->ambities->ambitievan) $this->lijst->ambitiesV = $ambitiesV;
|
||||
|
||||
if($this->gemiddeldeScores){
|
||||
$this->gemiddeldenAfbeeldingen = new Gemiddeldenafbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->lijst->orgversieid,
|
||||
$this->clusterid, $this->orgid);
|
||||
}
|
||||
|
||||
// $this->gemiddeldeScores = new Individuelescores($this->lijst->orgversieid, $this->lijst->orguserid, $this->orgid);
|
||||
// $this->gemiddeldenAfbeeldingen = new Afbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid, $this->zprocent);
|
||||
|
||||
}
|
||||
|
||||
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 setLijst(){
|
||||
$this->lijst->naam = $this->results['orgnaam'];
|
||||
$this->lijst->scores = $this->scores;
|
||||
$metingen = $this->results['metingen'];
|
||||
$this->lijst->metingen = $metingen ? $metingen->aantal : 0;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
$this->lijst->aantalorgs = $metingen ? $metingen->aantalorgs : 0;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
$this->lijst->wensen = $this->results['wensen'];
|
||||
$this->lijst->adviezen = $this->results['adviezen'];
|
||||
$this->lijst->resultaten = $this->results['resultaten'] ;
|
||||
$this->lijst->aantalY = $this->results['aantalY'];
|
||||
|
||||
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 setMetingen(){
|
||||
$this->lijst->metingen = 0;
|
||||
$this->lijst->aantalorgs = 0;
|
||||
$this->lijst->metingenV = 0;
|
||||
$this->lijst->aantalorgsV = 0;
|
||||
|
||||
|
||||
switch($this->soort){
|
||||
case 1:
|
||||
if(empty($this->swvScores)) return;
|
||||
$metingen = $this->swvScores->getMetingen();
|
||||
break;
|
||||
case 2: if(empty($this->kamerScores)) return;
|
||||
$metingen = $this->kamerScores->getMetingen();
|
||||
$metingenV = $this->swvScores->getMetingen();
|
||||
break;
|
||||
case 3: if(empty($this->bestuurScores)) return;
|
||||
$metingen = $this->bestuurScores->getMetingen();
|
||||
$metingenV = $this->kamerScores->getMetingen();
|
||||
break;
|
||||
case 4: if(empty($this->schoolScores) ||empty($this->gemiddeldeScores) ) return;
|
||||
if(count((array) $this->schoolScores) > 0) {
|
||||
$somscore = $this->schoolAfbeeldingen->getSomscore();
|
||||
if($somscore > 0) $this->lijst->metingen = 1;
|
||||
$this->lijst->aantalorgs = 1;
|
||||
}
|
||||
if(count((array)$this->gemiddeldeScores)> 0){
|
||||
$this->lijst->metingen = $this->gemiddeldeScores->getAantalLeerkrachten();
|
||||
$this->lijst->aantalorgs = 1;
|
||||
|
||||
}
|
||||
$metingenV = $this->kamerScores->getMetingen();
|
||||
break;
|
||||
}
|
||||
|
||||
if(isset($metingen)) {
|
||||
$this->lijst->metingen = $metingen->aantal;
|
||||
$this->lijst->aantalorgs = $metingen->aantalorgs;
|
||||
}
|
||||
if(isset($metingenV)) {
|
||||
$this->lijst->metingenV = $metingenV->aantal;
|
||||
$this->lijst->aantalorgsV = $metingenV->aantalorgs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function setGemiddeldeScores(){
|
||||
if(count((array)$this->gemiddeldenAfbeeldingen) == 0) return;
|
||||
foreach($this->lijst->scores as $index => $this->score){
|
||||
$this->score->gem = 0;
|
||||
if(isset($this->score->score) && $this->score->score > 0) {
|
||||
$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;
|
||||
|
||||
foreach($this->lijst->vergelijkingen AS $index => $vergelijking){
|
||||
$this->setVergelijkingScores($index);
|
||||
}
|
||||
}
|
||||
|
||||
private function setVergelijkingScores($i){
|
||||
if($this->lijst->scores && $this->lijst->scores[$i]) {
|
||||
$this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem;
|
||||
$this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur;
|
||||
$this->lijst->scores[$i]->disabledV = $this->lijst->vergelijkingen[$i]->disabled;
|
||||
$this->lijst->scores[$i]->disablenvtV = $this->lijst->vergelijkingen[$i]->disablenvt;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// private function setSchoolMetingen(){
|
||||
//
|
||||
// if($this->lijst->vorm != 1) return;
|
||||
// if(!$this->lijst->scores) $this->lijst->aantalorgs = 0;
|
||||
// else if ($this->soort == 4) $this->lijst->aantalorgs = 1;
|
||||
// else {
|
||||
// if(! isset($this->lijst->scores[0]->aantalscholen)) $this->lijst->aantalorgs = 0;
|
||||
//
|
||||
// else {
|
||||
// $this->lijst->aantalorgs = $this->lijst->scores[0]->aantalscholen;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
// private function setIndividueleMetingen(){
|
||||
// if (!isset($this->lijst->scores)) return;
|
||||
// if ($this->lijst->vorm != 2) return;
|
||||
// $this->lijst->metingen = 0;
|
||||
// $this->lijst->aantalorgs = 0;
|
||||
//
|
||||
// if ($this->soort == 4) {
|
||||
// $gevuld = $this->CI->Scores_model->fCountGevuldeVersies($this->lijst->orgversieid, $this->orgid);
|
||||
// if($gevuld ){
|
||||
// $this->lijst->metingen = $gevuld->aantal;}
|
||||
// };
|
||||
//
|
||||
// if ($this->soort == 3) {
|
||||
// $gevuld = $this->CI->Scores_model->fCountGevuldeBestuurVersies($this->lijst->orgversieid, $this->orgid);
|
||||
// if($gevuld){
|
||||
// $this->lijst->metingen = $gevuld->aantal;
|
||||
// $this->lijst->aantalorgs = $gevuld->aantalorgs;}
|
||||
// };
|
||||
//
|
||||
// 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->aantal;
|
||||
// $this->lijst->aantalorgs = $metingen->aantalorgs;
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// 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->aantal;
|
||||
// $this->lijst->aantalorgs = $metingen->aantalorgs;
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
if(!isset($this->vergelijkingen) || !$this->vergelijkingen) return;
|
||||
$this->lijst->naamV = $this->vergelijkingen['orgnaam'];
|
||||
$metingenV = $this->vergelijkingen['metingen'];
|
||||
$this->lijst->metingenV = $metingenV ? $metingenV->aantal : 0;
|
||||
$this->lijst->aantalorgsV = $metingenV ? $metingenV->aantalorgs : 0;
|
||||
}
|
||||
|
||||
private function setRapportInfo(){
|
||||
$scholen = ' scholen';
|
||||
@@ -523,6 +251,8 @@ class Lijsten
|
||||
foreach ($this->lijsten as $index => $this->lijst) {
|
||||
if (!$this->lijst->orgversie) continue;
|
||||
$this->setNieuwsteVersie();
|
||||
$this->setEigenAmbitie();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,19 +263,9 @@ class Lijsten
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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 setEigenAmbitie(){
|
||||
if($this->eigenambitie== 'T') return;
|
||||
if($this->lijst->ambities->ambitievan != 'standaard') $this->eigenambitie = 'T';
|
||||
}
|
||||
|
||||
private function setSopInfo(){
|
||||
@@ -554,8 +274,10 @@ class Lijsten
|
||||
'lijsten' => $this->lijsten,
|
||||
'aantal' => $this->aantal,
|
||||
'nieuwsteversie' => $this->nieuwsteversie,
|
||||
'kleuren' => $this->kleuren,
|
||||
'versienaam' => $this->versienaam
|
||||
'kleuren' => $this->results['kleuren'],
|
||||
'versienaam' => $this->versienaam,
|
||||
'eigenambitie' => $this->eigenambitie
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ class Swvscores
|
||||
private $orgids;
|
||||
private $scores;
|
||||
private $metingen;
|
||||
private $ambities;
|
||||
|
||||
|
||||
public function __construct( $orgversieid, $orgid, $vorm)
|
||||
@@ -17,64 +18,70 @@ class Swvscores
|
||||
$this->orgversieid = $orgversieid;
|
||||
$this->orgid = $orgid;
|
||||
$this->vorm = $vorm;
|
||||
$this->handle();
|
||||
// $this->handle();
|
||||
}
|
||||
|
||||
public function getScores(){
|
||||
return $this->scores;
|
||||
}
|
||||
|
||||
public function getMetingen(){
|
||||
return $this->metingen;
|
||||
}
|
||||
|
||||
public function getOrgnaam(){
|
||||
return $this->swvnaam;
|
||||
}
|
||||
|
||||
private function handle(){
|
||||
|
||||
$this->setOrg();
|
||||
$this->setSWVid();
|
||||
$this->setSWVnaam();
|
||||
$this->setScholenString();
|
||||
$this->setScores();
|
||||
$this->setMetingen();
|
||||
}
|
||||
|
||||
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->getgemscores($this->orgversieid, $this->orgids);
|
||||
}
|
||||
|
||||
private function setMetingen(){
|
||||
$this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids);
|
||||
}
|
||||
// public function getScores(){
|
||||
// return $this->scores;
|
||||
// }
|
||||
//
|
||||
// public function getMetingen(){
|
||||
// return $this->metingen;
|
||||
// }
|
||||
//
|
||||
// public function getOrgnaam(){
|
||||
// return $this->swvnaam;
|
||||
// }
|
||||
//
|
||||
// private function handle(){
|
||||
//
|
||||
// $this->setOrg();
|
||||
// $this->setSWVid();
|
||||
// $this->setSWVnaam();
|
||||
// $this->setScholenString();
|
||||
// $this->setScores();
|
||||
// $this->setMetingen();
|
||||
// $this->setAmbities();
|
||||
// }
|
||||
//
|
||||
// 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->getgemscores($this->orgversieid, $this->orgids);
|
||||
// }
|
||||
//
|
||||
// private function setMetingen(){
|
||||
// $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids);
|
||||
// }
|
||||
//
|
||||
// private function setAmbities(){
|
||||
// $this->ambities = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->orgversieid, $this->swvid, $this->swvid);
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -4,20 +4,7 @@ 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;
|
||||
@@ -41,7 +28,6 @@ class Userlijsten
|
||||
|
||||
private function handle(){
|
||||
$this->setModulenummer();
|
||||
$this->setClusterid();
|
||||
$this->loopOrgVersies();
|
||||
$this->loopLijsten();
|
||||
}
|
||||
@@ -50,27 +36,19 @@ class Userlijsten
|
||||
$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->setVersieNaam();
|
||||
$this->setLabels();
|
||||
$this->setOrganisatie();
|
||||
$this->setIndividueleScores();
|
||||
$this->setVergelijkingen();
|
||||
$this->setVergelijkingScores();
|
||||
$this->setAmbities();
|
||||
$this->setZprocent();
|
||||
$this->setIndividueleAfbeeldingen();
|
||||
$this->setKamerAfbeeldingen();
|
||||
$this->setLijstScores();
|
||||
$this->setGemiddeldenAfbeeldingen();
|
||||
$this->loopVergelijkingScores();
|
||||
$this->setIndividueleMetingen();
|
||||
$this->setMetingenVergelijkingIndividueel();
|
||||
$this->setVNaam();
|
||||
$this->setResultaten();
|
||||
$this->setLijst();
|
||||
$this->setLijsten();
|
||||
}
|
||||
}
|
||||
@@ -82,108 +60,98 @@ class Userlijsten
|
||||
mysql2date($this->lijst->orgversie->geldigvanaf) . " t/m " . mysql2date($this->lijst->orgversie->geldigtm);
|
||||
}
|
||||
|
||||
private function setVersieNaam(){
|
||||
$this->versienaam = $this->CI->Versies_model->get_fieldvalue(['id' => $this->lijst->orgversie->versie_id], 'naam');
|
||||
|
||||
}
|
||||
|
||||
private function setLabels(){
|
||||
// $this->lijst->labels = $this->CI->Labels_model->getalllabels($this->modulenr);
|
||||
$this->lijst->label = $this->CI->Labels_model->gettabellabel($this->modulenr);
|
||||
$this->lijst->label2 = $this->CI->Labels_model->getresultaatlabel($this->modulenr);
|
||||
|
||||
}
|
||||
|
||||
private function setOrganisatie(){
|
||||
$this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid);
|
||||
|
||||
}
|
||||
|
||||
private function setIndividueleScores(){
|
||||
$this->individueel = new Individuelescores($this->orgversieid, $this->orguserid, $this->orgid, $this->lijst->orgversie->scoretype);
|
||||
$this->results = $this->individueel->getResults();
|
||||
$this->scores = $this->individueel->getScores();
|
||||
}
|
||||
|
||||
private function setVergelijkingen(){
|
||||
if(!isset($this->scores) || !$this->scores) return;
|
||||
$bestuurid = $this->organisatie->valtonder_id;
|
||||
$orgid = $this->CI->Organisaties_model->get_fieldvalue(['id'=>$bestuurid], 'valtonder_id');
|
||||
$this->vergelijkingen = (new Scores($this->orgversieid, $orgid, 2, 'T'))->getResults() ;
|
||||
}
|
||||
|
||||
private function setVergelijkingScores(){
|
||||
if(!isset($this->scores) || !$this->scores) return;
|
||||
if( (!isset($this->vergelijkingen) ||! $this->vergelijkingen )) return;
|
||||
|
||||
foreach($this->vergelijkingen['scores'] AS $i =>$vergelijking){
|
||||
$this->scores[$i]->gemV = $vergelijking->gem;
|
||||
$this->scores[$i]->kleurV = $vergelijking->kleur;
|
||||
$this->scores[$i]->disabledV = $vergelijking->disabled;
|
||||
$this->scores[$i]->disablenvtV = $vergelijking->disablenvt;
|
||||
}
|
||||
}
|
||||
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;
|
||||
if(!isset($this->scores) || !$this->scores) return;
|
||||
$standaard = new stdClass();
|
||||
$standaard->ambitievan = 'standaard';
|
||||
$standaard->id = 0;
|
||||
$standaard->geldigtm = $this->lijst->orgversie->geldigtm;
|
||||
$standaard->geldigvanaf = $this->lijst->orgversie->geldigvanaf;
|
||||
$standaard->gemscore = 80;
|
||||
$standaard->naam = $this->versienaam;
|
||||
$standaard->orgversie_id = $this->lijst->orgversie->id;
|
||||
$standaard->periodenummer = $this->lijst->orgversie->periodenummer;
|
||||
$standaard->soort = 0;
|
||||
$standaard->xijkpunten = ROUND($this->results['aantalY'] * 0.8);
|
||||
$standaard->zprocent = 60;
|
||||
|
||||
if($this->results && $this->results['ambities'] && $this->results['ambities']->gemscore > 0) $this->lijst->ambities = $this->results['ambities'];
|
||||
else $this->lijst->ambities = $standaard;
|
||||
|
||||
if(!isset($this->vergelijkingen) || !$this->vergelijkingen) return;
|
||||
|
||||
if($this->vergelijkingen['ambities'] && $this->vergelijkingen['ambities']->gemscore > 0 ) $ambitiesV = $this->vergelijkingen['ambities'];
|
||||
else $ambitiesV = $standaard;
|
||||
if($ambitiesV->ambitievan != $this->lijst->ambities->ambitievan) $this->lijst->ambitiesV = $ambitiesV;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function setLijst(){
|
||||
$this->lijst->naam = $this->results['orgnaam'];
|
||||
$this->lijst->scores = $this->scores;
|
||||
if(isset($this->scores)) {
|
||||
$this->lijst->metingen = 1 ;
|
||||
$this->lijst->aantalorgs = 1 ;
|
||||
$this->lijst->adviezen = $this->results['adviezen'];
|
||||
$this->lijst->resultaten = $this->results['resultaten'];
|
||||
}
|
||||
}
|
||||
|
||||
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) ||$this->lijst->vergelijkingen== false )) return;
|
||||
for($i = 0; $i < count($this->lijst->vergelijkingen); $i++){
|
||||
$this->setVergelijkingScores($i);
|
||||
}
|
||||
}
|
||||
|
||||
private function setVergelijkingScores($i){
|
||||
if($this->lijst->vergelijkingen[$i]) {
|
||||
$this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem;
|
||||
$this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur;
|
||||
$this->lijst->scores[$i]->disabledV = $this->lijst->vergelijkingen[$i]->disabled;
|
||||
$this->lijst->scores[$i]->disablenvtV = $this->lijst->vergelijkingen[$i]->disablenvt;
|
||||
else{
|
||||
$this->lijst->metingen = 0 ;
|
||||
$this->lijst->aantalorgs = 1 ;
|
||||
$this->lijst->adviezen = false;
|
||||
$this->lijst->resultaten = false;
|
||||
|
||||
}
|
||||
$this->lijst->aantalY = $this->results['aantalY'];
|
||||
if(!isset($this->vergelijkingen) || !$this->vergelijkingen) return;
|
||||
$this->lijst->naamV = $this->vergelijkingen['orgnaam'];
|
||||
$metingenV = $this->vergelijkingen['metingen'];
|
||||
$this->lijst->metingenV = $metingenV ? $metingenV->aantal : 0;
|
||||
$this->lijst->aantalorgsV = $metingenV ? $metingenV->aantalorgs : 0;
|
||||
}
|
||||
|
||||
|
||||
private function setIndividueleMetingen(){
|
||||
if(!isset($this->lijst->scores)||$this->lijst->scores == false ) return;
|
||||
$this->lijst->metingen = 1;
|
||||
$this->lijst->aantalorgs = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function setMetingenVergelijkingIndividueel(){
|
||||
if(! isset($this->lijst->vergelijkingen)||$this->lijst->vergelijkingen == false ) return;
|
||||
foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) {
|
||||
$metingenV = $this->kamerScores->getMetingen();
|
||||
if($metingenV) {
|
||||
$this->lijst->metingenV = $metingenV->aantal;
|
||||
$this->lijst->aantalorgsV = $metingenV->aantalorgs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -203,4 +171,6 @@ class Userlijsten
|
||||
$this->nieuwsteversie = $this->lijst->orgversie->id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user