tussenopslag
This commit is contained in:
@@ -13,6 +13,15 @@ class Individuelescores
|
||||
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, $scoretype)
|
||||
{
|
||||
@@ -73,6 +82,8 @@ class Individuelescores
|
||||
$this->scores = $this->CI->Scores_model->calculateindividualscores($this->orgversieid, $this->orgid, $this->userid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function setAmbities(){
|
||||
$ambitieorgs = '';
|
||||
|
||||
@@ -129,6 +140,7 @@ class Individuelescores
|
||||
}
|
||||
|
||||
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)
|
||||
$this->score->disablenvt = 'T';
|
||||
@@ -137,14 +149,15 @@ class Individuelescores
|
||||
}
|
||||
|
||||
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++;
|
||||
@@ -152,6 +165,7 @@ class Individuelescores
|
||||
}
|
||||
|
||||
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';
|
||||
@@ -181,7 +195,7 @@ class Individuelescores
|
||||
}
|
||||
|
||||
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 &&
|
||||
@@ -217,20 +231,21 @@ class Individuelescores
|
||||
}
|
||||
|
||||
private function setResults(){
|
||||
|
||||
$this->resultaten = [
|
||||
'totgem' => $this->score->gem,
|
||||
'ijkpuntenok' => $this->ijkpuntenok,
|
||||
'welkehoogste' => $this->welkehoogste,
|
||||
'hoogstescore' => round($this->hoogstescore, 1),
|
||||
'welkelaagste' => $this->welkelaagste,
|
||||
'laagstescore' => round($this->laagstescore, 1),
|
||||
];
|
||||
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,
|
||||
'scores' => $this->scores ? $this->scores : false,
|
||||
'ambities' => $this->ambities,
|
||||
'kleuren' => $this->kleuren,
|
||||
'resultaten' => $this->resultaten,
|
||||
|
||||
Reference in New Issue
Block a user