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);
6420 nelberth 190
                                $whoUser='';
6425 nelberth 191
                                $toggleWho=true;
6421 nelberth 192
                                foreach($record2->who as $record3){
6425 nelberth 193
                                    if($toggleWho){
194
                                        $whoUser=$whoUser.$record3;
195
                                        $toggleWho=false;
196
                                    }else{
197
                                        $whoUser=$whoUser.', '.$record3;
198
 
199
                                    }
6421 nelberth 200
                                }
6420 nelberth 201
                                $this->MultiCell(188, 6, utf8_decode('Participantes: '.$whoUser), 1, 'L', false);
4015 nelberth 202
                                $this->MultiCell(188, 6, utf8_decode('Lugar: '.$record2->place), 1, 'L', false);
203
                                $this->Cell(16, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
204
                                $this->Cell(20, 6, utf8_decode($record2->date), 1, 0, 'C', false);
205
                                $this->Cell(16, 6, utf8_decode('Horas: '), 1, 0, 'L', false);
206
                                $this->Cell(35, 6, utf8_decode($record2->time), 1, 0, 'C', false);
207
                                $this->Cell(40, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
208
                                $this->Cell(16, 6, utf8_decode($record2->indicator.'%'), 1, 0, 'C', false);
209
 
210
                                $this->Cell(20, 6, utf8_decode('Prioridad: '), 1, 0, 'L', false);
211
                                if($record2->priority=='i'){
212
                                    $this->Cell(25, 6, utf8_decode('Importante'), 1, 1, 'C', false);
213
                                }else if($record2->priority=='ni'){
214
                                    $this->Cell(25, 6, utf8_decode('No importante'), 1, 1, 'C', false);
215
                                }else if($record2->priority=='nu'){
216
                                    $this->Cell(25, 6, utf8_decode('No urgente'), 1, 1, 'C', false);
217
                                }else if($record2->priority=='u'){
218
                                    $this->Cell(25, 6, utf8_decode('Urgente'), 1, 1, 'C', false);
219
                                }
220
                                if($record2->indicator==100){
221
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion evaluacion: '.$record2->evaluation), 1, 'L', false);
222
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion desvio: '.$record2->detour), 1, 'L', false);
223
                                }
224
                                $this->SetFont('Arial', 'B', 11);
225
 
226
                                $this->Cell(20, 8, utf8_decode('Costo: '), 1, 0, 'L', false);
227
 
228
                                $this->Cell(168, 8, utf8_decode('$'.$record2->cost), 1, 1, 'R', false);
229
                                $this->setP(1);
230
 
231
                                $this->Ln(7);
232
                            }
233
 
234
                        }
235
                        $this->swit=true;
236
 
237
                    }
238
                }
239
            }
240
 
241
        }
242
 
243
    }
4044 nelberth 244
 
245
    function borderTableAll($title, $items) {
4015 nelberth 246
        $this->AddPage();
247
        // Header Table
248
        $this->SetFillColor(204, 204, 204);
249
        $this->SetDrawColor(0, 0, 0);
250
        $this->SetLineWidth(0);
251
        $this->SetFont('Arial', 'B', 12);
252
        $this->Cell(188, 12, utf8_decode($title), 0, 1, 'C', false);
253
        $this->Ln(5);
254
 
255
        // Body Table
256
        $this->SetFillColor(225, 255, 255);
257
        $this->SetTextColor(0);
258
 
259
        $addPageObjective=false;
4044 nelberth 260
        foreach ($items as $objective) {
4015 nelberth 261
 
4012 nelberth 262
            $this->titleObjective=$objective->title;
4023 nelberth 263
            $this->descriptionObjective=$objective->description;
4013 nelberth 264
            if ($objective->status=='a') {
3958 nelberth 265
                if($addPageObjective){
266
                    $this->AddPage();
267
                }
268
                $addPageObjective=true;
3489 nelberth 269
                $this->SetFont('Arial', 'B', 9);
3890 nelberth 270
                 $costObjective=0;
3901 nelberth 271
                 $timeObjective=0;
3910 nelberth 272
                 $contObjetive=0;
273
                 $indicatorObjective=0;
4014 nelberth 274
                foreach($objective->goals as $record){
3915 nelberth 275
                    $indicatorGoals=0;
3935 nelberth 276
                    if($record->status=='a'){
277
                        foreach($record->task as $record2){
278
                            if($record2->status=='a'){
279
                                $costObjective=$costObjective+$record2->cost;
280
                                $timeObjective=$timeObjective+$record2->time;
281
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
282
                            }
283
                        }
3912 nelberth 284
                    }
285
                    if(count($record->task)>0){
286
                        $indicatorObjective=$indicatorObjective+($indicatorGoals/count($record->task));
3910 nelberth 287
                        $contObjetive++;
3890 nelberth 288
                    }
289
                }
3920 nelberth 290
                if($contObjetive!=0){
291
                    $indicatorObjective=round($indicatorObjective/$contObjetive,2);
292
                }
3931 nelberth 293
 
4022 nelberth 294
                $this->descriptionGoals=$record->description;
4015 nelberth 295
                if(count($objective->goals)<=0){
3933 nelberth 296
                        $this->SetFillColor(204, 204, 204);
297
                        $this->SetDrawColor(0, 0, 0);
298
                        $this->SetLineWidth(0);
299
                        $this->SetFont('Arial', 'B', 9);
300
                        $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
301
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
302
                        $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
4020 nelberth 303
                        $this->Cell(25, 6, utf8_decode($objective->date), 1, 0, 'C', false);
3933 nelberth 304
                        $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
305
                        $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
306
                        $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
307
                        $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
308
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
309
                        $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
310
                        $this->Ln();
311
                        $this->swit=false;
312
 
3931 nelberth 313
                }
3954 nelberth 314
                $addPageGoals=false;
4015 nelberth 315
                foreach($objective->goals as $record){
4021 nelberth 316
 
317
                    $this->titleGoals=$record->title;
3938 nelberth 318
                    if($record->status=='a'){
3954 nelberth 319
                        if($addPageGoals){
320
                            $this->AddPage();
321
                        }
322
                        $addPageGoals=true;
323
                        if($this->swit){
324
                            $this->SetFillColor(204, 204, 204);
325
                            $this->SetDrawColor(0, 0, 0);
326
                            $this->SetLineWidth(0);
327
                            $this->SetFont('Arial', 'B', 9);
328
                            $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
329
                            $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$this->descriptionObjective), 1, 'L', false);
330
                            $this->Cell(20, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
4019 nelberth 331
                            $this->Cell(25, 6, utf8_decode($objective->date), 1, 0, 'C', false);
3954 nelberth 332
                            $this->Cell(30, 6, utf8_decode('Horas Totales: '), 1, 0, 'L', false);
333
                            $this->Cell(43, 6, utf8_decode($timeObjective), 1, 0, 'C', false);
334
                            $this->Cell(50, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
335
                            $this->Cell(20, 6, utf8_decode($indicatorObjective.'%'), 1, 1, 'C', false);
336
                            $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
337
                            $this->Cell(158, 6, utf8_decode('$'.$costObjective), 1, 1, 'R', false);
338
                            $this->Ln();
339
                            $this->swit=false;
340
                        }
341
                        $indicatorGoals=0;
342
                        $timeGoals=0;
343
                        $costGoals=0;
344
                        foreach($record->task as $record2){
345
                            if($record2->status=='a'){
346
                                $costGoals=$costGoals+$record2->cost;
347
                                $timeGoals=$timeGoals+$record2->time;
348
                                $indicatorGoals= $indicatorGoals+$record2->indicator;
349
                            }
350
                        }
351
                        if(count($record->task)>0){
352
                            $indicatorGoals=round($indicatorGoals/count($record->task),2);
353
                        }
354
                        $this->Cell(188, 6, utf8_decode('Meta: '.$record->title), 1, 1, 'C', true);
355
                        $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record->description), 1, 'L', false);
356
                        $this->Cell(40, 6, utf8_decode('Horas Totalesa: '), 1, 0, 'L', false);
357
                        $this->Cell(54, 6, utf8_decode($timeGoals), 1, 0, 'C', false);
358
                        $this->Cell(54, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
359
                        $this->Cell(40, 6, utf8_decode($indicatorGoals.'%'), 1, 1, 'C', false);
3933 nelberth 360
                        $this->Cell(30, 6, utf8_decode('Costo total: '), 1, 0, 'L', false);
3954 nelberth 361
                        $this->Cell(158, 6, utf8_decode('$'.$costGoals), 1, 1, 'R', false);
3933 nelberth 362
                        $this->Ln();
3954 nelberth 363
                        foreach ($record->task as $record2) {
364
                            if($record2->status=='a'){
365
                                $this->SetFont('Arial', '', 9);
366
                                $this->titleTask=$record2->title;
367
 
368
                                $this->Cell(188, 6, utf8_decode('Tarea: '.$record2->title), 1, 1, 'C', true);
369
                                $this->setP(5);
370
                                $this->MultiCell(188, 6, utf8_decode('Descripcion: '.$record2->description), 1, 'L', false);
371
                                $this->MultiCell(188, 6, utf8_decode('Implementacion: '.$record2->how), 1, 'L', false);
6432 nelberth 372
                                $whoUser='';
373
                                $toggleWho=true;
374
                                foreach($record2->who as $record3){
375
                                    if($toggleWho){
376
                                        $whoUser=$whoUser.$record3;
377
                                        $toggleWho=false;
378
                                    }else{
379
                                        $whoUser=$whoUser.', '.$record3;
380
 
381
                                    }
382
                                }
383
                                $this->MultiCell(188, 6, utf8_decode('Participantes: '.$whoUser), 1, 'L', false);
3954 nelberth 384
                                $this->MultiCell(188, 6, utf8_decode('Lugar: '.$record2->place), 1, 'L', false);
385
                                $this->Cell(16, 6, utf8_decode('Fecha: '), 1, 0, 'L', false);
386
                                $this->Cell(20, 6, utf8_decode($record2->date), 1, 0, 'C', false);
387
                                $this->Cell(16, 6, utf8_decode('Horas: '), 1, 0, 'L', false);
388
                                $this->Cell(35, 6, utf8_decode($record2->time), 1, 0, 'C', false);
389
                                $this->Cell(40, 6, utf8_decode('Indicador de progreso: '), 1, 0, 'L', false);
390
                                $this->Cell(16, 6, utf8_decode($record2->indicator.'%'), 1, 0, 'C', false);
391
 
392
                                $this->Cell(20, 6, utf8_decode('Prioridad: '), 1, 0, 'L', false);
393
                                if($record2->priority=='i'){
394
                                    $this->Cell(25, 6, utf8_decode('Importante'), 1, 1, 'C', false);
395
                                }else if($record2->priority=='ni'){
396
                                    $this->Cell(25, 6, utf8_decode('No importante'), 1, 1, 'C', false);
397
                                }else if($record2->priority=='nu'){
398
                                    $this->Cell(25, 6, utf8_decode('No urgente'), 1, 1, 'C', false);
399
                                }else if($record2->priority=='u'){
400
                                    $this->Cell(25, 6, utf8_decode('Urgente'), 1, 1, 'C', false);
401
                                }
402
                                if($record2->indicator==100){
403
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion evaluacion: '.$record2->evaluation), 1, 'L', false);
404
                                    $this->MultiCell(188, 6, utf8_decode('Descripcion desvio: '.$record2->detour), 1, 'L', false);
405
                                }
406
                                $this->SetFont('Arial', 'B', 11);
3938 nelberth 407
 
3954 nelberth 408
                                $this->Cell(20, 8, utf8_decode('Costo: '), 1, 0, 'L', false);
3938 nelberth 409
 
3954 nelberth 410
                                $this->Cell(168, 8, utf8_decode('$'.$record2->cost), 1, 1, 'R', false);
411
                                $this->setP(1);
412
 
3984 nelberth 413
                                $this->Ln(7);
3954 nelberth 414
                            }
415
 
416
                        }
417
                        $this->swit=true;
418
 
3704 nelberth 419
                    }
3702 nelberth 420
                }
3489 nelberth 421
            }
4021 nelberth 422
            $this->swit=true;
3489 nelberth 423
        }
3606 nelberth 424
 
3489 nelberth 425
    }
4044 nelberth 426
    function borderTableMatriz($title,$items){
427
        $this->AddPage();
428
        // Header Table
429
        $this->SetFillColor(204, 204, 204);
430
        $this->SetDrawColor(0, 0, 0);
431
        $this->SetLineWidth(0);
432
        $this->SetFont('Arial', 'B', 12);
433
        $this->Cell(188, 12, utf8_decode($title), 0, 1, 'C', false);
434
        $this->Ln(5);
4215 nelberth 435
        $titleswitch=true;
4044 nelberth 436
        // Body Table
437
        $this->SetFillColor(225, 255, 255);
438
        $this->SetTextColor(0);
4048 nelberth 439
        $addPageObjective=false;
4167 nelberth 440
 
4080 nelberth 441
        foreach ($items as $objective) {
442
            if ($objective->status=='a'&&count($objective->goals)>0) {
4079 nelberth 443
                    $this->titleObjective=$objective->title;
4072 nelberth 444
                $this->descriptionObjective=$objective->description;
445
                    if($addPageObjective){
446
                        $this->AddPage();
447
                    }
448
                    $addPageObjective=true;
449
                    $addPageGoals=false;
4168 nelberth 450
                    foreach($objective->goals as $record){
451
 
4079 nelberth 452
                        if($record->status=='a'&&count($record->task)>0){
453
                            $this->titleGoals=$record->title;
4072 nelberth 454
                            if($addPageGoals){
455
                                $this->AddPage();
456
                            }
457
                            $addPageGoals=true;
458
                            if($this->swit){
459
                                $this->SetFillColor(204, 204, 204);
460
                                $this->SetDrawColor(0, 0, 0);
461
                                $this->SetLineWidth(0);
462
                                $this->SetFont('Arial', 'B', 9);
4227 nelberth 463
                                $this->Cell(188, 6, utf8_decode('Objectivo: '.$this->titleObjective), 1, 1, 'C', true);
4072 nelberth 464
                                $this->swit=false;
465
                            }
4227 nelberth 466
                            $this->Cell(188, 6, utf8_decode('Meta: '.$record->title), 1, 1, 'C', true);
4048 nelberth 467
                            $this->Ln();
4088 nelberth 468
 
4095 nelberth 469
                            $iu=[];
470
                            $niu=[];
471
                            $inu=[];
472
                            $ninu=[];
4170 nelberth 473
 
4168 nelberth 474
                            $matriz= array(
475
                                array()
476
                            );
4092 nelberth 477
                            foreach($record->task as $record2){
4095 nelberth 478
                                if($record2->priority=='i'&&$record2->urgent=='u'){
4236 nelberth 479
 
4213 nelberth 480
                                    array_push($iu, $record2->title);
4236 nelberth 481
 
4221 nelberth 482
 
4092 nelberth 483
                                }
4095 nelberth 484
                                if($record2->priority=='i'&&$record2->urgent=='nu'){
4237 nelberth 485
 
4095 nelberth 486
                                    array_push($inu, $record2->title);
4237 nelberth 487
 
4095 nelberth 488
                                }
489
                                if($record2->priority=='ni'&&$record2->urgent=='u'){
490
                                    array_push($niu, $record2->title);
491
                                }
492
                                if($record2->priority=='ni'&&$record2->urgent=='nu'){
4239 nelberth 493
 
4095 nelberth 494
                                    array_push($ninu, $record2->title);
4239 nelberth 495
 
4095 nelberth 496
                                }
497
 
4092 nelberth 498
                            }
4088 nelberth 499
 
4099 nelberth 500
                            foreach ($iu as $index=>$record2) {
501
                                $matriz[$index][0]=$record2;
502
 
503
                            }
4102 nelberth 504
                            foreach ($inu as $index=>$record2) {
505
                                $matriz[$index][1]=$record2;
506
 
507
                            }
4135 nelberth 508
                            foreach ($niu as $index=>$record2) {
509
                                $matriz[$index][2]=$record2;
510
 
511
                            }
512
                            foreach ($ninu as $index=>$record2) {
513
                                $matriz[$index][3]=$record2;
514
                            }
515
 
4223 nelberth 516
                            $countMatriz=count($matriz);
4231 nelberth 517
                            $countMatriz=ceil($countMatriz/10);
4224 nelberth 518
                            $pageSwitch=false;
4230 nelberth 519
                            for($h=1;$h<=$countMatriz;$h++){
4224 nelberth 520
                                if($pageSwitch){
4233 nelberth 521
                                    $this->titleGoals=$record->title.' (Continuacion)';
4224 nelberth 522
                                    $this->AddPage();
523
                                }
4220 nelberth 524
                                $this->SetFont('Arial', 'B', 12);
4192 nelberth 525
                                $this->Cell(32, 12, '', 0, 0, 'C', false);
4220 nelberth 526
                                $this->Cell(78, 12, utf8_decode('Urgente'), 1, 0, 'C', true);
527
                                $this->Cell(78, 12, utf8_decode('No urgente'), 1, 1, 'C', true);
528
 
529
                                $this->Cell(32, 70, utf8_decode('Importante'), 1, 0, 'C', true);
530
                                $this->Cell(156,70,'',1,1,'',false);
531
                                $this->Cell(32, 70, utf8_decode('No Importante'), 1, 0, 'C', true);
532
                                $this->Cell(156,70,'',1,1,'',false);
533
                                if($titleswitch){
534
                                    $this->Line(120, 102,120,242);
535
                                    $this->SetXY(10,108);
4127 nelberth 536
                                }else{
4220 nelberth 537
                                    $this->Line(120, 89,120,231);
4228 nelberth 538
                                    $this->SetXY(10,96);
4110 nelberth 539
                                }
4220 nelberth 540
                                $this->SetFont('Arial', '', 10);
541
 
4230 nelberth 542
                                for($i=($h-1)*10;$i<($h*10);$i++) {
4220 nelberth 543
                                    $this->Cell(32, 12, '', 0, 0, 'C', false);
544
                                    if(isset($matriz[$i][0])){
545
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][0]), 0, 0, 'C', false);
546
                                    }else{
547
                                        $this->Cell(78, 6, utf8_decode(''), 0, 0, 'l', false);
548
                                    }
549
                                    if(isset($matriz[$i][1])){
550
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][1]), 0, 1, 'C', false);
551
                                    }else{
552
                                        $this->Cell(78, 6, utf8_decode(''), 0, 1, 'l', false);
553
                                    }
554
                                }
4234 nelberth 555
                                if($titleswitch){
556
                                    $this->SetXY(10,178);
557
                                    $titleswitch=false;
558
                                }else{
559
                                    $this->SetXY(10,166);
560
                                }
561
                                for($i=($h-1)*10;$i<($h*10);$i++) {
562
                                    $this->Cell(32, 12, '', 0, 0, 'C', false);
4235 nelberth 563
                                    if(isset($matriz[$i][2])){
4234 nelberth 564
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][2]), 0, 0, 'C', false);
565
                                    }else{
566
                                        $this->Cell(78, 6, utf8_decode(''), 0, 0, 'l', false);
567
                                    }
4235 nelberth 568
                                    if(isset($matriz[$i][3])){
4234 nelberth 569
                                        $this->Cell(78, 6, utf8_decode($matriz[$i][3]), 0, 1, 'C', false);
570
                                    }else{
571
                                        $this->Cell(78, 6, utf8_decode(''), 0, 1, 'l', false);
572
                                    }
573
                                }
4224 nelberth 574
                                $pageSwitch=true;
4223 nelberth 575
                            }
4072 nelberth 576
                            $this->swit=true;
577
 
4048 nelberth 578
                        }
579
                    }
580
                }
4072 nelberth 581
                $this->swit=true;
4080 nelberth 582
 
4048 nelberth 583
        }
4044 nelberth 584
    }
585
 
3489 nelberth 586
}