Proyectos de Subversion LeadersLinked - Backend

Rev

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