diff --git a/application/controllers/monfin2/Bestemmingen.php b/application/controllers/monfin2/Bestemmingen.php index 3b18084..566f845 100644 --- a/application/controllers/monfin2/Bestemmingen.php +++ b/application/controllers/monfin2/Bestemmingen.php @@ -87,9 +87,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar){ +// if ($targetjaar >= $bestemmingjaar){ $this->Finbestemmingen_model->update_record(['bedrag'=>$this->clean_input('bedrag')], $bestemmingID); - } + +// } $record = $this->Finbestemmingen_model->get_record_by_id($bestemmingID); json_encode(['record'=>$record]); } @@ -99,9 +100,9 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar) { +// if ($targetjaar >= $bestemmingjaar) { $this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID); - } +// } } diff --git a/application/controllers/monpas/Rapijkpunten.php b/application/controllers/monpas/Rapijkpunten.php index de86bb8..44dff18 100644 --- a/application/controllers/monpas/Rapijkpunten.php +++ b/application/controllers/monpas/Rapijkpunten.php @@ -157,6 +157,8 @@ class Rapijkpunten extends MY_Controller{ if (!$this->userid) die; $targetid = $this->uri->segment(4);// orgid $module = $this->session->userdata('module'); + $label = $this->Labels_model->get_label_by_id($module, '1'); + // get de lijst van scholen onder de target $idlijst = $this->Organisaties_model->getscholenondertarget2($targetid); if($idlijst) { @@ -169,7 +171,8 @@ class Rapijkpunten extends MY_Controller{ foreach ($versies as $versie) { $versie->scoreomschrijving = $this->Antwoordtypes_model->gettype($versie->scoretype); } - echo json_encode($versies); + echo json_encode(['versies' =>$versies, + 'label' =>$label]); } else{ echo json_encode(false); diff --git a/application/controllers/monpas/Rapontwikkel.php b/application/controllers/monpas/Rapontwikkel.php index df52cc2..d995b45 100644 --- a/application/controllers/monpas/Rapontwikkel.php +++ b/application/controllers/monpas/Rapontwikkel.php @@ -83,7 +83,7 @@ class Rapontwikkel extends MY_Controller { $scores = NULL; $gewenst = NULL; $orgversie = $this->Orgversies_model->get_record_by_id($orgversieid); - if($orgversie->scoretype == 7){ + if($orgversie && $orgversie->scoretype == 7){ $grens1 = 33; $grens2 = 66; $grens3 = 100; diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 1fd7213..9f42a52 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -84,7 +84,7 @@ class MY_Controller extends CI_Controller{ // public $version = '1.19.06';// monfin met budgetten // public $version = '1.20.03';// monfin met budgetten // public $version = '1.20.04';// monfin met budgetten update - public $version = '1.20.05';// monfin met budgetten update + public $version = '1.20.07';// monfin met budgetten update hogere kalenderjaren public $partituurid; public $globProfielVersieID = 1; public $userid; //id of the user that is logged in diff --git a/application/models/monpas/Labels_model.php b/application/models/monpas/Labels_model.php index 84163c0..e7032de 100644 --- a/application/models/monpas/Labels_model.php +++ b/application/models/monpas/Labels_model.php @@ -2,60 +2,68 @@ /** Labels_model januari 2015 */ -class Labels_model extends MY_Model{ +class Labels_model extends MY_Model +{ - protected $tablename = 'tb_labels'; - - function __construct(){ - parent::__construct(); - $models = array(); - $this->load->model($models); - } + protected $tablename = 'tb_labels'; - function getLabel($sysnr){ - $this->sql="SELECT waarde + function __construct() + { + parent::__construct(); + $models = array(); + $this->load->model($models); + } + + function getLabel($sysnr) + { + $this->sql = "SELECT waarde FROM tb_translate WHERE modulenr = {$sysnr} "; return $this->get_query_row("waarde"); } - function getLabels($module){ - $this->sql="SELECT * + function getLabels($module) + { + $this->sql = "SELECT * FROM tb_translate WHERE modulenr = {$module} "; - return $this->get_query_result(); + return $this->get_query_result(); } - function getalllabels($module = false){ - if (! $module) $module = $this->session->userdata('module'); - $this->sql="SELECT L.omschrijving, T.waarde + function getalllabels($module = false) + { + if (!$module) $module = $this->session->userdata('module'); + $this->sql = "SELECT L.omschrijving, T.waarde FROM tb_translate T JOIN tb_labels L on L.id = T.labelid - WHERE modulenr = {$module}"; - $labels = $this->get_query_result(); - $lbl = array(); - if ($labels){ - foreach($labels as $label){ - $lbl[$label->omschrijving]=$label->waarde; - };// foreach - } - return $lbl; - } + WHERE modulenr = {$module}"; + $labels = $this->get_query_result(); + $lbl = array(); + if ($labels) { + foreach ($labels as $label) { + $lbl[$label->omschrijving] = $label->waarde; + };// foreach + } + return $lbl; + } - function gettabellabel($modulenr){ - $this->sql="SELECT waarde + function gettabellabel($modulenr) + { + $this->sql = "SELECT waarde FROM tb_translate T WHERE modulenr = {$modulenr} AND labelid = 2 "; return $this->get_query_row("waarde"); } - function getresultaatlabel($modulenr){ - $this->sql="SELECT waarde + + function getresultaatlabel($modulenr) + { + $this->sql = "SELECT waarde FROM tb_translate T WHERE modulenr = {$modulenr} AND labelid = 1 "; @@ -63,4 +71,13 @@ class Labels_model extends MY_Model{ } + function get_label_by_id($module, $id) + { + $this->sql = "SELECT waarde + FROM tb_translate T + WHERE modulenr = {$module} + AND labelid = {$id} "; + return $this->get_query_row("waarde"); + } } + diff --git a/application/views/monpas/pages/matrix.php b/application/views/monpas/pages/matrix.php index c2fb544..54062f5 100644 --- a/application/views/monpas/pages/matrix.php +++ b/application/views/monpas/pages/matrix.php @@ -180,7 +180,7 @@