Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6935 | Rev 7041 | 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
 
7040 eleazar 20
    function customHeader($headerFormName, $headerUsername) {
21
        $s = utf8_decode(' Página: ' . $this->PageNo());
22
        $this->SetFont('Arial', '', 10);
23
        $this->SetY(40);
24
        $this->Cell(190, 10, $s, 0, 0, 'R');
25
 
26
        $this->SetFont('Arial', 'B', 15);
27
        $this->SetY(50);
28
        $this->Cell(180, 10, $headerFormName, 0, 0, 'C');
29
        $this->setY($this->getY() + 8);
30
 
31
 
32
        $this->SetFont('Arial', '', 10);
33
        $this->Cell(180, 10, $headerUsername, 0, 0, 'C');
34
        $this->setY($this->getY() + 10);
35
    }
36
 
6898 eleazar 37
    /**
38
     * Footer PDF
39
     */
40
    function Footer() {
41
        if ($this->footer != '') {
42
            $this->SetY(-40);
43
            $this->Image($this->footer, 10, $this->getY(), 190);
44
        }
45
    }
46
 
47
    /**
48
     * Section Scale
49
     */
50
    function sectionScale() {
51
        $this->SetFillColor(225, 255, 255);
52
        $this->SetTextColor(0);
53
        $this->SetFont('Arial', 'B', 9);
54
 
55
 
56
        $this->Cell(35, 8, utf8_decode(' Escala/Niveles:'), 1, 0, 'L', false);
57
 
58
        $this->SetFillColor(225, 255, 255);
59
        $this->SetTextColor(0);
60
        $this->SetFont('Arial', '', 9);
61
 
62
        $this->Cell(155, 8, utf8_decode(' 1: Mínimo  2: Medio  3: Medio-Alto  4: Alto  N/A: No aplica
63
'), 1, 'L', false);
64
        $this->Ln(15);
65
    }
66
 
67
    /**
68
     * Create Table
69
     * @param string $title
70
     * @param array $content
71
     */
72
    function borderTable($title, $content) {
73
 
74
        // Header Table
75
        $this->SetFillColor(204, 204, 204);
76
        $this->SetDrawColor(0, 0, 0);
77
        $this->SetLineWidth(0);
78
        $this->SetFont('Arial', 'B', 9);
79
 
80
        $this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);
81
        $this->Ln();
82
 
83
        // Body Table
84
        $this->SetFillColor(225, 255, 255);
85
        $this->SetTextColor(0);
86
 
87
        foreach ($content as $rs) {
88
            if (isset($rs['title'])) {
89
 
90
                $this->SetFont('Arial', 'B', 9);
91
                $this->Cell(50, 10, utf8_decode($rs['title']), 1, 0, 'L', false);
92
                $this->MultiCell(140, 10, utf8_decode($rs['content']), 1, 'L', false);
93
                $this->Ln();
94
            } else {
95
 
96
                $this->SetFont('Arial', '', 9);
97
                $this->MultiCell(190, 6, utf8_decode($rs['content']), 1, 'L', false);
98
            }
99
        }
100
        $this->Ln(5);
101
    }
102
 
103
    /**
104
     * title option table
105
     * @param string $title
106
     */
107
    function titleOptionTable($title) {
108
 
109
        if ($title != '') {
110
            // Body Table
111
            $this->SetFillColor(204, 204, 204);
112
            $this->SetDrawColor(0, 0, 0);
113
            $this->SetLineWidth(0);
114
            $this->SetFont('Arial', 'B', 9);
115
 
116
            $this->Cell(190, 6, utf8_decode($title), 1, 0, 'L', true);
117
            $this->Ln();
118
        }
119
    }
120
 
121
 
122
    /**
123
     * Create Table
124
     * @param string $title
125
     * @param array $content
126
     */
127
    function singleTable($title, $content) {
128
 
129
        // Header Table
130
        $this->SetFillColor(255, 255, 255);
131
        $this->SetDrawColor(0, 0, 0);
132
        $this->SetLineWidth(0);
133
        $this->SetFont('Arial', 'B', 9);
134
 
135
        $this->Cell(190, 6, utf8_decode($title), 0, 0, 'L', true);
136
        $this->Ln();
137
 
138
        // Body Table
139
        $this->SetFillColor(225, 255, 255);
140
        $this->SetTextColor(0);
141
        $this->SetFont('Arial', '', 9);
142
 
143
        foreach ($content as $rs) {
144
            if (isset($rs['title'])) {
145
                $this->Cell(40, 6, utf8_decode($rs['title']), 0, 0, 'L', false);
146
                $this->Cell(150, 6, utf8_decode($rs['content']), 0, 'L', false);
147
                $this->Ln();
148
            } else {
149
                if ($rs['content'] != "") {
150
                    $this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);
151
                }
152
            }
153
        }
154
        $this->Ln(5);
155
    }
156
 
157
}