255 lines
8.4 KiB
PHP
255 lines
8.4 KiB
PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class Afbeeldingen {
|
|
|
|
// private $CI;
|
|
// private $swvid;
|
|
// private $scores;
|
|
// private $score;
|
|
// private $somscore;
|
|
// private $kleuren;
|
|
// private $kleurcodes;
|
|
// private $orgversie;
|
|
// private $gemiddelde;
|
|
// private $nummer;
|
|
// private $gem;
|
|
// private $aantalscores = 0;
|
|
// private $ijkpuntenok = 0;
|
|
// private $welkehoogste = 0;
|
|
// private $hoogstescore = -1;
|
|
// private $welkelaagste = 0;
|
|
// private $laagstescore = 101;
|
|
// private $resultaten;
|
|
// 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;
|
|
// }
|
|
//
|
|
// $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 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++;
|
|
// }
|
|
// }
|
|
// }
|
|
} |