Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 11266 | Rev 15447 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1336 efrain 1
<?php
2
 
3
namespace LeadersLinked\Library;
4
 
5
use Fpdf\Fpdf;
6
 
7
class PerformanceEvaluationPdf extends FPDF {
8
 
15079 efrain 9
    public $header;
10
    public $footer;
11
 
1336 efrain 12
    /**
13
     * Header PDF
14
     */
15
    function Header() {
15079 efrain 16
        if ($this->header != '') {
17
            $this->Image($this->header, 10, 1, 190);
18
            $this->SetY(55);
19
        }
1336 efrain 20
    }
21
 
22
    /**
23
     * Footer PDF
24
     */
25
    function Footer() {
15079 efrain 26
        if ($this->footer != '') {
27
            $this->SetY(-40);
28
            $this->Image($this->footer, 10,$this->getY() , 190);
29
        }
1336 efrain 30
    }
31
 
32
    /**
33
     * Section Scale
34
     */
35
    function sectionScale() {
36
        $this->SetFillColor(225, 255, 255);
37
        $this->SetTextColor(0);
38
        $this->SetFont('Arial', 'B', 9);
39
 
40
 
41
        $this->Cell(35, 8, utf8_decode(' Escala/Niveles:'), 1, 0, 'L', false);
42
 
43
        $this->SetFillColor(225, 255, 255);
44
        $this->SetTextColor(0);
45
        $this->SetFont('Arial', '', 9);
46
 
47
        $this->Cell(155, 8, utf8_decode(' 1: Mínimo  2: Medio  3: Medio-Alto  4: Alto  N/A: No aplica
48
'), 1, 'L', false);
49
        $this->Ln(15);
50
    }
51
 
52
    /**
53
     * Create Table
54
     * @param string $title
55
     * @param array $content
56
     */
57
    function borderTable($title, $content) {
58
 
59
        // Header Table
60
        $this->SetFillColor(204, 204, 204);
61
        $this->SetDrawColor(0, 0, 0);
62
        $this->SetLineWidth(0);
63
        $this->SetFont('Arial', 'B', 9);
64
 
65
        $this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);
66
        $this->Ln();
67
 
68
        // Body Table
69
        $this->SetFillColor(225, 255, 255);
70
        $this->SetTextColor(0);
71
 
72
        foreach ($content as $rs) {
73
            if (isset($rs['title'])) {
74
 
75
                $this->SetFont('Arial', 'B', 9);
76
                $this->Cell(50, 10, utf8_decode($rs['title']), 1, 0, 'L', false);
77
                $this->Cell(140, 10, utf8_decode($rs['content']), 1, 'L', false);
78
                $this->Ln();
79
            } else {
80
 
81
                $this->SetFont('Arial', '', 9);
82
                $this->MultiCell(190, 6, utf8_decode($rs['content']), 1, 'L', false);
83
            }
84
        }
85
        $this->Ln(5);
86
    }
87
 
88
    /**
89
     * title option table
90
     * @param string $title
91
     */
92
    function titleOptionTable($title) {
93
 
94
        if ($title != '') {
95
            // Body Table
96
            $this->SetFillColor(204, 204, 204);
97
            $this->SetDrawColor(0, 0, 0);
98
            $this->SetLineWidth(0);
99
            $this->SetFont('Arial', 'B', 9);
100
 
101
            $this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);
102
            $this->Ln();
103
        }
104
    }
105
 
106
    /**
107
     * Create Section Option Table
108
     * @param string $content
109
     */
110
    function optionTable($title) {
111
 
112
        // Body Table
113
        $this->SetFillColor(225, 255, 255);
114
        $this->SetTextColor(0);
115
        $this->SetFont('Arial', 'B', 9);
116
        $this->Cell(50, 10, utf8_decode($title), 1, 0, 'L', false);
117
        $this->Cell(140, 10, '', 1, 'L', false);
118
        $this->Ln();
119
    }
120
 
121
    /**
122
     * Create Table
123
     * @param string $title
124
     * @param array $content
125
     */
126
    function singleTable($title, $content) {
127
 
128
        // Header Table
129
        $this->SetFillColor(255, 255, 255);
130
        $this->SetDrawColor(0, 0, 0);
131
        $this->SetLineWidth(0);
132
        $this->SetFont('Arial', 'B', 9);
133
 
134
        $this->Cell(190, 6, utf8_decode($title), 0, 0, 'L', true);
135
        $this->Ln();
136
 
137
        // Body Table
138
        $this->SetFillColor(225, 255, 255);
139
        $this->SetTextColor(0);
140
        $this->SetFont('Arial', '', 9);
141
 
142
        foreach ($content as $rs) {
143
            if (isset($rs['title'])) {
144
                $this->Cell(40, 6, utf8_decode($rs['title']), 0, 0, 'L', false);
145
                $this->Cell(150, 6, utf8_decode($rs['content']), 0, 'L', false);
146
                $this->Ln();
147
            } else {
148
                if ($rs['content'] != "") {
149
                    $this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);
150
                }
151
            }
152
        }
153
        $this->Ln(5);
154
    }
155
 
156
    /**
157
     * Create Competency Table
158
     * @param int $index
159
     * @param array $competency
160
     */
161
    function competencyTable($index, $competency) {
162
 
163
 
164
        // Header Table
165
        $this->SetFillColor(255, 255, 255);
166
        $this->SetDrawColor(0, 0, 0);
167
        $this->SetLineWidth(0);
168
        $this->SetFont('Arial', 'B', 9);
169
 
170
        $this->MultiCell(190, 5, $index . '- ' . utf8_decode($competency['type']) . ': ' . utf8_decode($competency['name']), 0, 'L', false);
171
 
172
        // Body Table
173
        $this->SetFillColor(225, 255, 255);
174
        $this->SetTextColor(0);
175
        $this->SetFont('Arial', '', 9);
176
 
177
        $this->MultiCell(190, 6, utf8_decode(strip_tags($competency['description'])), 0, 'L', false);
178
 
179
        $this->Ln(3);
180
 
181
        $this->SetFillColor(204, 204, 204);
182
        $this->SetDrawColor(0, 0, 0);
183
        $this->SetLineWidth(0);
184
        $this->SetFont('Arial', 'B', 9);
185
 
186
        $behaviors = $competency['behaviors'];
187
 
188
        if (count($behaviors) > 0) {
189
 
190
            $this->Cell(150, 6, utf8_decode('Conductas observables :'), 1, 0, 'L', true);
191
            $this->Cell(16, 6, 'Nivel', 1, 0, 'C', true);
192
            $this->Cell(24, 6, utf8_decode('Evaluación'), 1, 0, 'C', true);
193
            $this->Ln();
194
 
195
            // Body Table
196
            $this->SetFillColor(225, 255, 255);
197
            $this->SetTextColor(0);
198
 
199
 
200
            for ($i = 0; $i < count($behaviors); $i++) {
201
 
202
                $this->SetFont('Arial', '', 8.5);
203
 
204
                $this->Cell(150, 6, utf8_decode($behaviors[$i]['description']), 1, 0, 'L', false);
205
                $this->Cell(16, 6, $behaviors[$i]['level'] == '0' ? 'N/A' : $behaviors[$i]['level'], 1, 0, 'C', false);
206
                $this->Cell(24, 6, '', 1, 0, 'C', false);
207
 
208
                $this->Ln();
209
 
210
                $this->SetFont('Arial', 'B', 9);
211
 
212
                $this->Cell(190, 6, utf8_decode('Comentarios:'), 1, 0, 'L', false);
213
 
214
 
215
                $this->Ln();
216
            }
217
        }
218
 
219
 
220
        $this->Ln();
221
    }
222
 
223
}