tussenopslag

This commit is contained in:
Monique
2021-11-16 11:16:52 +01:00
parent eb0bd12ac8
commit 939e7f69ac
6 changed files with 998 additions and 864 deletions
@@ -138,4 +138,13 @@ class Beheer extends MY_Controller{
"gewicht" => $this->clean_input("gewicht")); "gewicht" => $this->clean_input("gewicht"));
$this->Indicatoren_model->update_record($data, $indicatorid); $this->Indicatoren_model->update_record($data, $indicatorid);
} }
function disableijkpunt(){
if (!$this->userid ) die;
$ijkpuntid = $this->clean_input("id");
$disabled = $this->clean_input("disabled");
$this->Ijkpunten_model->update_record(['disabled' => $disabled ], $ijkpuntid);
}
} }
@@ -0,0 +1,29 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**Scorekleuren_model november 2031 */
class Scorekleuren_model extends MY_Model{
protected $tablename = 'tb_scorekleuren';
function __construct(){
parent::__construct();
$models = array('');
$this->load->model($models);
}
function getGemiddeldeKleur($scoretype, $gemiddelde){
$this->sql="SELECT kleurcode, nummer, ondergrens, bovengrens
FROM tb_scorekleuren
WHERE scoretype = {$scoretype}
AND bovengrens > {$gemiddelde}
AND ondergrens <= {$gemiddelde}
AND disabled = 'F' ";
return $this->get_query_row();
}
}
+70 -19
View File
@@ -13,10 +13,10 @@
value : selectedOrgversion, value : selectedOrgversion,
event : {change: fChangeVersion}"> event : {change: fChangeVersion}">
</select> </select>
<!-- <span style="display: inline-block; float:right"--> <span style="display: inline-block; float:right"
<!-- class="glyphicon glyphicon-print"--> class="glyphicon glyphicon-print"
<!-- data-bind="click: fPrint">--> data-bind="click: fPrint">
<!-- </span>--> </span>
</h4> </h4>
<div class="row"> <div class="row">
@@ -33,8 +33,15 @@
<tbody data-bind="foreach:listitems"> <tbody data-bind="foreach:listitems">
<tr class="clickable" data-bind="click: $parent.fToonToelichting"> <tr class="clickable" data-bind="click: $parent.fToonToelichting">
<td style="width:30px; background-color:#6f0b3d; color:#ffffff" data-bind="text:nummer"> </td> <td style="width:30px; "
<td style="background-color:#6f0b3d; color:#ffffff" data-bind="text: omschrijving"> </td> data-bind= "text:nummer,
style: {color: disabled()? '#262626' : '#ffffff' ,
backgroundColor: disabled()? '#d9d9d9' : '#6f0b3d' }" >
</td>
<td data-bind= "text: disabled() ? omschrijving + ' (uitgezet)' : omschrijving,
style: {color: disabled()? '#262626' : '#ffffff',
backgroundColor: disabled() ? '#d9d9d9' : '#6f0b3d' }">
</td>
</tr> </tr>
<tr> <tr>
<td colspan = 2> <td colspan = 2>
@@ -42,24 +49,32 @@
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th class="header2" style="width: 3%;padding-left: 2px;text-align:right"> nr </th> <th class="header2" style="width: 3%;padding-left: 2px;text-align:right"
<th class="header2" style="width: 60%;padding-left: 2px">indicator</th> data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}"> nr
<th class="header2" style="width: 30%;padding-left: 2px;text-align:left"> score</th> </th>
<th class="header2" style="width: 60%;padding-left: 2px"
data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}">indicator
</th>
<th class="header2" style="width: 30%;padding-left: 2px;text-align:left"
data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}"> score
</th>
</tr> </tr>
</thead> </thead>
<tbody data-bind="foreach: indicatorscores"> <tbody data-bind="foreach: indicatorscores">
<tr style="border-bottom: 1px solid #ebebeb"> <tr style="border-bottom: 1px solid #ebebeb">
<td style="text-align:right;vertical-align:top" data-bind="text: nummer"> <td style="text-align:right;vertical-align:top" data-bind="text: nummer,
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }">
</td> </td>
<td data-bind="text: omschrijving" style="vertical-align:top"> <td data-bind="text: omschrijving,
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" style="vertical-align:top">
</td> </td>
<td> <td>
<span data-bind="visible: scoretype==1"> <span data-bind="visible: scoretype==1">
<input class="rapport" <input class="rapport"
data-bind="textInput: score, data-bind="textInput: score,
event:{input: $root.fUpdateScoretype12}, event:{input: $root.fUpdateScoretype12},
enable: $root.editok(), enable: $root.editok() && $parent.disabled() == false,
attr:{'id' : $index}" /> attr:{'id' : $index}" />
</span> </span>
<span data-bind="visible: scoretype == 2"> <span data-bind="visible: scoretype == 2">
@@ -67,16 +82,31 @@
data-bind="textInput: score, data-bind="textInput: score,
event:{input: $root.fUpdateScoretype12}, event:{input: $root.fUpdateScoretype12},
visible: scoretype==2, visible: scoretype==2,
enable: $root.editok()" /> % enable: $root.editok() && $parent.disabled() == false" /> %
</span> </span>
<div data-bind="visible: scoretype==3 || scoretype == 4 || scoretype == 5 || scoretype == 6 || scoretype==7 "> <div data-bind="visible: scoretype==3 || scoretype == 4 || scoretype == 5 || scoretype == 6 || scoretype==7 ">
<!-- ko if: $parent.disabled() == false -->
<!-- ko foreach: $root.scoreopties --> <!-- ko foreach: $root.scoreopties -->
<!-- ko if: $parent.scoretype == type --> <!-- ko if: $parent.scoretype == type -->
<input type='radio' <input type='radio'
data-bind="checked: $parent.score(), event:{click: $root.fUpdateScoretypeVanaf3.bind($data, $parent.id)}, attr: {'name': $parent.id , 'value': value}, enable: $root.editok()" /> data-bind="checked: $parent.score(),
event:{click: $root.fUpdateScoretypeVanaf3.bind($data, $parent.id)},
attr: {'name': $parent.id , 'value': value},
enable: $root.editok() " />
<span style="vertical-align:top; display: inline-block; margin-left:5px;" data-bind="text: optie"> </span> <span style="vertical-align:top; display: inline-block; margin-left:5px;" data-bind="text: optie"> </span>
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
<!-- /ko -->
<!-- ko if: $parent.disabled() == true -->
<!-- ko foreach: $root.scoreopties -->
<!-- ko if: $parent.scoretype == type -->
<input type='radio'
data-bind="checked: $parent.score(),
enable: false " />
<span style="vertical-align:top; display: inline-block; margin-left:5px;" data-bind="text: optie"> </span>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -97,22 +127,43 @@
<tbody data-bind="foreach: indicatorscores"> <tbody data-bind="foreach: indicatorscores">
<tr style="border-bottom: 1px solid #ebebeb"> <tr style="border-bottom: 1px solid #ebebeb">
<td style="text-align:right;vertical-align:top; border-left: 1px solid #ebebeb;" <td style="text-align:right;vertical-align:top; border-left: 1px solid #ebebeb;"
data-bind="text: nummer"> data-bind="text: nummer,
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' } ">
</td> </td>
<td data-bind="text: omschrijving, attr: {'colspan': $root.optieslengte()}" style="vertical-align:top; border-right: 1px solid #ebebeb;"> <td data-bind="text: omschrijving,
attr: {'colspan': $root.optieslengte()},
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" style="vertical-align:top; border-right: 1px solid #ebebeb;">
</td> </td>
</tr> </tr>
<tr style="border-bottom: 1px solid #ebebeb"> <tr style="border-bottom: 1px solid #ebebeb">
<td style="border-left: 1px solid #ebebeb;"> <td style="border-left: 1px solid #ebebeb;">
</td> </td>
<!-- ko if: $parent.disabled() == false -->
<!-- ko foreach: $root.scoreopties --> <!-- ko foreach: $root.scoreopties -->
<td style="border-right: 1px solid #ebebeb;vertical-align:top"> <td style="border-right: 1px solid #ebebeb;vertical-align:top">
<input style="vertical-align:top; padding-left: 5px;" type='radio' <input style="vertical-align:top; padding-left: 5px;" type='radio'
data-bind="checked: $parent.score(), event:{click: $root.fUpdateScoretypeVanaf3.bind($data, $parent.id)}, attr: {'name': $parent.id , 'value': value}, enable: $root.editok()" /> data-bind="checked: $parent.score(),
<p style="vertical-align:top; padding-left: 5px;" data-bind="text: scoretekst"> </p> event:{click: $root.fUpdateScoretypeVanaf3.bind($data, $parent.id)},
attr: {'name': $parent.id , 'value': value},
enable: $root.editok()" />
<p style="vertical-align:top; padding-left: 5px;"
data-bind="text: scoretekst">
</p>
</td> </td>
<!-- /ko --> <!-- /ko -->
<!-- /ko -->
<!-- ko if: $parent.disabled() == true -->
<!-- ko foreach: $root.scoreopties -->
<td style="border-right: 1px solid #ebebeb;vertical-align:top">
<input style="vertical-align:top; padding-left: 5px;" type='radio'
data-bind="checked: $parent.score(),
enable: false" />
<p style="vertical-align:top; padding-left: 5px;"
data-bind="text: scoretekst">
</p>
</td>
<!-- /ko -->
<!-- /ko -->
</tr> </tr>
</tbody> </tbody>
+32 -15
View File
@@ -1,10 +1,9 @@
<div class="col-sm-12 mainpagina submenupage" id ="pagVersies"> <div class="col-sm-12 mainpagina submenupage" id ="pagVersies">
<div class='row'> <div class='row'>
<div class="col-sm-12 col-md-3" style="border:1px solid #f2f2f2"> <div class="col-sm-12 col-md-3" style="border:1px solid #f2f2f2">
<h3>Instrument</h3> <h3>Instrument</h3>
<select style="font-size:1em" <select style="font-size:1em; max-width: 250px;"
data-bind=" options : modules, data-bind=" options : modules,
optionsText : 'naam', optionsText : 'naam',
value : selectedModule, value : selectedModule,
@@ -51,10 +50,11 @@
<tr> <tr>
<th style="width:5%;padding-left:3px">i</th> <th style="width:5%;padding-left:3px">i</th>
<th style="width:5%"> nr </th> <th style="width:5%"> nr </th>
<th style="width:40%"> omschrijving</th> <th style="width:25%"> omschrijving</th>
<th style="width: 40%">toelichting</th> <th style="width: 35%">toelichting</th>
<th style="width: 5%"> del</th> <th style="width: 4%"> del</th>
<th style="widht: 5%">add</th> <th style="width: 6%"> disable</th>
<th style="width: 5%"> add</th>
</tr> </tr>
</thead> </thead>
<tbody data-bind="foreach: ijkpunten"> <tbody data-bind="foreach: ijkpunten">
@@ -64,22 +64,31 @@
data-bind="click: $parent.fToggleIndicatoren, css:{ 'closebutton' : toonindics(), 'openbutton': !toonindics()}"></button> data-bind="click: $parent.fToggleIndicatoren, css:{ 'closebutton' : toonindics(), 'openbutton': !toonindics()}"></button>
</td> </td>
<td style="vertical-align: top"> <td style="vertical-align: top">
<input class= 'integer' data-bind="textInput:nummer, event:{input:$parent.fUpdateIJkpunt}"/> <input class= 'integer' data-bind="textInput:nummer,
event:{input:$parent.fUpdateIJkpunt},
style: {color: disabled()? '#d9d9d9' : '#262626' }"/>
</td> </td>
<td><textarea style="width:99%" data-bind="textInput:omschrijving, event:{input: $parent.fUpdateIJkpunt}" ></textarea> <td><textarea style="width:99%" data-bind="textInput: omschrijving,
event:{input: $parent.fUpdateIJkpunt},
style: {color: disabled()? '#d9d9d9' : '#262626' }" ></textarea>
</td> </td>
<td><textarea style="width:99%" data-bind="textInput:toelichting, event:{input: $parent.fUpdateIJkpunt}" ></textarea> <td><textarea style="width:99%" data-bind="textInput:toelichting,
event:{input: $parent.fUpdateIJkpunt},
style: {color: disabled()? '#d9d9d9' : '#262626' }" ></textarea>
</td> </td>
<td style="vertical-align: top"> <td style="vertical-align: top">
<button class="delete noshow" data-bind="click: $parent.fDeleteIJkpunt, visible: indicatoren().length == 0"></button> <button class="delete noshow" data-bind="click: $parent.fDeleteIJkpunt, visible: indicatoren().length == 0"></button>
</td> </td>
<td style="vertical-align: top" data-bind="click: $parent.fDisableIJkpunt">
<button class="fa fa-ban noshow" data-bind="style: {color: disabled() ? 'red' : 'black' }"></button>
</td>
<td style="vertical-align: top" data-bind="click: $parent.fNieuweIndicator "> <td style="vertical-align: top" data-bind="click: $parent.fNieuweIndicator ">
<button class="plus noshow"></button> <button class=" noshow fa fa-plus " data-bind=" style: {color: disabled()? '#d9d9d9' : '#262626' }" ></button>
</td> </td>
</tr> </tr>
<tr data-bind="visible: toonindics() && indicatoren().length > 0"> <tr data-bind="visible: toonindics() && indicatoren().length > 0">
<td></td> <td></td>
<td colspan=4> <td colspan=5>
<table style="width: 100%"> <table style="width: 100%">
<thead> <thead>
<tr> <tr>
@@ -96,19 +105,27 @@
<td style="vertical-align: top"> <td style="vertical-align: top">
<input class= 'integer' <input class= 'integer'
style="width: 100%" style="width: 100%"
data-bind="textInput: nummer, event:{input: $root.fUpdateIndicator}" /></td> data-bind="textInput: nummer,
event:{input: $root.fUpdateIndicator},
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" /></td>
<!-- <td style="vertical-align: top">--> <!-- <td style="vertical-align: top">-->
<!-- <input style="width: 100%"--> <!-- <input style="width: 100%"-->
<!-- data-bind="textInput: inspectie, event:{input: $root.fUpdateIndicator}" /></td>--> <!-- data-bind="textInput: inspectie, event:{input: $root.fUpdateIndicator}" /></td>-->
<td style="vertical-align: top"> <td style="vertical-align: top">
<input class= 'decimal' <input class= 'decimal'
style="width: 100%" style="width: 100%"
data-bind="textInput: gewicht, event:{input: $root.fUpdateIndicator}" /></td> data-bind="textInput : gewicht,
<td><textarea data-bind="textInput: omschrijving1, event:{input: $root.fUpdateIndicator}" event :{input: $root.fUpdateIndicator},
style : {color: $parent.disabled()? '#d9d9d9' : '#262626' }" /></td>
<td><textarea data-bind="textInput: omschrijving1,
event : {input: $root.fUpdateIndicator},
style : {color: $parent.disabled()? '#d9d9d9' : '#262626' }"
style="width:99%"> style="width:99%">
</textarea> </textarea>
</td> </td>
<td><textarea data-bind="textInput: omschrijving2, event:{input: $root.fUpdateIndicator}" <td><textarea data-bind="textInput : omschrijving2,
event :{input: $root.fUpdateIndicator},
style : {color: $parent.disabled()? '#d9d9d9' : '#262626' }"
style="width: 99% "> style="width: 99% ">
</textarea> </textarea>
</td> </td>
+3
View File
@@ -36,6 +36,8 @@ ls.initMonitorModel = function(){
this.nummer = p.nummer this.nummer = p.nummer
this.omschrijving = p.omschrijving; this.omschrijving = p.omschrijving;
this.toelichting = p.toelichting; this.toelichting = p.toelichting;
this.disabled = ko.observable(false);
if(p.disabled == 'T')dit.disabled(true);
this.indicatorscores = ko.observableArray([]); this.indicatorscores = ko.observableArray([]);
$.each(p.indicatorscores, function(j,k){ $.each(p.indicatorscores, function(j,k){
dit.indicatorscores.push(new fAddIndicatorscore(k)); dit.indicatorscores.push(new fAddIndicatorscore(k));
@@ -209,6 +211,7 @@ ls.initMonitorModel = function(){
fUpdateScoretypeVanaf3: function(data){ fUpdateScoretypeVanaf3: function(data){
var self= ls.MonitorModel var self= ls.MonitorModel
var indicatorscoreID = data; var indicatorscoreID = data;
console.log(this, "this")
var submitData = { var submitData = {
indicatorscoreid : indicatorscoreID, indicatorscoreid : indicatorscoreID,
+25
View File
@@ -27,6 +27,8 @@ ls.initVersiesModel = function(){
}); });
} }
this.toonindics = ko.observable(false); this.toonindics = ko.observable(false);
this.disabled = ko.observable(false)
if(p.disabled == 'T') this.disabled(true);
} }
function fAddIndicator(k){ function fAddIndicator(k){
this.id = k.id; this.id = k.id;
@@ -203,6 +205,7 @@ ls.initVersiesModel = function(){
else { apprise("Er is een fout opgetreden bij opslaan."); }; else { apprise("Er is een fout opgetreden bij opslaan."); };
},'json'); },'json');
}, },
fToggleIndicatoren: function(){ fToggleIndicatoren: function(){
var self= ls.VersiesModel; var self= ls.VersiesModel;
self.selectedIJkpunt(null); self.selectedIJkpunt(null);
@@ -212,6 +215,7 @@ ls.initVersiesModel = function(){
fUpdateIJkpunt: function(){ fUpdateIJkpunt: function(){
var self= ls.VersiesModel; var self= ls.VersiesModel;
var dit = this; var dit = this;
if(dit.disabled()) return;
if (timeout){ if (timeout){
clearTimeout(timeout) clearTimeout(timeout)
timeout ==null; timeout ==null;
@@ -227,6 +231,25 @@ ls.initVersiesModel = function(){
$.post("index.php/monpas/beheer/updateijkpunt",submitData, function(){}) $.post("index.php/monpas/beheer/updateijkpunt",submitData, function(){})
},800); },800);
}, },
fDisableIJkpunt: function(){
var self = ls.VersiesModel;
var dit = this;
dit.disabled(! dit.disabled())
var disabled = 'F';
if(dit.disabled()) disabled = 'T';
var submitData = {
'id' : dit.id,
'disabled' : disabled
}
$.post("index.php/monpas/beheer/disableijkpunt", submitData, function(){
});
},
fDeleteIJkpunt:function(){ fDeleteIJkpunt:function(){
var self =ls.VersiesModel; var self =ls.VersiesModel;
var id = this.id; var id = this.id;
@@ -248,6 +271,8 @@ ls.initVersiesModel = function(){
fNieuweIndicator: function(){ fNieuweIndicator: function(){
var self = ls.VersiesModel; var self = ls.VersiesModel;
var num =0 var num =0
var dit = this;
if(dit.disabled()) return;
self.selectedIJkpunt(this); self.selectedIJkpunt(this);
$.each(self.selectedIJkpunt().indicatoren(), function(j,k){ $.each(self.selectedIJkpunt().indicatoren(), function(j,k){
num=k.nummer(); num=k.nummer();