sommen parseInt, groepen filteren op schooljaar
This commit is contained in:
@@ -101,7 +101,8 @@ class MY_Controller extends CI_Controller{
|
|||||||
// public $version = '1.21.00L'; //2factor -twee
|
// public $version = '1.21.00L'; //2factor -twee
|
||||||
// public $version = '1.21.01M'; //verbeteringen compact sop
|
// public $version = '1.21.01M'; //verbeteringen compact sop
|
||||||
// public $version = '1.21.02M '; //monfin, geen rode cijfers
|
// public $version = '1.21.02M '; //monfin, geen rode cijfers
|
||||||
public $version = '1.21.03M '; //mondiv ondersteuningsvorm archiveren per groep
|
// public $version = '1.21.03M '; //mondiv ondersteuningsvorm archiveren per groep
|
||||||
|
public $version = '1.21.04M '; //mondiv ondersteuningsvorm archiveren per groep foutem hersteld
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,13 +37,14 @@ class Aantalxondersteuningsvorm_model extends MY_Model{
|
|||||||
return $this->get_query_row('aantal');
|
return $this->get_query_row('aantal');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getaantallen($vormid, $orgid){
|
function getaantallen($vormid, $orgid, $schooljaarnr, $groepsids){
|
||||||
$this->sql ="SELECT G.id, G.naam, IF(AOS.id,aantal,0) AS aantal
|
$this->sql ="SELECT G.id, G.naam, IF(AOS.id,aantal,0) AS aantal
|
||||||
FROM tb_groepen G
|
FROM tb_groepen G
|
||||||
LEFT JOIN tb_aantalxondersteuningsvorm AOS ON ( G.id = AOS.groep_id
|
LEFT JOIN tb_aantalxondersteuningsvorm AOS ON ( G.id = AOS.groep_id
|
||||||
AND AOS.ondersteuningsvorm_id = {$vormid})
|
AND AOS.ondersteuningsvorm_id = {$vormid})
|
||||||
WHERE G.organisatie_id = {$orgid}
|
WHERE G.organisatie_id = {$orgid}
|
||||||
|
AND G.schooljaarnr = {$schooljaarnr}
|
||||||
|
AND G.id IN ({$groepsids})
|
||||||
ORDER BY G.niveau, G.naam, G.id";
|
ORDER BY G.niveau, G.naam, G.id";
|
||||||
return $this->get_query_result();
|
return $this->get_query_result();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,23 +13,32 @@ class Groepen_model extends MY_Model{
|
|||||||
$this->load->model($models);
|
$this->load->model($models);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getgroep($groepid){
|
function getgroep($groepid){
|
||||||
$this->sql = "SELECT GR.id,
|
$this->sql = "SELECT GR.id,
|
||||||
GR.naam,
|
GR.naam,
|
||||||
GR.totaantal,
|
GR.totaantal,
|
||||||
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
|
|
||||||
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
|
||||||
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
|
||||||
(totaantal - SUM(AX.aantal) ) AS som1
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
|
||||||
FROM tb_groepen GR
|
|
||||||
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
( GR.totaantal - (
|
||||||
ON GR.id = AX.groep_id
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
LEFT JOIN tb_ondersteuningsvormen OV
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
ON OV.id = AX.ondersteuningsvorm_id
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
|
||||||
WHERE GR.id = {$groepid}
|
)
|
||||||
GROUP BY GR.id";
|
) AS som1
|
||||||
return $this->get_query_row();
|
FROM tb_groepen GR
|
||||||
}
|
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
||||||
|
ON GR.id = AX.groep_id
|
||||||
|
LEFT JOIN tb_ondersteuningsvormen OV
|
||||||
|
ON OV.id = AX.ondersteuningsvorm_id
|
||||||
|
WHERE GR.id = {$groepid}
|
||||||
|
GROUP BY GR.id";
|
||||||
|
return $this->get_query_row();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getgroepenlist($orgid, $schooljaarnr, $module){
|
function getgroepenlist($orgid, $schooljaarnr, $module){
|
||||||
$this->sql = "SELECT id, naam, ondersteuning
|
$this->sql = "SELECT id, naam, ondersteuning
|
||||||
FROM tb_groepen
|
FROM tb_groepen
|
||||||
@@ -81,55 +90,67 @@ class Groepen_model extends MY_Model{
|
|||||||
return $this->get_query_row('aantallln');
|
return $this->get_query_row('aantallln');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getgroepen($orgid, $schooljaarnr, $module){
|
|
||||||
$this->sql = "SELECT GR.id,
|
|
||||||
GR.naam,
|
|
||||||
GR.niveau,
|
|
||||||
GR.totaantal,
|
|
||||||
GR.ondersteuning,
|
|
||||||
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
|
|
||||||
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
|
|
||||||
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
|
|
||||||
(GR.totaantal - IF(SUM(AX.aantal) , SUM(AX.aantal),0) ) AS som1
|
|
||||||
FROM tb_groepen GR
|
|
||||||
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
|
||||||
ON GR.id = AX.groep_id
|
|
||||||
LEFT JOIN tb_ondersteuningsvormen OV
|
|
||||||
ON OV.id = AX.ondersteuningsvorm_id
|
|
||||||
WHERE GR.organisatie_id = {$orgid}
|
|
||||||
AND GR.schooljaarnr = {$schooljaarnr}
|
|
||||||
AND GR.schooltype = 'R'
|
|
||||||
AND GR.module = {$module}
|
|
||||||
GROUP BY GR.id
|
|
||||||
ORDER BY niveau, naam, GR.id ";
|
|
||||||
return $this->get_query_result();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getgekopieerdegroepen($orgid, $schooljaarnr, $module){
|
function getgroepen($orgid, $schooljaarnr, $module){
|
||||||
$this->sql = "SELECT GR.id,
|
$this->sql = "SELECT GR.id,
|
||||||
GR.naam,
|
GR.naam,
|
||||||
GR.niveau,
|
GR.niveau,
|
||||||
GR.totaantal,
|
GR.totaantal,
|
||||||
|
GR.ondersteuning,
|
||||||
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
|
|
||||||
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
|
||||||
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
|
||||||
(GR.totaantal - IF(SUM(AX.aantal) , SUM(AX.aantal),0) ) AS som1
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
|
||||||
FROM tb_groepen GR
|
|
||||||
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
( GR.totaantal - (
|
||||||
ON GR.id = AX.groep_id
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
LEFT JOIN tb_ondersteuningsvormen OV
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
ON OV.id = AX.ondersteuningsvorm_id
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
|
||||||
WHERE GR.organisatie_id = {$orgid}
|
)
|
||||||
AND GR.schooljaarnr = {$schooljaarnr}
|
) AS som1
|
||||||
AND GR.schooltype = 'R'
|
FROM tb_groepen GR
|
||||||
AND GR.module = {$module}
|
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
||||||
GROUP BY GR.id
|
ON GR.id = AX.groep_id
|
||||||
ORDER BY niveau, naam, GR.id ";
|
LEFT JOIN tb_ondersteuningsvormen OV
|
||||||
|
ON OV.id = AX.ondersteuningsvorm_id
|
||||||
|
WHERE GR.organisatie_id = {$orgid}
|
||||||
|
AND GR.schooljaarnr = {$schooljaarnr}
|
||||||
|
AND GR.schooltype = 'R'
|
||||||
|
AND GR.module = {$module}
|
||||||
|
GROUP BY GR.id
|
||||||
|
ORDER BY niveau, naam, GR.id ";
|
||||||
return $this->get_query_result();
|
return $this->get_query_result();
|
||||||
}
|
}
|
||||||
|
function getgekopieerdegroepen($orgid, $schooljaarnr, $module){
|
||||||
|
$this->sql = "SELECT GR.id,
|
||||||
|
GR.naam,
|
||||||
|
GR.niveau,
|
||||||
|
GR.totaantal,
|
||||||
|
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
|
||||||
|
|
||||||
|
( GR.totaantal - (
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
|
||||||
|
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
|
||||||
|
)
|
||||||
|
) AS som1
|
||||||
|
FROM tb_groepen GR
|
||||||
|
LEFT JOIN tb_aantalxondersteuningsvorm AX
|
||||||
|
ON GR.id = AX.groep_id
|
||||||
|
LEFT JOIN tb_ondersteuningsvormen OV
|
||||||
|
ON OV.id = AX.ondersteuningsvorm_id
|
||||||
|
WHERE GR.organisatie_id = {$orgid}
|
||||||
|
AND GR.schooljaarnr = {$schooljaarnr}
|
||||||
|
AND GR.schooltype = 'R'
|
||||||
|
AND GR.module = {$module}
|
||||||
|
GROUP BY GR.id
|
||||||
|
ORDER BY niveau, naam, GR.id ";
|
||||||
|
return $this->get_query_result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getGroepenSboSo($orgid, $schooljaarnr){
|
function getGroepenSboSo($orgid, $schooljaarnr){
|
||||||
$this->sql = "SELECT GR.id,
|
$this->sql = "SELECT GR.id,
|
||||||
|
|||||||
@@ -30,10 +30,10 @@
|
|||||||
data-bind="click: $parent.fDeleteGroep, visible: $parent.writer()"></button></td>
|
data-bind="click: $parent.fDeleteGroep, visible: $parent.writer()"></button></td>
|
||||||
<td class="vat" data-bind="text: naam"></td>
|
<td class="vat" data-bind="text: naam"></td>
|
||||||
<td class="vat" style="text-align:right" data-bind="text: totaantal"></td>
|
<td class="vat" style="text-align:right" data-bind="text: totaantal"></td>
|
||||||
<td class="vat" style="text-align:right" data-bind="text: som1() > 0 ? som1 : '' "></td>
|
<td class="vat" style="text-align:right" data-bind="text: som1() > 0 ? som1() : '' "></td>
|
||||||
<td class="vat" style="text-align:right" data-bind="text: som2() > 0 ? som2 : '' " ></td>
|
<td class="vat" style="text-align:right" data-bind="text: som2() > 0 ? som2() : '' " ></td>
|
||||||
<td class="vat" style="text-align:right" data-bind="text: som3() > 0 ? som3 : ''" ></td>
|
<td class="vat" style="text-align:right" data-bind="text: som3() > 0 ? som3() : ''" ></td>
|
||||||
<td class="vat" style="text-align:right" data-bind="text: som4() > 0 ? som4 : '' " ></td>
|
<td class="vat" style="text-align:right" data-bind="text: som4() > 0 ? som4() : '' " ></td>
|
||||||
<td class="vat" style="padding-left:15px">
|
<td class="vat" style="padding-left:15px">
|
||||||
<!-- ko foreach: leerkrachten-->
|
<!-- ko foreach: leerkrachten-->
|
||||||
<span data-bind="text:fullname"></span><br />
|
<span data-bind="text:fullname"></span><br />
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<td style="vertical-align:top">
|
<td style="vertical-align:top">
|
||||||
|
|
||||||
<!-- ko foreach: $parent.leerkrachten -->
|
<!-- ko foreach: $parent.leerkrachten -->
|
||||||
<p style="margin:0px" data-bind="text: fullname, visible: selected()"></p>
|
<p style="margin:0" data-bind="text: fullname, visible: selected()"></p>
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
|
|
||||||
<div data-bind="visible: toonLK"
|
<div data-bind="visible: toonLK"
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ $(function(){
|
|||||||
this.id = p.id;
|
this.id = p.id;
|
||||||
this.naam = p.naam
|
this.naam = p.naam
|
||||||
this.niveau = p.niveau;
|
this.niveau = p.niveau;
|
||||||
this.totaantal = ko.observable(p.totaantal);
|
this.totaantal = ko.observable(parseInt(p.totaantal, 10)|| 0);
|
||||||
this.aantal2 = ko.observable(p.totaantal);
|
this.aantal2 = ko.observable(parseInt(p.totaantal, 10) || 0);
|
||||||
this.som1 = ko.observable(p.som1);
|
this.som1 = ko.observable(parseInt(p.som1, 10)|| 0);
|
||||||
this.som2 = ko.observable(p.som2);
|
this.som2 = ko.observable(parseInt(p.som2, 10)|| 0);
|
||||||
this.som3 = ko.observable(p.som3);
|
this.som3 = ko.observable(parseInt(p.som3, 10)|| 0);
|
||||||
this.som4 = ko.observable(p.som4);
|
this.som4 = ko.observable(parseInt(p.som4, 10)|| 0);
|
||||||
this.leerkrachten = ko.observableArray([]);
|
this.leerkrachten = ko.observableArray([]);
|
||||||
var dit = this;
|
var dit = this;
|
||||||
if (p.leerkrachten){
|
if (p.leerkrachten){
|
||||||
@@ -335,14 +335,15 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}) // delete groepxuser
|
}) // delete groepxuser
|
||||||
self.selectedGroep().totaantal(self.editGroep().totaantal());
|
self.selectedGroep().totaantal(parseInt(self.editGroep().totaantal(), 10));
|
||||||
|
|
||||||
// hier alle regels en/of aantallen opslaan
|
// hier alle regels en/of aantallen opslaan
|
||||||
|
|
||||||
self.selectedGroep().som1(self.selectedGroep().totaantal());
|
self.selectedGroep().som1(parseInt(self.editGroep().basis(), 10) || 0);
|
||||||
self.selectedGroep().som2(0);
|
self.selectedGroep().som2(parseInt(self.editGroep().totplus(), 10) || 0);
|
||||||
self.selectedGroep().som3(0);
|
self.selectedGroep().som3(parseInt(self.editGroep().totextra(), 10) || 0);
|
||||||
self.selectedGroep().som4(0);
|
self.selectedGroep().som4(parseInt(self.editGroep().totextraplus(), 10) || 0);
|
||||||
|
|
||||||
|
|
||||||
if (self.editGroep().ondersteuningsvormen()){
|
if (self.editGroep().ondersteuningsvormen()){
|
||||||
$.each(self.editGroep().ondersteuningsvormen(), function(i,p){
|
$.each(self.editGroep().ondersteuningsvormen(), function(i,p){
|
||||||
@@ -360,18 +361,8 @@ $(function(){
|
|||||||
if (p.id == null || p.id == 0) p.id = result;
|
if (p.id == null || p.id == 0) p.id = result;
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
// HIER NOG OPTELLEN VAN LEERLINGEN PER ONDERSTEUNINGSVORM VOOR SELECTED GROEP
|
|
||||||
if (p.aantal()) {
|
|
||||||
self.selectedGroep().som1(self.selectedGroep().som1() - parseInt(p.aantal()));
|
|
||||||
switch (p.nivo){
|
|
||||||
case '2': self.selectedGroep().som2( self.selectedGroep().som2() + parseInt(p.aantal()));
|
|
||||||
break;
|
|
||||||
case '3': self.selectedGroep().som3( self.selectedGroep().som3() + parseInt(p.aantal()));
|
|
||||||
break;
|
|
||||||
case '4': self.selectedGroep().som4(self.selectedGroep().som4() + parseInt(p.aantal()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} ; // if p.aantal
|
|
||||||
}); // each
|
}); // each
|
||||||
|
|
||||||
}// if
|
}// if
|
||||||
@@ -547,7 +538,7 @@ $(function(){
|
|||||||
var dit = this;
|
var dit = this;
|
||||||
|
|
||||||
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt archiveren?";
|
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt archiveren?";
|
||||||
if(dit.aantal() > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
|
if(parseInt(dit.aantal()) > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
|
||||||
" ondersteuningsvorm worden ingedeeld in de basisondersteuning."
|
" ondersteuningsvorm worden ingedeeld in de basisondersteuning."
|
||||||
|
|
||||||
let sd ={
|
let sd ={
|
||||||
@@ -591,9 +582,12 @@ $(function(){
|
|||||||
var self = ls.GroepenModel;
|
var self = ls.GroepenModel;
|
||||||
var dit = this;
|
var dit = this;
|
||||||
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt verwijderen?";
|
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt verwijderen?";
|
||||||
if(dit.aantal > 0) "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
|
|
||||||
|
|
||||||
apprise(waarschuwing, {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
|
if(parseInt(dit.aantal(), 10) > 0)waarschuwing = waarschuwing + "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
|
||||||
|
|
||||||
|
console.log(dit, 'dit')
|
||||||
|
console.log(waarschuwing, 'waarschuwing')
|
||||||
|
apprise(waarschuwing, {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
|
||||||
if (ans){
|
if (ans){
|
||||||
$.post("index.php/monpas/groepen/deleteOS/" + dit.id, function(){
|
$.post("index.php/monpas/groepen/deleteOS/" + dit.id, function(){
|
||||||
self.editGroep().ondersteuningsvormen.remove(dit);
|
self.editGroep().ondersteuningsvormen.remove(dit);
|
||||||
|
|||||||
Reference in New Issue
Block a user