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