tussenopslag
This commit is contained in:
@@ -111,7 +111,6 @@ class Lijsten
|
||||
$this->setBrin();
|
||||
$this->setLabels();
|
||||
$this->setAmbities();
|
||||
$this->setZprocent();
|
||||
$this->setSchoolScores();
|
||||
$this->setIndividueleScores();
|
||||
$this->setBestuurScores();
|
||||
@@ -183,18 +182,38 @@ class Lijsten
|
||||
}
|
||||
|
||||
private function setAmbities(){
|
||||
$ambitie = $this->CI->Ambities_model->getOrgAmbities($this->lijst->orgversieid, $this->orgid);
|
||||
$ambitieorgs = '';
|
||||
$ambitieorgs = $this->getAmbitieOrgs($this->orgid, $ambitieorgs);
|
||||
$ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
|
||||
$toporgsarray = explode(',', $ambitieorgs);
|
||||
$toporgs = '';
|
||||
$index = 0;
|
||||
for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
if($index < 2) {
|
||||
$toporgs .= $toporgsarray[$i] . ',';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
$toporgs = rtrim($toporgs, ',' );
|
||||
|
||||
$ambitie = $this->CI->Ambities_model->mh_get_ambitie_orgversie($this->lijst->orgversieid, $ambitieorgs, $toporgs);
|
||||
|
||||
if (!in_array($ambitie, $this->ambitiearray, FALSE)) {
|
||||
$this->lijst->ambities = $ambitie;
|
||||
$this->ambitiearray [] = $ambitie;
|
||||
}
|
||||
}
|
||||
|
||||
private function setZprocent(){
|
||||
$this->zprocent = 0;
|
||||
if(isset($this->lijst->ambities)){
|
||||
$this->zprocent = $this->lijst->ambities->zprocent;
|
||||
private function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->CI->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
private function setSchoolScores(){
|
||||
|
||||
@@ -142,7 +142,41 @@ function mh_get_ambitie($moduleid, $ambitieorgs, $toporgs){
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
function mh_get_ambitie_orgversie($orgversieid, $ambitieorgs, $toporgs){
|
||||
$this->sql = " SELECT COALESCE(A.id, 0) AS ambitieID,
|
||||
COALESCE(A.gem_score, 80) AS gemscore,
|
||||
COUNT(Y.id) AS aantalY,
|
||||
COALESCE(A.x_ijkpunten, ROUND(COUNT(Y.id) * 0.8)) AS xijkpunten,
|
||||
COALESCE(A.z_procent, 60) AS zprocent,
|
||||
OV.id AS orgversie_id,
|
||||
COALESCE(O.soort, 0) AS soort,
|
||||
O.id AS orgID,
|
||||
CASE WHEN O.soort IS NULL THEN
|
||||
'standaard'
|
||||
WHEN O.soort = 1 THEN
|
||||
'swv'
|
||||
WHEN O.soort = 2 THEN
|
||||
'regio'
|
||||
WHEN O.soort = 3 THEN
|
||||
'bestuur'
|
||||
WHEN O.soort = 4 THEN
|
||||
'school'
|
||||
END AS ambitievan
|
||||
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ijkpunten Y ON V.id = Y.versie_id
|
||||
LEFT JOIN tb_ambities A ON A.orgversie_id = OV.id
|
||||
LEFT JOIN tb_organisaties O ON A.organisatie_id = O.id
|
||||
WHERE (A.organisatie_id IN ({$ambitieorgs}) OR A.id IS NULL)
|
||||
AND OV.organisatie_id IN ({$toporgs})
|
||||
AND OV.id = {$orgversieid}
|
||||
AND OV.actief = 1
|
||||
AND Y.disabled = 'F'
|
||||
ORDER BY soort DESC
|
||||
LIMIT 1 ";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -447,11 +447,15 @@
|
||||
<div class="col-xs-5">
|
||||
<h4 style="margin-top: 30px; margin-left: 10px;">Ambities</h4>
|
||||
<div data-bind="foreach: lijsten" style="margin: 5px">
|
||||
<div class="col-xs-11" style="background-color:#f5f0f2; padding: 5px; padding-left: 10px;border-radius: 2px" data-bind="visible: ambities() == true">
|
||||
<p style="font-weight: bold; margin-bottom: 10px" data-bind="text: vantm + ':'"></p>
|
||||
<p style="margin-bottom: 10px"data-bind="text: 'gemiddelde score ' + gemscore + '%' "></p>
|
||||
<p style="margin-bottom: 10px"data-bind="text: 'minimaal ' + ijkpunten + ' ' + label + ' op ' + zprocent + ' % of hoger' ">
|
||||
</p>
|
||||
<div class="col-xs-11" style="background-color:#f5f0f2; padding: 5px; padding-left: 10px;border-radius: 2px">
|
||||
<span style="font-weight: bold; margin-bottom: 10px" data-bind="text: vantm + ':'"></span>
|
||||
<br>
|
||||
<span data-bind="text: 'gemiddelde score ' + gemscore + '%' "></span>
|
||||
<br>
|
||||
<span data-bind="text: 'minimaal ' + ijkpunten + ' ' + label + ' op ' + zprocent + ' % of hoger' ">
|
||||
</span>
|
||||
<br>
|
||||
<span data-bind="text: '(ambitie ' + ambitievan + ')'"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -128,24 +128,12 @@ ls.initIJkpuntenModel = function(){
|
||||
this.jaartal = l.jaartal;
|
||||
|
||||
this.label = l.label;
|
||||
this.ambities = ko.observable(false);
|
||||
if(l.ambities) {
|
||||
if (l.ambities.gemscore && l.ambities.xijkpunten && l.ambities.zprocent) {
|
||||
dit.ambities(true);
|
||||
}
|
||||
}
|
||||
this.gemscore = 0;
|
||||
if(l.ambities) {
|
||||
dit.gemscore = l.ambities.gemscore;
|
||||
}
|
||||
this.ijkpunten = 0;
|
||||
if(l.ambities) {
|
||||
dit.ijkpunten = l.ambities.xijkpunten;
|
||||
}
|
||||
this.zprocent = 0;
|
||||
if(l.ambities) {
|
||||
dit.zprocent = l.ambities.zprocent;
|
||||
}
|
||||
this.gemscore = l.ambities.gemscore;
|
||||
this.ijkpunten = l.ambities.xijkpunten;
|
||||
this.zprocent = l.ambities.zprocent;
|
||||
this.ambitievan = l.ambities.ambitievan;
|
||||
|
||||
|
||||
|
||||
this.scores = ko.observableArray([]);
|
||||
this.erzijnscores = ko.observable(true);
|
||||
|
||||
Reference in New Issue
Block a user