Proyectos de Subversion LeadersLinked - Backend

Rev

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