tussenopslag
This commit is contained in:
@@ -21,6 +21,7 @@ class Streefcijfers extends MY_Controller{
|
||||
$swvid = null;
|
||||
$kamerid = null;
|
||||
$bgid = null;
|
||||
$schoolid = null;
|
||||
switch ($organisatie->soort) {
|
||||
case 1: $swvid = $organisatie->id;
|
||||
break;
|
||||
@@ -32,7 +33,8 @@ class Streefcijfers extends MY_Controller{
|
||||
$org2 = $this->Organisaties_model->get_record_by_id($kamerid);
|
||||
$swvid = $org2->valtonder_id;
|
||||
break;
|
||||
case 4: $bgid = $organisatie->valtonder_id;
|
||||
case 4: $schoolid = $organisatie->id;
|
||||
$bgid = $organisatie->valtonder_id;
|
||||
$org2 = $this->Organisaties_model->get_record_by_id($bgid);
|
||||
$kamerid = $org2->valtonder_id;
|
||||
$org3 = $this->Organisaties_model->get_record_by_id($kamerid);
|
||||
@@ -41,7 +43,8 @@ class Streefcijfers extends MY_Controller{
|
||||
} ; // einde switch
|
||||
return array('swvid'=>$swvid,
|
||||
"kamerid" =>$kamerid,
|
||||
"bgid" =>$bgid);
|
||||
"bgid" =>$bgid,
|
||||
"schoolid" =>$schoolid);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +64,8 @@ class Streefcijfers extends MY_Controller{
|
||||
// let op dit is een array
|
||||
break;
|
||||
case 2:
|
||||
case 3: $orgversies = $this->Orgversies_model->getallorgversies($hierarchie['kamerid'],$module, true);
|
||||
case 3:
|
||||
case 4:$orgversies = $this->Orgversies_model->getallorgversies($hierarchie['kamerid'],$module, true);
|
||||
if (!$orgversies){
|
||||
$orgversies = $this->Orgversies_model->getallorgversies($hierarchie['swvid'],$module, true);
|
||||
}
|
||||
@@ -113,6 +117,65 @@ class Streefcijfers extends MY_Controller{
|
||||
echo json_encode($ambities);
|
||||
}
|
||||
|
||||
function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
function mh_getorgversies_ambities(){
|
||||
if (!$this->userid) die;
|
||||
$orgid = $this->uri->segment(4);
|
||||
$module = $this->session->userdata('module');
|
||||
|
||||
$ambitieorgs = '';
|
||||
$ambitieorgs = $this->getAmbitieOrgs($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, ',' );
|
||||
|
||||
$orgversies = $this->Orgversies_model->getorgversies($toporgs, $module);
|
||||
if(!$orgversies) echo json_encode("geen orgversies");
|
||||
|
||||
$ambities = [];
|
||||
foreach($orgversies as $orgversie) {
|
||||
$ambitie = $this->Ambities_model->get_ambities_orgversie($orgversie->id, $ambitieorgs, $toporgs);
|
||||
if ($ambitie) $ambtities [] = $ambitie;
|
||||
else {
|
||||
$aantalY = $this->Ijkpunten_model->telijkpunten($orgversie->id);
|
||||
$ambities[] = ['id' => 0,
|
||||
'gemscore' => 80,
|
||||
'aantalY' => $aantalY,
|
||||
'xijkpunten' => round($aantalY * 0.8),
|
||||
'z_procent' => 60,
|
||||
'orgversieid' => $orgversie->id,
|
||||
'geldigvanaf' => $orgversie->geldigvanaf,
|
||||
'geldigtm' => $orgversie->geldigtm,
|
||||
'periodenummer' => $orgversie->periodenummer,
|
||||
'actief' => $orgversie->actief,
|
||||
'naam' => $orgversie->naam,
|
||||
'soort' => 0];
|
||||
}
|
||||
|
||||
echo json_encode($ambities);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// function getorgversies_ambities_oud(){
|
||||
// $versies = false;
|
||||
// $module = $this->session->userdata('module');
|
||||
|
||||
@@ -102,4 +102,41 @@ class Ambities_model extends MY_Model{
|
||||
};
|
||||
return $ambitie;
|
||||
}
|
||||
|
||||
function get_ambities_orgversie($orgversieid, $ambitieorgs, $toporgs)
|
||||
{
|
||||
$this->sql = "
|
||||
SELECT A.id,
|
||||
A.gem_score AS gemscore,
|
||||
A.z_procent AS zprocent,
|
||||
OV.id AS orgversie_id,
|
||||
DATE_FORMAT( OV.geldigvanaf, '%d-%m-%Y') as geldigvanaf,
|
||||
DATE_FORMAT( OV.geldigtm, '%d-%m-%Y') as geldigtm,
|
||||
OV.periodenummer, OV.actief, V.naam,
|
||||
O.soort
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ambities A ON A.orgversie_id = OV.id
|
||||
JOIN tb_organisaties O ON A.organisatie_id = O.id
|
||||
WHERE A.organisatie_id IN ({$ambitieorgs})
|
||||
AND OV.organisatie_id IN ({$toporgs})
|
||||
AND OV.id = {$orgversieid}
|
||||
ORDER BY soort DESC
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
";
|
||||
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,29 @@ class Orgversies_model extends MY_Model{
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
function getorgversies($toporgs, $module){
|
||||
$this->sql="SELECT OV.id,
|
||||
periodenummer,
|
||||
OV.actief,
|
||||
DATE_FORMAT(geldigvanaf,'%d-%m-%Y') as geldigvanaf,
|
||||
DATE_FORMAT(geldigtm,'%d-%m-%Y') as geldigtm,
|
||||
V.naam,
|
||||
COUNT(Y.id) AS aantalY
|
||||
|
||||
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON V.id = versie_id
|
||||
JOIN tb_ijkpunten Y ON V.id = Y.versie_id
|
||||
WHERE OV.organisatie_id IN ({$toporgs})
|
||||
AND V.modulenr = {$module}
|
||||
AND Y.disabled = 'F' ";
|
||||
|
||||
$this->sql .=" GROUP BY OV.id
|
||||
ORDER BY periodenummer DESC";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function getVersieinfo($orgversieid){
|
||||
$this->sql="SELECT OV.id AS orgversieid,
|
||||
OV.organisatie_id,
|
||||
|
||||
@@ -1,55 +1,213 @@
|
||||
<div class="col-sm-12 mainpagina" id ="pagstreefcijfers">
|
||||
<div class="row" >
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<div class="col-sm-12 col-md-4">
|
||||
<h3>Selecteer een organisatieniveau</h3>
|
||||
<table style="width:100%">
|
||||
<tbody data-bind="foreach: swv">
|
||||
<tr class="swv" data-bind=" css: {'selected' : $parent.selectedOrganisatie().id ==id},
|
||||
click:$parent.fSetSelected ">
|
||||
|
||||
<td style="width:100%"
|
||||
data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
<tr data-bind="visible: kamers() !== undefined">
|
||||
|
||||
<td >
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: kamers">
|
||||
<tr class="kamer selectable"
|
||||
data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},
|
||||
click: $root.fSetSelected">
|
||||
<td style="width:5%"></td>
|
||||
<td style="width: 95%" data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
<tr data-bind="visible: bgs() !== undefined ">
|
||||
<td></td>
|
||||
<td >
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class= "selectable"
|
||||
data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},
|
||||
click: $root.fSetSelected">
|
||||
|
||||
<td style="width: 100%" data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- <table style="width:100%">-->
|
||||
<!-- <tbody data-bind="foreach: swv">-->
|
||||
<!-- <tr class="swv" data-bind=" css: {'selected' : $parent.selectedOrganisatie().id ==id},-->
|
||||
<!-- click:$parent.fSetSelected ">-->
|
||||
<!-- -->
|
||||
<!-- <td style="width:100%"-->
|
||||
<!-- data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr data-bind="visible: kamers() !== undefined">-->
|
||||
<!-- -->
|
||||
<!-- <td >-->
|
||||
<!-- <table style="width: 100%">-->
|
||||
<!-- <tbody data-bind="foreach: kamers">-->
|
||||
<!-- <tr class="kamer selectable" -->
|
||||
<!-- data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},-->
|
||||
<!-- click: $root.fSetSelected">-->
|
||||
<!-- <td style="width:5%"></td>-->
|
||||
<!-- <td style="width: 95%" data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr data-bind="visible: bgs() !== undefined "> -->
|
||||
<!-- <td></td>-->
|
||||
<!-- <td >-->
|
||||
<!-- <table style="width: 100%">-->
|
||||
<!-- <tbody data-bind="foreach: bgs">-->
|
||||
<!-- <tr class= "selectable"-->
|
||||
<!-- data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},-->
|
||||
<!-- click: $root.fSetSelected">-->
|
||||
<!-- -->
|
||||
<!-- <td style="width: 100%" data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody> -->
|
||||
<!-- </table> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- </tbody> -->
|
||||
<!-- </table>-->
|
||||
<!-- <td> -->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
|
||||
|
||||
<div style = "max-height: 300px; overflow-y:auto">
|
||||
|
||||
<!-- ko if : orgsoort() ==4 -->
|
||||
<div data-bind="visible: orgsoort()== 4, with: toporg">
|
||||
<p data-bind="text: brin + ' - ' + naam"></p>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if : orgsoort() ==3 -->
|
||||
<div data-bind="visible: orgsoort() == 3">
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="with: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if: orgsoort() ==2 -->
|
||||
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2 style="padding-left: 20px;">
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2 style="padding-left: 20px;">
|
||||
<table>
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if: orgsoort() ==1 -->
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: kamers">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
|
||||
<tr data-bind="visible: geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible:geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /ko -->
|
||||
</div >
|
||||
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-9" data-bind="visible: selectedOrganisatie().id !=0">
|
||||
<div class="col-sm-12 col-md-8" data-bind="visible: selectedOrg().id !=0">
|
||||
<h4> Criteria voor scholen onder organisatie:
|
||||
<span data-bind="text: selectedOrganisatie().naam"></span>
|
||||
<span data-bind="text: selectedOrg().naam"></span>
|
||||
</h4>
|
||||
<table style="width: 100%;">
|
||||
<thead>
|
||||
@@ -74,7 +232,7 @@
|
||||
<td><input class="integer"
|
||||
data-bind="textInput: xijkpunten, event:{input: $root.fUpdateAmbitie},enable:wijzigok" /> ijkpunten
|
||||
op <input class="integer"
|
||||
data-bind="textInput: zprocent, event:{input: $root.fUpdateAmbitie}, enable:wijzigok" />% of hoger
|
||||
data-bind="textInput: zprocent, event:{input: $root.fUpdateAmbitie}, enable:wijzigok" />% of hoger
|
||||
</td>
|
||||
<td class="glyphicon glyphicon-trash" data-bind="click:$root.fDelete"></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user