From de3375bf724260d16b0c2209624a07e042b9cb7c Mon Sep 17 00:00:00 2001 From: Monique Date: Wed, 2 Feb 2022 11:12:25 +0100 Subject: [PATCH] pdf van invullijst --- application/controllers/monpas/Monitor.php | 36 +++-- application/models/Phantom_model.php | 3 +- application/views/monpas/pages/monitor.php | 114 ++++++++----- .../views/monpas/reports/printlijst.php | 150 ++++++++++-------- public/css/monpas/main.css | 40 ++++- public/js/monpas/models/monitormodel.js | 73 ++++++++- 6 files changed, 291 insertions(+), 125 deletions(-) diff --git a/application/controllers/monpas/Monitor.php b/application/controllers/monpas/Monitor.php index 86b08f9..013046c 100644 --- a/application/controllers/monpas/Monitor.php +++ b/application/controllers/monpas/Monitor.php @@ -27,6 +27,8 @@ class Monitor extends MY_Controller{ $versies = array(); $organisatie=$this->Organisaties_model->get_record_by_id($this->globorgid); $module = $this->session->userdata('module'); + $modulenaam = $this->Modules_model->get_fieldvalue(['id'=>$module],'naamkort'); + $modulenaam = str_replace(' ', '', $modulenaam); $gaverder = true; // zoek verder omdat er nog geen actieve versie is // zoek eerst de reeds ingevulde versies // zoek dan de actieve versie @@ -56,7 +58,9 @@ class Monitor extends MY_Controller{ $versies = array_merge($actieveversie, $versies); } }; - echo json_encode(array("versies"=>$versies, "soort"=>$organisatie->soort)); + echo json_encode(array("versies"=>$versies, + "soort"=>$organisatie->soort, + "module" => $modulenaam)); } function getperiodesperschoolvanuitpartituur(){ if (!$this->userid) die; @@ -220,20 +224,26 @@ class Monitor extends MY_Controller{ } function printlijst(){ - $input0 = $this->input->post('data'); - $input = json_decode($input0); -//var_dump('input', $input); + $inputstring = $this->input->post('data'); + $input = json_decode($inputstring); + $module = $input->module; + $info = $input->info; + $tabel = $input->tabel; + $notitie = $input->notitie; + $zichtbaar = $input->zichtbaar; + $data = []; + $data['module'] = $module; + $data['info'] = $info; + $data['tabel'] = $tabel; + $data['notitie'] = $notitie; + $data['zichtbaar'] = $zichtbaar; + $data['today'] = date("d-m-Y"); + $data['organisatie'] = ''; $organisatie = $this->Organisaties_model->get_orgnaam($this->globorgid); - $instrument = $this->Modules_model->get_fieldvalue(array("sysnr" =>$this->module), "naam") ; + if($organisatie) $data['organisatie'] = $organisatie; + $filenaam = $input->filenaam; + $html=$this->load->view("monpas/reports/printlijst.php", $data, true); - $data=array( "instrument" => $instrument, - "organisatie" => $organisatie, - "versie" => $input->orgversie, - "today" => date('d-m-Y'), - "listitems" => json_decode($input->tabelinfo), - "notitie" => $input->notitie); - $html=$this->load->view("monpas/reports/printlijst", $data, true); - $filenaam="MonPasInvullijst"; $this->Phantom_model->create_pdf($html,$filenaam, FALSE,FALSE,FALSE); } } diff --git a/application/models/Phantom_model.php b/application/models/Phantom_model.php index f4233aa..42b901c 100644 --- a/application/models/Phantom_model.php +++ b/application/models/Phantom_model.php @@ -25,7 +25,8 @@ class Phantom_model extends CI_Model{ curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, - CURLOPT_URL => 'https://print.pensare-services.nl/print', + CURLOPT_URL => $_ENV['printserver'], +// CURLOPT_URL => 'https://print.pensare-services.nl/print', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data )); diff --git a/application/views/monpas/pages/monitor.php b/application/views/monpas/pages/monitor.php index 443adc8..5bfb7a2 100644 --- a/application/views/monpas/pages/monitor.php +++ b/application/views/monpas/pages/monitor.php @@ -13,10 +13,10 @@ value : selectedOrgversion, event : {change: fChangeVersion}"> - - - - + +
@@ -28,11 +28,11 @@
-
+
- - + + - + + +
- - - - -
nr indicator score
- - - +
+ + + +
+
+ + +
+
- % - + % + +
+
@@ -117,8 +127,8 @@ - - + + @@ -132,8 +142,10 @@ +
nr indicator nr indicator
+ style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" + style="vertical-align:top; border-right: 1px solid #ebebeb;">
@@ -144,7 +156,7 @@

@@ -157,7 +169,7 @@

+ enable: false" />

@@ -175,18 +187,44 @@
-
+

Notitie

+ data-bind="textInput: notitie, + event:{'input' : fUpdateNotitie} "> +
-
+ +
+
+

Notitie

+ +
+
+

- - - Zichtbaar maken bij de tabbladen ijkpunten, resultaatmatrix, ontwikkelagenda & lijsten.* + + + + Zichtbaar maken bij de tabbladen ijkpunten, resultaatmatrix, ontwikkelagenda & lijsten.* +

+ +
+

*Vul de gehele lijst in voordat u deze zichtbaar maakt. Niet ingevulde indicatoren worden ook meegenomen bij de berekening van het gemiddelde.

+
+
+
+
+
+

+ + □ + ✓ + Zichtbaar maken bij de tabbladen ijkpunten, resultaatmatrix, ontwikkelagenda & lijsten.*

diff --git a/application/views/monpas/reports/printlijst.php b/application/views/monpas/reports/printlijst.php index 1e4755e..a0ca698 100644 --- a/application/views/monpas/reports/printlijst.php +++ b/application/views/monpas/reports/printlijst.php @@ -1,17 +1,89 @@ - + input[type='radio']:after { + background-color: #ffffff; + content: ''; + display: inline-block; + visibility: visible; + border: 2px solid gainsboro; + width: 15px; + height: 15px; + border-radius: 15px; + top: -2px; + left: -1px; + position: relative; + } -
-

: Invullijst

+ input[type='radio']:checked:after { + width: 15px; + height: 15px; + border-radius: 15px; + top: -2px; + left: -1px; + position: relative; + background-color: #6f0b3d !important; + content: ''; + display: inline-block; + visibility: visible; + border: 2px solid gainsboro; + } + + .breakpagepdf{ + page-break-after: always; + } + .rapport{ + text-align: right; + padding-right: 3px; + max-width:40px; + } + + .alleenVoorPdf{ + display: inline; + } + .nietVoorPdf{ + display: none; + } + + + + + + + + +
+ +

: Invullijst


@@ -20,7 +92,7 @@ - + @@ -28,63 +100,13 @@
Lijstversie:
Per:

+
+ +
+
- - - - - - - - - - -
nummer?>omschrijving?>
- - - - - - - - - - indicatorscores){ - foreach($item->indicatorscores as $score){ ?> - - - - - - - - -
nr indicator score
nummer?>omschrijving?> - scoretype == 1){echo $score->score;}; - if ($score->scoretype == 2){echo $score->score." %";}; - if ($score->scoretype == 3 ||$score->scoretype == 4 ||$score->scoretype == 5 || - $score->scoretype == 6|| $score->scoretype == 7){ - if ($score->scoretype== 6) { - $textJa = ' onvol.'; - $textNee = 'vol.';} - else { - $textJa ="ja"; - $textNee = 'nee'; - }; - ?> - - score ==1) echo "checked"; ?> /> - score ==2) echo "checked"; ?> /> - score ==3) echo "checked"; ?> /> thirdoptiontext?> - scoretype; ?> - -
-
-Notitie

"; - echo "".$notitie.""; -} ?> +
+ + + diff --git a/public/css/monpas/main.css b/public/css/monpas/main.css index 8b96669..a8b3cd2 100644 --- a/public/css/monpas/main.css +++ b/public/css/monpas/main.css @@ -42,6 +42,37 @@ font-style: normal; } +input[type='radio']:after { + width: 15px; + height: 15px; + border-radius: 15px; + top: -2px; + left: -1px; + position: relative; + background-color: #ffffff; + content: ''; + display: inline-block; + visibility: visible; + border: 2px solid gainsboro; +} + +input[type='radio']:checked:after { + width: 15px; + height: 15px; + border-radius: 15px; + top: -2px; + left: -1px; + position: relative; + background-color: #6f0b3d !important; + content: ''; + display: inline-block; + visibility: visible; + border: 2px solid gainsboro; +} + +.breakpagepdf{ + page-break-after: always; +} .appriseOuter{ border: 1px solid #003469 @@ -854,6 +885,13 @@ tr.selected, td.selected{ padding-right: 3px; max-width:40px; } + +.alleenVoorPdf{ + display: none; +} +.nietVoorPdf{ + display: inline; +} .integer{ text-align: right; padding-right: 3px; @@ -978,7 +1016,7 @@ z-index: 50; } .noinput{ border:none; - background-color: #ffffff important!; + background-color: #ffffff !important; } .kopje{ background-color: #d8a8bf; diff --git a/public/js/monpas/models/monitormodel.js b/public/js/monpas/models/monitormodel.js index 2e81921..fcc69ba 100644 --- a/public/js/monpas/models/monitormodel.js +++ b/public/js/monpas/models/monitormodel.js @@ -118,6 +118,7 @@ $(function(){ bezig : ko.observable(false), meetellen : ko.observable(false), optieslengte : ko.observable(0), + module : ko.observable(''), initBindings :function(){ var self = ls.MonitorModel; @@ -145,6 +146,7 @@ $(function(){ }; // if self.soort(data.soort); + self.module(data.module); hideAjaxLoader(); },'json'); }, @@ -211,7 +213,6 @@ $(function(){ fUpdateScoretypeVanaf3: function(data){ var self= ls.MonitorModel var indicatorscoreID = data; - console.log(this, "this") var submitData = { indicatorscoreid : indicatorscoreID, @@ -260,17 +261,73 @@ $(function(){ fPrint:function(){ var self =ls.MonitorModel; - if (self.bezig()) return; + // if (self.bezig()) return; self.bezig(true); - var items = ko.toJSON(self.listitems()); - var data ={ 'orgversie' : self.selectedOrgversion().info(), - 'tabelinfo' : items, - 'notitie' : self.notitie()} - data=JSON.stringify(data); + var fvID = self.fvid(); + $.post("index.php/monpas/monitor/getlistitems/" + self.selectedOrgversion().id, function(data){ + self.listitems.removeAll(); + self.scoreopties.removeAll(); + if (data.ijkpunten){ + $.each(data.ijkpunten,function(i,p){ + self.listitems.push(new fAddListitem(p)); + });// each + }; //if + + if(data.scoreopties){ + $.each(data.scoreopties,function(x,o){ + self.scoreopties.push(new fAddScoreoptie(o)); + });// each + self.optieslengte(self.scoreopties().length); + } + + self.notitie(data.notitie); + if(data.meetellen && data.meetellen == 1) { + self.meetellen(true); + } + else{ + self.meetellen(false); + } + self.fvid(fvID); + + self.fMaakPDF(); + + + },'json'); + + + + self.bezig(false); + + }, + + fMaakPDF(){ + var self = ls.MonitorModel; + var module = self.module(); + var info = self.selectedOrgversion().info(); + var tabel = document.getElementById("invulTabel").outerHTML; + var notitie = false; + var ingevuldenotitie = self.notitie(); + if (ingevuldenotitie && ingevuldenotitie.length > 0) + notitie = document.getElementById("invulNotitie").outerHTML; + var zichtbaar = document.getElementById("invulZichtbaar").outerHTML; + + + console.log( notitie, "notitie") + + var sd = { + 'module' : module, + 'info' : info, + 'tabel' : tabel, + 'notitie' : notitie, + 'zichtbaar' : zichtbaar, + 'filenaam' : 'formulier' + self.module()+ 'nr' + self.selectedOrgversion().periodenummer + } + + data=JSON.stringify(sd); + var $form = $("
").append($('').val(data) ); $form.appendTo("body").submit(); - self.bezig(false); } } ; // definition van model