summaryrefslogtreecommitdiff
path: root/public/app/views/js/pdf-designer/application.php
blob: 1d77c672aff2acae364fbf05984677d8ccefe1ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<script>
function designer(data, defines) {
    // handle date
    const d = new Date( data.date );
    const options = {
        weekday: 'long',
        year: 'numeric',
        month: 'long',
        day: 'numeric'
    };
    var elDate = d.toLocaleDateString('el-GR', options);
    var year = d.getFullYear().toString();

    // get labels from id-specified objects
    let petition = 'Αίτηση';

    return {
        info: {
            title: data.subject,
            author: defines.organization,
            subject: data.subject,
            keywords: [petition, year].join(', '),
        },
        content: [
            {
                text: 'ΑΙΤΗΣΗ\n\n',
                style: 'header'
            },
            {
                alignment: 'justify',
                columns: [
                    {
                        width: 210,
                        text: ''
                    },
                    {
                        width: 'auto',
                        lineHeight: 1.35,
                        text:[
                            'ΠΡΟΣ\n',
                            {
                                style: 'bigger',
                                text: defines.organization
                            }
                        ]
                    }
                ]
            },
            {
                columns: [
                    {
                        width: 210,
                        lineHeight: 1.25,
                        alignment: 'left',
                        text: [
                            'Επώνυμο: ', { style: 'bigger', text: data.last_name },
                            '\n\nΌνομα: ', { style: 'bigger', text: data.first_name },
                            '\n\nΌνομα πατρός: ',{ style: 'bigger', text: data.father_name },
                            '\n\nAM: ',{ style: 'bigger', text: data.registration_number },
                            '\n\nΚλάδος/Ειδικότητα: ',{ style: 'bigger', text: data.sector },
                            '\n\nΣχολείο Οργανικής: ',{
                                style: 'bigger', text: data.belonging_school
                            },
                            // '\n\nΣχολείο Υπηρέτησης:\n\t',{
                            //     style: 'bigger', text: data.constants.organization
                            // },
                            '\n\nΤηλέφωνο Επικοινωνίας: ',{ style: 'bigger', text: data.phone },
                            '\n\nEmail: ', { style: 'bigger', text: data.email },
                            '\n\nΘέση Υπηρέτησης: ',{ style: 'bigger', text: data.position }
                            
                        ]
                    },
                    {
                        width: 'auto',
                        lineHeight: 1.33,
                        text: [
                            '\n\n',
                            {
                                style: 'bigger',
                                text: data.request+'\n',
                                alignment: 'left'
                            },
                            '\n\n',
                            {
                                text: elDate,
                                style: 'bigger',
                                alignment: 'center'
                            },
                            {
                                text: '\n\n'+ defines.applier +'\n',
                                style: 'bigger',
                                alignment: 'center'
                            },
                            {
                                style: 'bigger',
                                text: data.last_name +' '+data.first_name,
                                alignment: 'center'
                            }
                        ]
                    }
                ]
            }
        ],
        footer: {
          text: [
            'Αριθμός πρωτοκόλου: A124-2501-4568-7 / 2023-12-15',
            '\ndocument signature: ' + defines.ticket 

          ],
          style: 'signature'
        },
        styles: {
            header: {
                fontSize: 20,
                bold: true,
                alignment: 'center',
                color: '#000'
            },
            bigger: {
                fontSize: 10,
                italics: false,
                bold: true,
                color: '#000'
                // decoration: 'underline'
            },
            signature: {
                fontSize: 8,
                italics: false,
                alignment: 'center',
                font: 'FiraMono'

            }
        },
        defaultStyle: {
            columnGap: 35,
            fontSize: 9,
            font: 'FiraSans'
        }
    };   
}

</script>