kwalOndersteuning

This commit is contained in:
Liesbeth ter Schure
2021-11-21 21:12:26 +01:00
parent 7ea12a20ed
commit 2b258c9a0c
3 changed files with 31 additions and 23 deletions
@@ -79,6 +79,8 @@ class Sopinhouden_model extends MY_Model{
$versie = $result['targetversie']; $versie = $result['targetversie'];
$mbgrafiek = $result['grafiek1']; $mbgrafiek = $result['grafiek1'];
// print_r($mbgrafiek);
// exit;
$imagemb =$this->Phantom_model->create_img($mbgrafiek, 'test', FALSE, FALSE, array(650, 300)); $imagemb =$this->Phantom_model->create_img($mbgrafiek, 'test', FALSE, FALSE, array(650, 300));
$imagedata = "<img src='data:image/png;base64,".$imagemb."' id='mod1image1'/>"; $imagedata = "<img src='data:image/png;base64,".$imagemb."' id='mod1image1'/>";
$pos = strpos($content,'mbgrafiek1'); $pos = strpos($content,'mbgrafiek1');
@@ -571,12 +573,13 @@ class Sopinhouden_model extends MY_Model{
$laagstescore = 101; $laagstescore = 101;
if ($scores) { if ($scores) {
foreach ($scores as $score) { foreach ($scores as $score) {
$score->gem = round($score->gem); $score->gem = round($score->gem);
// //
// if ($score->num > 0) { // if ($score->num > 0) {
// $gem=$score->somscore / $score->num; // $gem=$score->somscore / $score->num;
// }; // };
// $score->kleurcode = $this->kleurcodes->getkleur($score->gem); //LS ACTIEF GEMAAKT
$score->kleurcode = $this->kleurcodes->getkleur($score->gem);
if ($score->disabled == 'F' && $score->disablenvt == 'F') { if ($score->disabled == 'F' && $score->disablenvt == 'F') {
$totgem = $totgem + $score->gem; $totgem = $totgem + $score->gem;
@@ -593,13 +596,12 @@ class Sopinhouden_model extends MY_Model{
if ($ambitie && $score->gem >= $ambitie->zprocent) { if ($ambitie && $score->gem >= $ambitie->zprocent) {
$ijkpuntenok = $ijkpuntenok + 1; $ijkpuntenok = $ijkpuntenok + 1;
}; };
if ($totaantal > 0) {
$totgem = round($totgem / $totaantal, 2);
}
} }
} }
if ($totaantal > 0) {
$totgem = round($totgem / $totaantal, 0);
}
$totgemkleur = $this->kleurcodes->getkleur($totgem); $totgemkleur = $this->kleurcodes->getkleur($totgem);
// foreach scores bereken som en dus totgem en ijkpuntenok // foreach scores bereken som en dus totgem en ijkpuntenok
} }
@@ -624,7 +626,7 @@ class Sopinhouden_model extends MY_Model{
"labels" => $labels, "labels" => $labels,
"scores" => $scores, "scores" => $scores,
'totgem' => $totgem, 'totgem' => $totgem,
'totgemkleur' =>$totgem, 'totgemkleur' =>$totgemkleur,
'ijkpuntenok' => $ijkpuntenok, 'ijkpuntenok' => $ijkpuntenok,
'welkehoogste' => $welkehoogste, 'welkehoogste' => $welkehoogste,
'hoogstescore' => round($hoogstescore,1), 'hoogstescore' => round($hoogstescore,1),
+18 -12
View File
@@ -16,28 +16,34 @@
var ambitiescore= <?php echo $ambitie->gemscore; ?>; var ambitiescore= <?php echo $ambitie->gemscore; ?>;
var lijnAt = (((100 - parseFloat(ambitiescore)) / 10 ) * 25 ) +12; var lijnAt = (((100 - parseFloat(ambitiescore)) / 10 ) * 25 ) +12;
var j=0; var j=0;
var colors=[]
<?php foreach($scores as $index => $score){ ?> <?php foreach($scores as $index => $score){ ?>
slabels.push('<?= $score->nummer ?>'); slabels.push('<?= $score->nummer ?>');
tekstlabels.push('<?= $score->omschrijving ?>'); tekstlabels.push('<?= $score->omschrijving ?>');
scores.push({ // scores.push({
y: <?= $score->gem ?>, // y: <?= $score->gem ?>,
color: '<?= isset($score->kleur)? $score->kleur : "#808080" ?>', // color: '<?= isset($score->kleur)? $score->kleur : "#808080" ?>',
name: '<?= $score->nummer ?>', // name: '<?= $score->nummer ?>',
});
// });
scores.push(<?=$score->gem ?>)
colors.push('<?= isset($score->kleurcode) ? $score->kleurcode : "#808080" ?>')
<?php } ?> <?php } ?>
slabels.push('gem')
var ctxSchoolijkpunt2=$("#schoolijkpunt2").get(0).getContext("2d"); scores.push(<?= $totgem ?>)
colors.push('<?= isset($totgemkleur) ? $totgemkleur : "#808080" ?>')
var ctxSchoolijkpunt2=$("#schoolijkpunt2").get(0).getContext("2d");
var data5 = {labels :slabels, var data5 = {labels :slabels,
datasets: [{ label: tekstlabels, datasets: [{ label: tekstlabels,
fillColor: "rgba(147,15,80,0.9)", fillColor: "rgba(147,15,80,0.9)",
strokeColor: "rgba(111,11,61,1)", strokeColor: "rgba(111,11,61,1)",
highlightStroke: "rgba(222,22,123,1)", highlightStroke: "rgba(222,22,123,1)",
data: scores}, data: scores
},
]} ]}
Chart.types.Bar.extend({ Chart.types.Bar.extend({
@@ -34,15 +34,15 @@
</thead> </thead>
<tbody > <tbody >
<?php foreach($scores as $score){ <?php foreach($scores as $score){
$kleur = $score->disabled == 'T' || $score->disablenvt == 'T' ? '#808080' : $score->kleurcode; ?> $kleur = $score->disabled == 'T' || $score->disablenvt == 'T' ? '#808080' : $score->kleurcode; ?>
// $gem =round($score->somscore / $score->num,1); <!-- // $gem =round($score->somscore / $score->num,1);
//$backgroundcolor =$score->kleurcode; //$backgroundcolor =$score->kleurcode;
// if ($gem >50 )$backgroundcolor = "#fea719"; // if ($gem >50 )$backgroundcolor = "#fea719";
// if ($gem > 70) $backgroundcolor = "#15d029"; // if ($gem > 70) $backgroundcolor = "#15d029";
// if ($gem > 90) $backgroundcolor = "#1558d0"; // if ($gem > 90) $backgroundcolor = "#1558d0";
?> ?>
-->
<tr style="border-bottom: 1px solid #ebebeb" > <tr style="border-bottom: 1px solid #ebebeb" >
<td style="vertical-align:top" ><?=$score->nummer?></td> <td style="vertical-align:top" ><?=$score->nummer?></td>
<td style="vertical-align:top" ><?=$score->omschrijving?></td> <td style="vertical-align:top" ><?=$score->omschrijving?></td>