tussenstand

This commit is contained in:
Monique
2021-11-19 10:31:31 +01:00
parent ed0ca50d6d
commit b8177ade48
8 changed files with 96 additions and 63 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ class Sop extends MY_Controller{
$nieuweInhoud = $this->Sopinhouden_model->get(['id' => $newID], false, true); $nieuweInhoud = $this->Sopinhouden_model->get(['id' => $newID], false, true);
// om de vergelijkende versies bij te houden dient // om de vergelijkende versies bij te houden dient
// per versie een record in de tabel tb_flexsop_gebruikteversies // per versie een record in de tabel tb_flexsop_gebruikteversies
// te worden gemaakt. // te worden gemaakt.
// de originele versie staat in de tabel tb_sopinhouden // de originele versie staat in de tabel tb_sopinhouden
$index = 1; $index = 1;
foreach ($vergelijkingen ? $vergelijkingen : [] as $vergelijking){ foreach ($vergelijkingen ? $vergelijkingen : [] as $vergelijking){
+7 -2
View File
@@ -34,10 +34,15 @@ class Ambities_model extends MY_Model{
return $this->get_query_row(); return $this->get_query_row();
} }
function getambitie($orgversieid, $orgid){ 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 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} 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(); return $this->get_query_row();
} }
function getdefault($aantalY){ function getdefault($aantalY){
@@ -37,7 +37,8 @@ class Ijkpunten_model extends MY_Model{
$this->sql="SELECT COUNT(Y.id) AS aantalY $this->sql="SELECT COUNT(Y.id) AS aantalY
FROM tb_orgversies OV FROM tb_orgversies OV
JOIN tb_ijkpunten Y ON Y.versie_id = OV.versie_id 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'); return $this->get_query_row('aantalY');
} }
+37 -29
View File
@@ -552,7 +552,7 @@ class Sopinhouden_model extends MY_Model{
$targetversieid = $this->gettargetversie($profielid, $orgid,$chapterid); $targetversieid = $this->gettargetversie($profielid, $orgid,$chapterid);
} }
if ($targetversieid) { if ($targetversieid) {
$scores = $this->Scores_model->calculateschool($targetversieid, $orgid); $scores = $this->Scores_model->getgemscores($targetversieid, $orgid);
$ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid); $ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid);
} }
@@ -569,34 +569,42 @@ class Sopinhouden_model extends MY_Model{
$hoogstescore = -1; $hoogstescore = -1;
$welkelaagste = 0; $welkelaagste = 0;
$laagstescore = 101; $laagstescore = 101;
if ($scores){ if ($scores) {
foreach($scores as $score){ foreach ($scores as $score) {
$gem = 0; // $gem = 0;
//
// if ($score->num > 0) {
// $gem=$score->somscore / $score->num;
// };
// $score->kleurcode = $this->kleurcodes->getkleur($score->gem);
if ($score->num > 0) { if ($score->disabled == 'F' && $score->disablenvt == 'F') {
$gem=$score->somscore / $score->num; $totgem = $totgem + $score->gem;
}; $totaantal = $totaantal + 1;
$totgem= $totgem + $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) {
if ($totaantal >0){ $totgem= round($totgem/ $totaantal, 2);} $totgem = round($totgem / $totaantal, 2);
} }
$totgemkleur= $this->kleurcodes->getkleur($totgem); }
// foreach scores bereken som en dus totgem en ijkpuntenok }
$tabelid=''; $totgemkleur = $this->kleurcodes->getkleur($totgem);
// foreach scores bereken som en dus totgem en ijkpuntenok
}
$tabelid='';
switch ($module){ switch ($module){
case 1: $tabelid = "tabelmb1"; break; case 1: $tabelid = "tabelmb1"; break;
case 3: $tabelid = "tabeltv1"; break; case 3: $tabelid = "tabeltv1"; break;
@@ -719,7 +727,7 @@ class Sopinhouden_model extends MY_Model{
} }
if ($targetversieid){ if ($targetversieid){
$targetversie = $this->Orgversies_model->get_record_by_id($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); $ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid);
if($targetversie->scoretype == 7){ if($targetversie->scoretype == 7){
@@ -742,11 +750,11 @@ class Sopinhouden_model extends MY_Model{
$scores = $scores ? $scores : []; $scores = $scores ? $scores : [];
foreach($scores as $score){ foreach($scores as $score){
$score->gem = 0; // $score->gem = 0;
if ($score->num > 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($targetversie->scoretype == 7){
if($score->gem == $grens3) $score->huidig = 4; if($score->gem == $grens3) $score->huidig = 4;
if($score->gem < $grens3) $score->huidig = 3; if($score->gem < $grens3) $score->huidig = 3;
@@ -16,13 +16,13 @@
<colgroup> <colgroup>
<col style="width: 25px; "> <col style="width: 25px; ">
<col > <col >
<col span='9' style="width: 22px"> <col span='11' style="width: 22px">
</colgroup> </colgroup>
<tr style="background-color: #ded0d7; border: 1px solid grey; border-bottom: none"> <tr style="background-color: #ded0d7; border: 1px solid grey; border-bottom: none">
<td colspan=2 style=" border-bottom: none; "></td> <td colspan=2 style=" border-bottom: none; "></td>
<td colspan=4 style="text-align:center; "> <b>huidige situatie</b></td> <td colspan=5 style="text-align:center; "> <b>huidige situatie</b></td>
<td style="border: 1px; solid grey;"></td> <td style="border: 1px; solid grey;"></td>
<td colspan =4 style="text-align:center; "> <b> gewenste situatie</b></td> <td colspan =5 style="text-align:center; "> <b> gewenste situatie</b></td>
<tr> <tr>
<tr style="background-color: #ded0d7; border: 1px; solid grey; border-top: none"> <tr style="background-color: #ded0d7; border: 1px; solid grey; border-top: none">
<td style="width: 25px; border-bottom: 1px solid grey;border-left: 1px solid grey;font-weight: bold;">nr</td> <td style="width: 25px; border-bottom: 1px solid grey;border-left: 1px solid grey;font-weight: bold;">nr</td>
@@ -31,11 +31,14 @@
<td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur2?>; color:#ffffff"> 2</td> <td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur2?>; color:#ffffff"> 2</td>
<td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur3?>; color:#ffffff"> 3</td> <td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur3?>; color:#ffffff"> 3</td>
<td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur4?>; color:#ffffff"> 4</td> <td style=" border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur4?>; color:#ffffff"> 4</td>
<td style=" border-bottom: 1px solid grey;text-align:center; background-color: #808080"> </td>
<td style="border-bottom: 1px solid grey;background-color:#ded0d7"></td> <td style="border-bottom: 1px solid grey;background-color:#ded0d7"></td>
<td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur1?>; color:#ffffff"> 1</td> <td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur1?>; color:#ffffff"> 1</td>
<td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur2?>; color:#ffffff"> 2</td> <td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur2?>; color:#ffffff"> 2</td>
<td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur3?>; color:#ffffff"> 3</td> <td style="border-bottom: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur3?>; color:#ffffff"> 3</td>
<td style="border-bottom: 1px solid grey; border-right: 1px solid grey;text-align:center; background-color: <?=$data['kleuren']->kleur4?>; color:#ffffff"> 4</td> <td style="border-bottom: 1px solid grey; text-align:center; background-color: <?=$data['kleuren']->kleur4?>; color:#ffffff"> 4</td>
<td style="border-bottom: 1px solid grey;text-align:center; background-color: #808080; border-right: 1px solid grey; "> </td>
</tr> </tr>
<?php <?php
if ($data['lijsten'][0]->scores){ if ($data['lijsten'][0]->scores){
@@ -43,30 +46,43 @@
if($ijkpunt->nummer != 'gem'){?> if($ijkpunt->nummer != 'gem'){?>
<tr style="border:1px solid #dddddd;"> <tr style="border:1px solid #dddddd;">
<td style="border:1px solid #dddddd; text-align:right; padding-right:3px"><?php echo $ijkpunt->nummer;?></td> <td style="border:1px solid #dddddd; text-align:right; padding-right:3px"><?php echo $ijkpunt->nummer;?></td>
<td style="border:1px solid #dddddd;padding-left:2px;"><?php if (isset($ijkpunt->omschrijving)){echo $ijkpunt->omschrijving;}?></td> <td style="border:1px solid #dddddd;padding-left:2px;"><?php if (isset($ijkpunt->omschrijving)){echo $ijkpunt->omschrijving;}?>
<td style="border:1px solid #dddddd" > <span><?php if (isset($ijkpunt->omschrijving)){echo $ijkpunt->omschrijving;}?></span>
<?php if ($ijkpunt->huidig == 1){?> <span><?php if ($ijkpunt->disabled== 'T'){echo '(uit)';} ?></span>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div> <span><?php if ($ijkpunt->disablenvt == 'T' &&$ijkpunt->disabled== 'F' ){echo '(nvt)';} ?></span>
<?php };?>
</td> </td>
<?php if ($ijkpunt->disabled == 'F' && $ijkpunt->disablenvt == 'F'){?>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 1 ){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?>
</td>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 2){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?>
</td>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 3){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?>
</td>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 4){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?>
</td>
<?php };?>
<td style="border:1px solid #dddddd" > <td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 2){?> <?php if ($ijkpunt->disabled == 'T' || $ijkpunt->disablenvt == 'T' ){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div> <div style="width: 12px; height: 12px;border-radius: 12px; margin-left: 5px;background-color: #808080 "></div>
<?php };?>
</td>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 3){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?>
</td>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->huidig == 4){?>
<div style="width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->kleur)){echo $ijkpunt->kleur;} ?>"></div>
<?php };?> <?php };?>
</td> </td>
<td style="border-bottom:none; border-top:none"></td> <td style="border-bottom:none; border-top:none"></td>
<?php if ($ijkpunt->disabled == 'F' && $ijkpunt->disablenvt == 'F'){?>
<td style="border:1px solid #dddddd" > <td style="border:1px solid #dddddd" >
<?php if (isset($ijkpunt->wens) && $ijkpunt->wens == 1){ ?> <?php if (isset($ijkpunt->wens) && $ijkpunt->wens == 1){ ?>
<div style='width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->wenskleur)){echo $ijkpunt->wenskleur;} ?>'></div> <div style='width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->wenskleur)){echo $ijkpunt->wenskleur;} ?>'></div>
@@ -88,6 +104,12 @@
<div style='width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->wenskleur)){echo $ijkpunt->wenskleur;} ?>'></div> <div style='width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color:<?php if(isset($ijkpunt->wenskleur)){echo $ijkpunt->wenskleur;} ?>'></div>
<?php };?> <?php };?>
</td> </td>
<?php };?>
<td style="border:1px solid #dddddd" >
<?php if ($ijkpunt->disabled == 'T' || $ijkpunt->disablenvt == 'T' ){ ?>
<div style='width: 12px; height: 12px;border-radius: 12px;margin-left: 5px;background-color: #808080'></div>
<?php };?>
</td>
</tr> </tr>
<?php ;}};}; ?> <?php ;}};}; ?>
</table> </table>
@@ -41,12 +41,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($lijst->scores as $score){?> <?php foreach($lijst->scores as $score){
$kleur = $score->disabled == 'T' || $score->disablenvt == 'T' ? '#808080' : $score->kleur; ?>
<tr style="border: 1px solid grey"> <tr style="border: 1px solid grey">
<td style="vertical-align:top; text-align: right; border-right: 1px solid grey; padding-left: 3px; background-color: <?= $kleur ?>">
<?php echo $score->disabled == 'T' ? 'uit' : ($score->disablenvt == 'T' ? 'nvt' : (isset($score->gem) ? $score->gem : '')) ?>
<td style="vertical-align:top; text-align: right; border-right: 1px solid grey; padding-left: 3px; background-color: <?php echo $score->kleur ?>" >
<?php echo $score->gem ?>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
@@ -54,7 +53,7 @@
</table> </table>
<?php } ?> <?php } ?>
<p style="clear: both;">Scores in procenten.</p> <p style=" clear: both;">Scores in procenten.</p>
</div> </div>
<?php ;} ;?> <?php ;} ;?>
</body> </body>
@@ -46,7 +46,7 @@
<tr style="border: 1px solid grey"> <tr style="border: 1px solid grey">
<td style="vertical-align:top; text-align: right: border-right: 1px solid grey; padding-left: 3px; background-color: <?php echo $ijkpunt->kleur ?>" > <td style="vertical-align:top; text-align: right: border-right: 1px solid grey; padding-left: 3px; background-color: <?php echo $ijkpunt->disable== 'F' || $ijkpunt->kleur ?>" >
<?php echo $ijkpunt->gem ?> <?php echo $ijkpunt->gem ?>
</td> </td>
</tr> </tr>
@@ -88,7 +88,6 @@ ls.initOntwikkelModel = function(){
,this) ,this)
} }
function fAddResult(p){ function fAddResult(p){
console.log(p, "p result")
var dit = this; var dit = this;
this.ijkpuntid = p.ijkpunt_id; this.ijkpuntid = p.ijkpunt_id;
this.wensid = 0; this.wensid = 0;
@@ -112,7 +111,6 @@ ls.initOntwikkelModel = function(){
this.toelichting = p.toelichting; this.toelichting = p.toelichting;
this.aantalscholen = p.aantalscholen; this.aantalscholen = p.aantalscholen;
console.log(this.disablentv, 'disablenvt')
} }