tussenstand
This commit is contained in:
@@ -34,10 +34,15 @@ class Ambities_model extends MY_Model{
|
||||
return $this->get_query_row();
|
||||
}
|
||||
function getambitie($orgversieid, $orgid){
|
||||
$this->sql="SELECT A.id, gem_score AS gemscore, x_ijkpunten AS xijkpunten , z_procent AS zprocent
|
||||
$this->sql="SELECT A.id, gem_score AS gemscore, x_ijkpunten AS xijkpuntenoud, COUNT(Y.id) AS xijkpunten, z_procent AS zprocent
|
||||
FROM tb_ambities A
|
||||
JOIN tb_orgversies OV ON A.orgversie_id = OV.id
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ijkpunten Y ON Y.versie_id = V.id
|
||||
WHERE A.organisatie_id = {$orgid}
|
||||
AND A.orgversie_id = {$orgversieid}";
|
||||
AND A.orgversie_id = {$orgversieid}
|
||||
AND Y.disabled = 'F'
|
||||
GROUP BY A.id ";
|
||||
return $this->get_query_row();
|
||||
}
|
||||
function getdefault($aantalY){
|
||||
|
||||
@@ -37,7 +37,8 @@ class Ijkpunten_model extends MY_Model{
|
||||
$this->sql="SELECT COUNT(Y.id) AS aantalY
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_ijkpunten Y ON Y.versie_id = OV.versie_id
|
||||
WHERE OV.id ={$orgversieid} ";
|
||||
WHERE OV.id ={$orgversieid}
|
||||
AND Y.disabled = 'F' ";
|
||||
return $this->get_query_row('aantalY');
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ class Sopinhouden_model extends MY_Model{
|
||||
$targetversieid = $this->gettargetversie($profielid, $orgid,$chapterid);
|
||||
}
|
||||
if ($targetversieid) {
|
||||
$scores = $this->Scores_model->calculateschool($targetversieid, $orgid);
|
||||
$scores = $this->Scores_model->getgemscores($targetversieid, $orgid);
|
||||
$ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid);
|
||||
}
|
||||
|
||||
@@ -569,34 +569,42 @@ class Sopinhouden_model extends MY_Model{
|
||||
$hoogstescore = -1;
|
||||
$welkelaagste = 0;
|
||||
$laagstescore = 101;
|
||||
if ($scores){
|
||||
foreach($scores as $score){
|
||||
$gem = 0;
|
||||
if ($scores) {
|
||||
foreach ($scores as $score) {
|
||||
// $gem = 0;
|
||||
//
|
||||
// if ($score->num > 0) {
|
||||
// $gem=$score->somscore / $score->num;
|
||||
// };
|
||||
// $score->kleurcode = $this->kleurcodes->getkleur($score->gem);
|
||||
|
||||
if ($score->num > 0) {
|
||||
$gem=$score->somscore / $score->num;
|
||||
};
|
||||
$totgem= $totgem + $gem;
|
||||
$totaantal=$totaantal + 1;
|
||||
if ($score->disabled == 'F' && $score->disablenvt == 'F') {
|
||||
$totgem = $totgem + $score->gem;
|
||||
$totaantal = $totaantal + 1;
|
||||
|
||||
$score->kleurcode=$this->kleurcodes->getkleur($gem);
|
||||
if ($score->gem > $hoogstescore) {
|
||||
$hoogstescore = $score->gem;
|
||||
$welkehoogste = $score->nummer;
|
||||
}
|
||||
if ($score->gem <= $laagstescore) {
|
||||
$laagstescore = $score->gem;
|
||||
$welkelaagste = $score->nummer;
|
||||
}
|
||||
if ($ambitie && $score->gem >= $ambitie->zprocent) {
|
||||
$ijkpuntenok = $ijkpuntenok + 1;
|
||||
};
|
||||
|
||||
if ($gem > $hoogstescore){
|
||||
$hoogstescore = $gem;
|
||||
$welkehoogste = $score->nummer;
|
||||
}
|
||||
if ($gem <= $laagstescore){
|
||||
$laagstescore = $gem;
|
||||
$welkelaagste = $score->nummer;
|
||||
}
|
||||
if ($ambitie && $gem >= $ambitie->zprocent) {$ijkpuntenok = $ijkpuntenok + 1;};
|
||||
|
||||
}
|
||||
if ($totaantal >0){ $totgem= round($totgem/ $totaantal, 2);}
|
||||
}
|
||||
$totgemkleur= $this->kleurcodes->getkleur($totgem);
|
||||
// foreach scores bereken som en dus totgem en ijkpuntenok
|
||||
$tabelid='';
|
||||
if ($totaantal > 0) {
|
||||
$totgem = round($totgem / $totaantal, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
$totgemkleur = $this->kleurcodes->getkleur($totgem);
|
||||
// foreach scores bereken som en dus totgem en ijkpuntenok
|
||||
}
|
||||
|
||||
$tabelid='';
|
||||
switch ($module){
|
||||
case 1: $tabelid = "tabelmb1"; break;
|
||||
case 3: $tabelid = "tabeltv1"; break;
|
||||
@@ -719,7 +727,7 @@ class Sopinhouden_model extends MY_Model{
|
||||
}
|
||||
if ($targetversieid){
|
||||
$targetversie = $this->Orgversies_model->get_record_by_id($targetversieid);
|
||||
$scores = $this->Scores_model->calculateschool($targetversieid, $orgid);
|
||||
$scores = $this->Scores_model->getgemscores($targetversieid, $orgid);
|
||||
$ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid);
|
||||
|
||||
if($targetversie->scoretype == 7){
|
||||
@@ -742,11 +750,11 @@ class Sopinhouden_model extends MY_Model{
|
||||
$scores = $scores ? $scores : [];
|
||||
|
||||
foreach($scores as $score){
|
||||
$score->gem = 0;
|
||||
// $score->gem = 0;
|
||||
if ($score->num > 0) {
|
||||
$score->gem= round($score->somscore / $score->num,1);
|
||||
$score->gem= round($score->gem);
|
||||
}
|
||||
$score->huidig = $this->kleurcodes->getnummer($score->gem);
|
||||
$score->huidig = $score->nummer;
|
||||
if($targetversie->scoretype == 7){
|
||||
if($score->gem == $grens3) $score->huidig = 4;
|
||||
if($score->gem < $grens3) $score->huidig = 3;
|
||||
|
||||
Reference in New Issue
Block a user