Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
6898 eleazar 1
<?php
2
 
3
namespace LeadersLinked\Library;
4
 
5
use Fpdf\Fpdf;
6
 
7
class UniqueSurveyReport 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->MultiCell(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
    /**
106
     * Create Table
107
     * @param string $title
108
     * @param array $content
109
     */
110
    function singleTable($title, $content) {
111
 
112
        // Header Table
113
        $this->SetFillColor(255, 255, 255);
114
        $this->SetDrawColor(0, 0, 0);
115
        $this->SetLineWidth(0);
116
        $this->SetFont('Arial', 'B', 9);
117
 
118
        $this->Cell(190, 6, utf8_decode($title), 0, 0, 'L', true);
119
        $this->Ln();
120
 
121
        // Body Table
122
        $this->SetFillColor(225, 255, 255);
123
        $this->SetTextColor(0);
124
        $this->SetFont('Arial', '', 9);
125
 
126
        foreach ($content as $rs) {
127
            if (isset($rs['title'])) {
128
                $this->Cell(40, 6, utf8_decode($rs['title']), 0, 0, 'L', false);
129
                $this->Cell(150, 6, utf8_decode($rs['content']), 0, 'L', false);
130
                $this->Ln();
131
            } else {
132
                if ($rs['content'] != "") {
133
                    $this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);
134
                }
135
            }
136
        }
137
        $this->Ln(5);
138
    }
139
 
140
}