Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3489 nelberth 1
<?php
2
 
3
namespace LeadersLinked\Library;
4
 
5
use Fpdf\Fpdf;
6
 
7
class PlanningObjectivesAndGoalsObjectivesPdfOne extends FPDF {
8
 
3716 nelberth 9
    protected $titleObjective='';
3730 nelberth 10
    protected $descriptionObjective='';
3719 nelberth 11
    protected $swit=true;
3786 nelberth 12
    protected $descriptionGoals='';
13
    protected $titleGoals="";
3787 nelberth 14
    protected $titleTask="";
3851 nelberth 15
    public $continueTask=1;
3954 nelberth 16
 
3856 nelberth 17
 
3854 nelberth 18
 
19
    function setP($p){
20
        $this->continueTask=$p;
21
    }
22
    function getP(){
23
        return $this->continueTask;
24
    }
3489 nelberth 25
    /**
26
     * Header PDF
27
     */
28
    function Header() {
29
 
30
        if ($this->header != '') {
31
            $this->Image($this->header, 10, 8, 190);
32
            $this->SetY(55);
33
        }
3929 nelberth 34
 
3803 nelberth 35
        $this->SetFillColor(204, 204, 204);
36
        $this->SetDrawColor(0, 0, 0);
37
        $this->SetLineWidth(0);
38
        $this->SetFont('Arial', 'B', 9);
3807 nelberth 39
 
3803 nelberth 40
        $this->Ln();
3720 nelberth 41
        if($this->swit==false){
3804 nelberth 42
            $this->SetFont('Arial', 'B', 9);
3873 nelberth 43
            $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
44
            $this->Cell(188, 6, utf8_decode('Meta: '. $this->titleGoals), 1, 1, 'C', true);
3786 nelberth 45
            $this->Ln();
3856 nelberth 46
            if($this->getP()==5){
3789 nelberth 47
                $this->SetFont('Arial', '', 9);
3870 nelberth 48
                $this->Cell(188, 6, utf8_decode('Tareas: '. $this->titleTask.' ( Continuacion )'), 1, 1, 'C', true);
3827 nelberth 49
 
3789 nelberth 50
            }
3719 nelberth 51
        }
3489 nelberth 52
    }
53
 
54
    /**
55
     * Footer PDF
56
     */
57
    function Footer() {
58
        if ($this->footer != '') {
3610 nelberth 59
            $this->SetY(-40);
3489 nelberth 60
            $this->Image($this->footer, 10, $this->getY(), 190);
61
        }
62
    }
63
 
4044 nelberth 64
    function borderTable($title, $items) {
3958 nelberth 65
        $this->AddPage();
3489 nelberth 66
        // Header Table
67
        $this->SetFillColor(204, 204, 204);
68
        $this->SetDrawColor(0, 0, 0);
69
        $this->SetLineWidth(0);
3740 nelberth 70
        $this->SetFont('Arial', 'B', 12);
71
        $this->Cell(188, 12, utf8_decode($title), 0, 1, 'C', false);
3742 nelberth 72
        $this->Ln(5);
3489 nelberth 73
        // Body Table
74
        $this->SetFillColor(225, 255, 255);
75
        $this->SetTextColor(0);
3889 nelberth 76
 
4005 nelberth 77
        $addPageObjective=false;
4044 nelberth 78
        foreach ($items as $objective) {
3958 nelberth 79
 
4015 nelberth 80
            $this->titleObjective=$objective['title'];
81
            $this->descriptionObjective=$objective['description'];
82
 
83
            if ($objective['status']=='a') {
84
                if($addPageObjective){
85
                    $this->AddPage();
86
                }
87
                $addPageObjective=true;
88
                $this->SetFont('Arial', 'B', 9);
89
                 $costObjective=0;
90
                 $timeObjective=0;
91
                 $contObjetive=0;
92
                 $indicatorObjective=0;
93
                foreach($objective['goals'] as $record){
94
                    $indicatorGoals=0;
95
                    if($record->status=='a'){
96
                        foreach($record->task as $record2){
97
                            if($record2->status=='a'){
98
                                $costObjective=$costObjective+$record2->cost;
99
                                $timeObjective=$timeObjective+$record2->time;
100
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
101
                            }
102
                        }
103
                    }
104
                    if(count($record->task)>0){
105
                        $indicatorObjective=$indicatorObjective+($indicatorGoals/count($record->task));
106
                        $contObjetive++;
107
                    }
108
                }
109
                if($contObjetive!=0){
110
                    $indicatorObjective=round($indicatorObjective/$contObjetive,2);
111
                }
112
 
113
                if(count($objective['goals'])<=0){
114
                        $this->SetFillColor(204, 204, 204);
115
                        $this->SetDrawColor(0, 0, 0);
116
                        $this->SetLineWidth(0);
117
                        $this->SetFont('Arial', 'B', 9);
118
                        $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
119
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
120
                        $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
121
                        $this->Cell(25, 6, utf8_decode($objective['date']), 1, 0, 'C', false);
122
                        $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
123
                        $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
124
                        $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
125
                        $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
126
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
127
                        $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
128
                        $this->Ln();
129
                        $this->swit=false;
130
 
131
                }
132
                $addPageGoals=false;
133
                foreach($objective['goals'] as $record){
134
                    if($record->status=='a'){
135
                        if($addPageGoals){
136
                            $this->AddPage();
137
                        }
138
                        $addPageGoals=true;
139
                        if($this->swit){
140
                            $this->SetFillColor(204, 204, 204);
141
                            $this->SetDrawColor(0, 0, 0);
142
                            $this->SetLineWidth(0);
143
                            $this->SetFont('Arial', 'B', 9);
144
                            $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
145
                            $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
146
                            $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
147
                            $this->Cell(25, 6, utf8_decode($objective['date']), 1, 0, 'C', false);
148
                            $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
149
                            $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
150
                            $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
151
                            $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
152
                            $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
153
                            $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
154
                            $this->Ln();
155
                            $this->swit=false;
156
                        }
157
                        $indicatorGoals=0;
158
                        $timeGoals=0;
159
                        $costGoals=0;
160
                        foreach($record->task as $record2){
161
                            if($record2->status=='a'){
162
                                $costGoals=$costGoals+$record2->cost;
163
                                $timeGoals=$timeGoals+$record2->time;
164
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
165
                            }
166
                        }
167
                        if(count($record->task)>0){
168
                            $indicatorGoals=round($indicatorGoals/count($record->task),2);
169
                        }
170
                        $this->titleGoals=$record->title;
171
                        $this->descriptionGoals=$record->description;
172
                        $this->Cell(188, 6, utf8_decode('Meta: '.$record->title), 1, 1, 'C', true);
173
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record->description), 1, 'L', false);
174
                        $this->Cell(40, 6, utf8_decode('Horas Totalesa: '), 1, 0, 'L', false);
175
                        $this->Cell(54, 6, utf8_decode($timeGoals), 1, 0, 'C', false);
176
                        $this->Cell(54, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
177
                        $this->Cell(40, 6, utf8_decode($indicatorGoals.'%'), 1, 1, 'C', false);
178
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
179
                        $this->Cell(158, 6, utf8_decode('$'.$costGoals), 1, 1, 'R', false);
180
                        $this->Ln();
181
                        foreach ($record->task as $record2) {
182
                            if($record2->status=='a'){
183
                                $this->SetFont('Arial', '', 9);
184
                                $this->titleTask=$record2->title;
185
 
186
                                $this->Cell(188, 6, utf8_decode('Tarea: '.$record2->title), 1, 1, 'C', true);
187
                                $this->setP(5);
188
                                $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record2->description), 1, 'L', false);
189
                                $this->MultiCell(188, 6, utf8_decode('Implementacion: '.$record2->how), 1, 'L', false);
190
                                $this->MultiCell(188, 6, utf8_decode('Participantes: '.$record2->who), 1, 'L', false);
191
                                $this->MultiCell(188, 6, utf8_decode('Lugar: '.$record2->place), 1, 'L', false);
192
                                $this->Cell(16, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
193
                                $this->Cell(20, 6, utf8_decode($record2->date), 1, 0, 'C', false);
194
                                $this->Cell(16, 6, utf8_decode('Horas: '), 1, 0, 'L', false);
195
                                $this->Cell(35, 6, utf8_decode($record2->time), 1, 0, 'C', false);
196
                                $this->Cell(40, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
197
                                $this->Cell(16, 6, utf8_decode($record2->indicator.'%'), 1, 0, 'C', false);
198
 
199
                                $this->Cell(20, 6, utf8_decode('Prioridad: '), 1, 0, 'L', false);
200
                                if($record2->priority=='i'){
201
                                    $this->Cell(25, 6, utf8_decode('Importante'), 1, 1, 'C', false);
202
                                }else if($record2->priority=='ni'){
203
                                    $this->Cell(25, 6, utf8_decode('No importante'), 1, 1, 'C', false);
204
                                }else if($record2->priority=='nu'){
205
                                    $this->Cell(25, 6, utf8_decode('No urgente'), 1, 1, 'C', false);
206
                                }else if($record2->priority=='u'){
207
                                    $this->Cell(25, 6, utf8_decode('Urgente'), 1, 1, 'C', false);
208
                                }
209
                                if($record2->indicator==100){
210
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion evaluacion: '.$record2->evaluation), 1, 'L', false);
211
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion desvio: '.$record2->detour), 1, 'L', false);
212
                                }
213
                                $this->SetFont('Arial', 'B', 11);
214
 
215
                                $this->Cell(20, 8, utf8_decode('Costo: '), 1, 0, 'L', false);
216
 
217
                                $this->Cell(168, 8, utf8_decode('$'.$record2->cost), 1, 1, 'R', false);
218
                                $this->setP(1);
219
 
220
                                $this->Ln(7);
221
                            }
222
 
223
                        }
224
                        $this->swit=true;
225
 
226
                    }
227
                }
228
            }
229
 
230
        }
231
 
232
    }
4044 nelberth 233
 
234
    function borderTableAll($title, $items) {
4015 nelberth 235
        $this->AddPage();
236
        // Header Table
237
        $this->SetFillColor(204, 204, 204);
238
        $this->SetDrawColor(0, 0, 0);
239
        $this->SetLineWidth(0);
240
        $this->SetFont('Arial', 'B', 12);
241
        $this->Cell(188, 12, utf8_decode($title), 0, 1, 'C', false);
242
        $this->Ln(5);
243
 
244
        // Body Table
245
        $this->SetFillColor(225, 255, 255);
246
        $this->SetTextColor(0);
247
 
248
        $addPageObjective=false;
4044 nelberth 249
        foreach ($items as $objective) {
4015 nelberth 250
 
4012 nelberth 251
            $this->titleObjective=$objective->title;
4023 nelberth 252
            $this->descriptionObjective=$objective->description;
4013 nelberth 253
            if ($objective->status=='a') {
3958 nelberth 254
                if($addPageObjective){
255
                    $this->AddPage();
256
                }
257
                $addPageObjective=true;
3489 nelberth 258
                $this->SetFont('Arial', 'B', 9);
3890 nelberth 259
                 $costObjective=0;
3901 nelberth 260
                 $timeObjective=0;
3910 nelberth 261
                 $contObjetive=0;
262
                 $indicatorObjective=0;
4014 nelberth 263
                foreach($objective->goals as $record){
3915 nelberth 264
                    $indicatorGoals=0;
3935 nelberth 265
                    if($record->status=='a'){
266
                        foreach($record->task as $record2){
267
                            if($record2->status=='a'){
268
                                $costObjective=$costObjective+$record2->cost;
269
                                $timeObjective=$timeObjective+$record2->time;
270
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
271
                            }
272
                        }
3912 nelberth 273
                    }
274
                    if(count($record->task)>0){
275
                        $indicatorObjective=$indicatorObjective+($indicatorGoals/count($record->task));
3910 nelberth 276
                        $contObjetive++;
3890 nelberth 277
                    }
278
                }
3920 nelberth 279
                if($contObjetive!=0){
280
                    $indicatorObjective=round($indicatorObjective/$contObjetive,2);
281
                }
3931 nelberth 282
 
4022 nelberth 283
                $this->descriptionGoals=$record->description;
4015 nelberth 284
                if(count($objective->goals)<=0){
3933 nelberth 285
                        $this->SetFillColor(204, 204, 204);
286
                        $this->SetDrawColor(0, 0, 0);
287
                        $this->SetLineWidth(0);
288
                        $this->SetFont('Arial', 'B', 9);
289
                        $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
290
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
291
                        $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
4020 nelberth 292
                        $this->Cell(25, 6, utf8_decode($objective->date), 1, 0, 'C', false);
3933 nelberth 293
                        $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
294
                        $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
295
                        $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
296
                        $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
297
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
298
                        $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
299
                        $this->Ln();
300
                        $this->swit=false;
301
 
3931 nelberth 302
                }
3954 nelberth 303
                $addPageGoals=false;
4015 nelberth 304
                foreach($objective->goals as $record){
4021 nelberth 305
 
306
                    $this->titleGoals=$record->title;
3938 nelberth 307
                    if($record->status=='a'){
3954 nelberth 308
                        if($addPageGoals){
309
                            $this->AddPage();
310
                        }
311
                        $addPageGoals=true;
312
                        if($this->swit){
313
                            $this->SetFillColor(204, 204, 204);
314
                            $this->SetDrawColor(0, 0, 0);
315
                            $this->SetLineWidth(0);
316
                            $this->SetFont('Arial', 'B', 9);
317
                            $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
318
                            $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
319
                            $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
4019 nelberth 320
                            $this->Cell(25, 6, utf8_decode($objective->date), 1, 0, 'C', false);
3954 nelberth 321
                            $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
322
                            $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
323
                            $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
324
                            $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
325
                            $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
326
                            $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
327
                            $this->Ln();
328
                            $this->swit=false;
329
                        }
330
                        $indicatorGoals=0;
331
                        $timeGoals=0;
332
                        $costGoals=0;
333
                        foreach($record->task as $record2){
334
                            if($record2->status=='a'){
335
                                $costGoals=$costGoals+$record2->cost;
336
                                $timeGoals=$timeGoals+$record2->time;
337
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
338
                            }
339
                        }
340
                        if(count($record->task)>0){
341
                            $indicatorGoals=round($indicatorGoals/count($record->task),2);
342
                        }
343
                        $this->Cell(188, 6, utf8_decode('Meta: '.$record->title), 1, 1, 'C', true);
344
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record->description), 1, 'L', false);
345
                        $this->Cell(40, 6, utf8_decode('Horas Totalesa: '), 1, 0, 'L', false);
346
                        $this->Cell(54, 6, utf8_decode($timeGoals), 1, 0, 'C', false);
347
                        $this->Cell(54, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
348
                        $this->Cell(40, 6, utf8_decode($indicatorGoals.'%'), 1, 1, 'C', false);
3933 nelberth 349
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
3954 nelberth 350
                        $this->Cell(158, 6, utf8_decode('$'.$costGoals), 1, 1, 'R', false);
3933 nelberth 351
                        $this->Ln();
3954 nelberth 352
                        foreach ($record->task as $record2) {
353
                            if($record2->status=='a'){
354
                                $this->SetFont('Arial', '', 9);
355
                                $this->titleTask=$record2->title;
356
 
357
                                $this->Cell(188, 6, utf8_decode('Tarea: '.$record2->title), 1, 1, 'C', true);
358
                                $this->setP(5);
359
                                $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record2->description), 1, 'L', false);
360
                                $this->MultiCell(188, 6, utf8_decode('Implementacion: '.$record2->how), 1, 'L', false);
361
                                $this->MultiCell(188, 6, utf8_decode('Participantes: '.$record2->who), 1, 'L', false);
362
                                $this->MultiCell(188, 6, utf8_decode('Lugar: '.$record2->place), 1, 'L', false);
363
                                $this->Cell(16, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
364
                                $this->Cell(20, 6, utf8_decode($record2->date), 1, 0, 'C', false);
365
                                $this->Cell(16, 6, utf8_decode('Horas: '), 1, 0, 'L', false);
366
                                $this->Cell(35, 6, utf8_decode($record2->time), 1, 0, 'C', false);
367
                                $this->Cell(40, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
368
                                $this->Cell(16, 6, utf8_decode($record2->indicator.'%'), 1, 0, 'C', false);
369
 
370
                                $this->Cell(20, 6, utf8_decode('Prioridad: '), 1, 0, 'L', false);
371
                                if($record2->priority=='i'){
372
                                    $this->Cell(25, 6, utf8_decode('Importante'), 1, 1, 'C', false);
373
                                }else if($record2->priority=='ni'){
374
                                    $this->Cell(25, 6, utf8_decode('No importante'), 1, 1, 'C', false);
375
                                }else if($record2->priority=='nu'){
376
                                    $this->Cell(25, 6, utf8_decode('No urgente'), 1, 1, 'C', false);
377
                                }else if($record2->priority=='u'){
378
                                    $this->Cell(25, 6, utf8_decode('Urgente'), 1, 1, 'C', false);
379
                                }
380
                                if($record2->indicator==100){
381
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion evaluacion: '.$record2->evaluation), 1, 'L', false);
382
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion desvio: '.$record2->detour), 1, 'L', false);
383
                                }
384
                                $this->SetFont('Arial', 'B', 11);
3938 nelberth 385
 
3954 nelberth 386
                                $this->Cell(20, 8, utf8_decode('Costo: '), 1, 0, 'L', false);
3938 nelberth 387
 
3954 nelberth 388
                                $this->Cell(168, 8, utf8_decode('$'.$record2->cost), 1, 1, 'R', false);
389
                                $this->setP(1);
390
 
3984 nelberth 391
                                $this->Ln(7);
3954 nelberth 392
                            }
393
 
394
                        }
395
                        $this->swit=true;
396
 
3704 nelberth 397
                    }
3702 nelberth 398
                }
3489 nelberth 399
            }
4021 nelberth 400
            $this->swit=true;
3489 nelberth 401
        }
3606 nelberth 402
 
3489 nelberth 403
    }
4044 nelberth 404
    function borderTableMatriz($title,$items){
405
        $this->AddPage();
406
        // Header Table
407
        $this->SetFillColor(204, 204, 204);
408
        $this->SetDrawColor(0, 0, 0);
409
        $this->SetLineWidth(0);
410
        $this->SetFont('Arial', 'B', 12);
411
        $this->Cell(188, 12, utf8_decode($title), 0, 1, 'C', false);
412
        $this->Ln(5);
4215 nelberth 413
        $titleswitch=true;
4044 nelberth 414
        // Body Table
415
        $this->SetFillColor(225, 255, 255);
416
        $this->SetTextColor(0);
4048 nelberth 417
        $addPageObjective=false;
4167 nelberth 418
 
4080 nelberth 419
        foreach ($items as $objective) {
420
            if ($objective->status=='a'&&count($objective->goals)>0) {
4079 nelberth 421
                    $this->titleObjective=$objective->title;
4072 nelberth 422
                $this->descriptionObjective=$objective->description;
423
                    if($addPageObjective){
424
                        $this->AddPage();
425
                    }
426
                    $addPageObjective=true;
427
                    $addPageGoals=false;
4168 nelberth 428
                    foreach($objective->goals as $record){
429
 
4079 nelberth 430
                        if($record->status=='a'&&count($record->task)>0){
431
                            $this->titleGoals=$record->title;
4072 nelberth 432
                            if($addPageGoals){
433
                                $this->AddPage();
434
                            }
435
                            $addPageGoals=true;
436
                            if($this->swit){
437
                                $this->SetFillColor(204, 204, 204);
438
                                $this->SetDrawColor(0, 0, 0);
439
                                $this->SetLineWidth(0);
440
                                $this->SetFont('Arial', 'B', 9);
4227 nelberth 441
                                $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
4072 nelberth 442
                                $this->swit=false;
443
                            }
4227 nelberth 444
                            $this->Cell(188, 6, utf8_decode('Meta: '.$record->title), 1, 1, 'C', true);
4048 nelberth 445
                            $this->Ln();
4088 nelberth 446
 
4095 nelberth 447
                            $iu=[];
448
                            $niu=[];
449
                            $inu=[];
450
                            $ninu=[];
4170 nelberth 451
 
4168 nelberth 452
                            $matriz= array(
453
                                array()
454
                            );
4092 nelberth 455
                            foreach($record->task as $record2){
4095 nelberth 456
                                if($record2->priority=='i'&&$record2->urgent=='u'){
4236 nelberth 457
 
4213 nelberth 458
                                    array_push($iu, $record2->title);
4236 nelberth 459
 
4221 nelberth 460
 
4092 nelberth 461
                                }
4095 nelberth 462
                                if($record2->priority=='i'&&$record2->urgent=='nu'){
4237 nelberth 463
 
4095 nelberth 464
                                    array_push($inu, $record2->title);
4237 nelberth 465
 
4095 nelberth 466
                                }
467
                                if($record2->priority=='ni'&&$record2->urgent=='u'){
468
                                    array_push($niu, $record2->title);
469
                                }
470
                                if($record2->priority=='ni'&&$record2->urgent=='nu'){
4239 nelberth 471
 
4095 nelberth 472
                                    array_push($ninu, $record2->title);
4239 nelberth 473
 
4095 nelberth 474
                                }
475
 
4092 nelberth 476
                            }
4088 nelberth 477
 
4099 nelberth 478
                            foreach ($iu as $index=>$record2) {
479
                                $matriz[$index][0]=$record2;
480
 
481
                            }
4102 nelberth 482
                            foreach ($inu as $index=>$record2) {
483
                                $matriz[$index][1]=$record2;
484
 
485
                            }
4135 nelberth 486
                            foreach ($niu as $index=>$record2) {
487
                                $matriz[$index][2]=$record2;
488
 
489
                            }
490
                            foreach ($ninu as $index=>$record2) {
491
                                $matriz[$index][3]=$record2;
492
                            }
493
 
4223 nelberth 494
                            $countMatriz=count($matriz);
4231 nelberth 495
                            $countMatriz=ceil($countMatriz/10);
4224 nelberth 496
                            $pageSwitch=false;
4230 nelberth 497
                            for($h=1;$h<=$countMatriz;$h++){
4224 nelberth 498
                                if($pageSwitch){
4233 nelberth 499
                                    $this->titleGoals=$record->title.' (Continuacion)';
4224 nelberth 500
                                    $this->AddPage();
501
                                }
4220 nelberth 502
                                $this->SetFont('Arial', 'B', 12);
4192 nelberth 503
                                $this->Cell(32, 12, '', 0, 0, 'C', false);
4220 nelberth 504
                                $this->Cell(78, 12, utf8_decode('Urgente'), 1, 0, 'C', true);
505
                                $this->Cell(78, 12, utf8_decode('No urgente'), 1, 1, 'C', true);
506
 
507
                                $this->Cell(32, 70, utf8_decode('Importante'), 1, 0, 'C', true);
508
                                $this->Cell(156,70,'',1,1,'',false);
509
                                $this->Cell(32, 70, utf8_decode('No Importante'), 1, 0, 'C', true);
510
                                $this->Cell(156,70,'',1,1,'',false);
511
                                if($titleswitch){
512
                                    $this->Line(120, 102,120,242);
513
                                    $this->SetXY(10,108);
4127 nelberth 514
                                }else{
4220 nelberth 515
                                    $this->Line(120, 89,120,231);
4228 nelberth 516
                                    $this->SetXY(10,96);
4110 nelberth 517
                                }
4220 nelberth 518
                                $this->SetFont('Arial', '', 10);
519
 
4230 nelberth 520
                                for($i=($h-1)*10;$i<($h*10);$i++) {
4220 nelberth 521
                                    $this->Cell(32, 12, '', 0, 0, 'C', false);
522
                                    if(isset($matriz[$i][0])){
523
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][0]), 0, 0, 'C', false);
524
                                    }else{
525
                                        $this->Cell(78, 6, utf8_decode(''), 0, 0, 'l', false);
526
                                    }
527
                                    if(isset($matriz[$i][1])){
528
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][1]), 0, 1, 'C', false);
529
                                    }else{
530
                                        $this->Cell(78, 6, utf8_decode(''), 0, 1, 'l', false);
531
                                    }
532
                                }
4234 nelberth 533
                                if($titleswitch){
534
                                    $this->SetXY(10,178);
535
                                    $titleswitch=false;
536
                                }else{
537
                                    $this->SetXY(10,166);
538
                                }
539
                                for($i=($h-1)*10;$i<($h*10);$i++) {
540
                                    $this->Cell(32, 12, '', 0, 0, 'C', false);
4235 nelberth 541
                                    if(isset($matriz[$i][2])){
4234 nelberth 542
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][2]), 0, 0, 'C', false);
543
                                    }else{
544
                                        $this->Cell(78, 6, utf8_decode(''), 0, 0, 'l', false);
545
                                    }
4235 nelberth 546
                                    if(isset($matriz[$i][3])){
4234 nelberth 547
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][3]), 0, 1, 'C', false);
548
                                    }else{
549
                                        $this->Cell(78, 6, utf8_decode(''), 0, 1, 'l', false);
550
                                    }
551
                                }
4224 nelberth 552
                                $pageSwitch=true;
4223 nelberth 553
                            }
4072 nelberth 554
                            $this->swit=true;
555
 
4048 nelberth 556
                        }
557
                    }
558
                }
4072 nelberth 559
                $this->swit=true;
4080 nelberth 560
 
4048 nelberth 561
        }
4044 nelberth 562
    }
563
 
3489 nelberth 564
}