diff options
Diffstat (limited to 'public/app/views')
| -rw-r--r-- | public/app/views/js/pdf-designer/application.php | 14 | ||||
| -rw-r--r-- | public/app/views/js/pdf-designer/penalty.php | 17 | ||||
| -rw-r--r-- | public/app/views/templates/admin_petitions.php | 2 | ||||
| -rw-r--r-- | public/app/views/templates/create_pdf.php | 3 |
4 files changed, 27 insertions, 9 deletions
diff --git a/public/app/views/js/pdf-designer/application.php b/public/app/views/js/pdf-designer/application.php index 8017fa9..53f5193 100644 --- a/public/app/views/js/pdf-designer/application.php +++ b/public/app/views/js/pdf-designer/application.php @@ -1,10 +1,16 @@ <?php /** application PDF designer * ----------------------------------------------------------------------------- + * + * main function: designer + * @param data (json) : fields'values of petition + * @param defines (json) : data properties of authoriry + * @param protocol (string) : protocol numeber (if exists; else empty string) + * */ ?> <script> -function designer(data, defines) { +function designer(data, defines, protocol = '') { // handle date const d = new Date( data.date ); const options = { @@ -71,6 +77,9 @@ function designer(data, defines) { '\n\nΣχολείο Οργανικής: ',{ style: 'bigger', text: data.belonging_school }, + '\n\nΘέση Υπηρέτησης: ',{ + style: 'bigger', text: '1ο ΓΥΜΝΑΣΙΟ ΡΑΦΗΝΑΣ' + }, // '\n\nΣχολείο Υπηρέτησης:\n\t',{ // style: 'bigger', text: data.constants.organization // }, @@ -113,7 +122,8 @@ function designer(data, defines) { ], footer: { text: [ - 'Αριθμός πρωτοκόλου: A124-2501-4568-7 / 2023-12-15', + 'Αριθμός πρωτοκόλου: ', + ((protocol == '') ? '—' : protocol), '\ndocument signature: ' + defines.ticket ], diff --git a/public/app/views/js/pdf-designer/penalty.php b/public/app/views/js/pdf-designer/penalty.php index f2f3029..bdd5dc2 100644 --- a/public/app/views/js/pdf-designer/penalty.php +++ b/public/app/views/js/pdf-designer/penalty.php @@ -1,10 +1,16 @@ <?php /** penalty PDF designer * ----------------------------------------------------------------------------- + * + * main function: designer + * @param data (json) : fields'values of petition + * @param defines (json) : data properties of authoriry + * @param protocol (string) : protocol numeber (if exists; else empty string) + * */ ?> <script> -function designer(data, defines) { +function designer(data, defines, protocol = '') { // handle date const d = new Date( data.date ); const options = { @@ -22,7 +28,7 @@ function designer(data, defines) { // get labels from id-specified objects - let petition = 'Αίτηση'; + let petition = 'Καταγραφή Ενέργειας Υποστήριξης Εύρυθμης Λειτουργείας'; return { info: { @@ -35,8 +41,8 @@ function designer(data, defines) { { text: [ 'Καταγραφή Ενέργειας Υποστήριξης Εύρυθμης Λειτουργείας\n', - 'ΠΡΑΚΤΙΚΟ ', - 'αριθμός πρακτικού', + 'ΠΡΑΚΤΙΚΟ', + ((protocol == '') ? '' : (' ' + protocol)), '\n\n' ], style: 'header' @@ -153,7 +159,8 @@ function designer(data, defines) { ], footer: { text: [ - 'Αριθμός πρωτοκόλου: A124-2501-4568-7 / 2023-12-15', + 'Αριθμός πρωτοκόλου: ', + ((protocol == '') ? '—' : protocol), '\ndocument signature: ' + defines.ticket ], diff --git a/public/app/views/templates/admin_petitions.php b/public/app/views/templates/admin_petitions.php index 52f2a89..c4374bb 100644 --- a/public/app/views/templates/admin_petitions.php +++ b/public/app/views/templates/admin_petitions.php @@ -88,7 +88,7 @@ <div class="modal-body"> <div class="row form-group"> - <label class="control-label col-sm-12" for="protocol">Αριθμός Πρψτοκόλλου</label> + <label class="control-label col-sm-12" for="protocol">Αριθμός Πρωτοκόλλου</label> <div class="col-sm-12"> <input class="form-control form-control-sm" type="text" name="protocol" value="" required=""> </div> diff --git a/public/app/views/templates/create_pdf.php b/public/app/views/templates/create_pdf.php index 2549cda..52be9ab 100644 --- a/public/app/views/templates/create_pdf.php +++ b/public/app/views/templates/create_pdf.php @@ -50,6 +50,7 @@ </body> <script> var data = <?=json_encode($petition, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE)?>; +console.log(data); pdfMake.fonts = { FiraSans: { @@ -64,7 +65,7 @@ pdfMake.fonts = { } pdfMake.createPdf( - designer( data.form_structure, data.form_structure.ref ) + designer( data.form_structure, data.form_structure.ref, data.protocol ) ).download('<?=$petition['signature']?>.pdf'); </script> </html>
\ No newline at end of file |
