-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htPDFRadiomobiliClass.php
226 lines (189 loc) · 9.09 KB
/
.htPDFRadiomobiliClass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?php
/**
* @package CRI Web Radio
* @author WizLab.it
* @version 20180705.015
*/
/*===========================================================================
- CLASS PDF
===========================================================================*/
require("fpdf16/fpdf.php");
class PDF extends FPDF {
private $canali;
/*---------------------------------------------------------------------------
- Constructor
---------------------------------------------------------------------------*/
function __construct($orientation, $unit, $format) {
$rsCanali = $GLOBALS["DBL"]->query("SELECT frequenzaTx, frequenzaRx FROM canali ORDER BY canale");
while($rcCanali = $rsCanali->fetch_object()) {
$this->canali["tx"][] = $rcCanali->frequenzaTx;
$this->canali["rx"][] = $rcCanali->frequenzaRx;
}
$this->canali["tx"] = implode(", ", $this->canali["tx"]);
$this->canali["rx"] = implode(", ", $this->canali["rx"]);
parent::__construct($orientation, $unit, $format);
}
/*---------------------------------------------------------------------------
- Function: Header()
---------------------------------------------------------------------------*/
function Header() {
$this->Image("img/logo.jpg", 20, 15, 50);
$this->SetXY(77, 25);
$this->SetFont("Arial", "B", 28);
$this->MultiCell(600, 32, utf8_decode("Scheda riepilogativa Radiomobile"));
$this->SetXY(15, 80);
}
/*---------------------------------------------------------------------------
- Function: Footer()
---------------------------------------------------------------------------*/
function Footer() {
$this->SetXY(727, 15);
$this->SetFont("Times", "I", 8);
$this->Cell(100, 10, utf8_decode("Pag. " . $this->PageNo() . "/{nb}"), 0, 0, "R");
}
/*---------------------------------------------------------------------------
- Function: drawCover()
---------------------------------------------------------------------------*/
function drawCover($filtroMaglie=false) {
$this->SetY(90);
$this->SetFont("Times", "B", 20);
$this->Cell(0, 20, utf8_decode("CARATTERISTICHE GENERALI"), 0, 0, "C");
$this->Rect(80, 140, 682, 400);
$this->SetFont("Times", "", 16);
$this->SetY(180);
$this->SetLeftMargin(100);
$col1 = 310;
$col2 = 330;
$this->Cell($col1, 24, utf8_decode("Banda di frequenza"));
$this->Cell($col2, 24, utf8_decode("VHF-UHF"), 0, 1);
$this->Cell($col1, 24, utf8_decode("Tipo collegamento"));
$this->Cell($col2, 24, utf8_decode("TF"), 0, 1);
$this->Cell($col1, 24, utf8_decode("Tipo comunicazione"));
$this->Cell($col2, 24, utf8_decode("S"), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° Canali"));
$this->Cell($col2, 24, utf8_decode(sprintf("%02d", $GLOBALS["DBL"]->query("SELECT id FROM canali")->num_rows)), 0, 1);
$this->Cell($col1, 24, utf8_decode("Tono subaudio"));
$this->Cell($col2, 24, utf8_decode("156.7 Hz"), 0, 1);
$this->Cell($col1, 24, utf8_decode("Chiamata selettiva"));
$this->Cell($col2, 24, utf8_decode("XXXXXX"), 0, 1);
$totaleVeicolari = $GLOBALS["DBL"]->query("SELECT id FROM radio WHERE tipo=2 AND escludiDaSchedaTecnica=0" . (($filtroMaglie && is_array($filtroMaglie)) ? " AND maglia IN(" . implode(",", $filtroMaglie) . ")" : ""))->num_rows;
$totalePortatili = $GLOBALS["DBL"]->query("SELECT id FROM radio WHERE tipo=3 AND escludiDaSchedaTecnica=0" . (($filtroMaglie && is_array($filtroMaglie)) ? " AND maglia IN(" . implode(",", $filtroMaglie) . ")" : ""))->num_rows;
$this->Cell($col1, 24, utf8_decode("N° totale stazioni terminali"));
$this->Cell($col2, 24, utf8_decode($totaleVeicolari + $totalePortatili), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° stazioni terminali multiple destinazioni"));
$this->Cell($col2, 24, utf8_decode("0"), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° stazioni fisse"));
$this->Cell($col2, 24, utf8_decode("0"), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° stazioni mobili"));
$this->Cell($col2, 24, utf8_decode($totaleVeicolari), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° stazioni portatili"));
$this->Cell($col2, 24, utf8_decode($totalePortatili), 0, 1);
$this->Cell($col1, 24, utf8_decode("N° stazioni ripetitrici"));
$this->Cell($col2, 24, utf8_decode("0"), 0, 1);
$this->Cell($col1, 24, utf8_decode("Lunghezza massima del collegamento"));
$this->SetFont("", "B");
$this->Cell($col2, 24, utf8_decode("Tutto il territorio nazionale"), 0, 1);
$this->SetFont("", "");
}
/*---------------------------------------------------------------------------
- Function: drawVeicolari()
---------------------------------------------------------------------------*/
function drawVeicolari($filtroMaglie=false) {
$columns = array(
"1" => array("title"=>"N.Veicolari", "width"=>64),
"2" => array("title"=>"Apparati", "width"=>165),
"3" => array("title"=>"Antenne", "width"=>75),
"4" => array("title"=>"Emissione (MHz)", "width"=>515),
);
$i = $row = 0;
$rs = $GLOBALS["DBL"]->query("SELECT COUNT(id) AS numeroVeicolari, modelloRadio FROM radio WHERE tipo=2 AND escludiDaSchedaTecnica=0 " . (($filtroMaglie && is_array($filtroMaglie)) ? "AND maglia IN(" . implode(",", $filtroMaglie) . ") " : "") . "GROUP BY modelloRadio ORDER BY numeroVeicolari DESC");
while($rc = $rs->fetch_object()) {
$radio = getRadioById($rc->modelloRadio);
if($radio["fuoriUso"]) continue;
$this->SetLeftMargin(15);
if(($i == 0) || ($row > 20)) {
$row = 0;
$this->AddPage();
$this->SetFont("Times", "BI", 12);
foreach($columns as $col) {
$this->Cell($col["width"], 15, utf8_decode($col["title"]), "BR");
}
$this->Ln();
}
$this->SetFont("Times", "", 10);
$rowY = 83 + 15 + (11 * 2 * $row);
//Colonna 1
$this->SetXY(15, $rowY);
$this->Write(11 * 2, utf8_decode($rc->numeroVeicolari));
//Colonna 2
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"]);
$this->Write(11, utf8_decode($radio["produttore"] . " " . $radio["modello"]));
//Colonna 3
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"] + $columns["2"]["width"]);
$this->Write(11, utf8_decode("Stilo 5/8\nGuad. 4db"));
//Colonna 4
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"] + $columns["2"]["width"] + $columns["3"]["width"]);
$this->SetFont("Times", "", 8);
$this->Write(11, utf8_decode("TX " . $this->canali["tx"] . "\nRX " . $this->canali["rx"]));
$this->SetFont("Times", "", 10);
$lineY = $rowY + (11 * 2);
$this->Line(15, $lineY, (15 + $columns["1"]["width"] + $columns["2"]["width"] + $columns["3"]["width"] + $columns["4"]["width"]), $lineY);
$i++;
$row++;
}
}
/*---------------------------------------------------------------------------
- Function: drawPortatili()
---------------------------------------------------------------------------*/
function drawPortatili($filtroMaglie=false) {
$columns = array(
"1" => array("title"=>"N.Portatili", "width"=>58),
"2" => array("title"=>"Apparati", "width"=>140),
"3" => array("title"=>"Antenne", "width"=>65),
"4" => array("title"=>"Emissione (MHz)", "width"=>550),
);
$i = $row = 0;
$rs = $GLOBALS["DBL"]->query("SELECT COUNT(id) AS numeroPortatili, modelloRadio FROM radio WHERE tipo=3 AND escludiDaSchedaTecnica=0 " . (($filtroMaglie && is_array($filtroMaglie)) ? "AND maglia IN(" . implode(",", $filtroMaglie) . ") " : "") . "GROUP BY modelloRadio ORDER BY numeroPortatili DESC");
while($rc = $rs->fetch_object()) {
$radio = getRadioById($rc->modelloRadio);
if($radio["fuoriUso"]) continue;
$this->SetLeftMargin(15);
if(($i == 0) || ($row > 20)) {
$row = 0;
$this->AddPage();
$this->SetFont("Times", "BI", 12);
foreach($columns as $col) {
$this->Cell($col["width"], 15, utf8_decode($col["title"]), "BR");
}
$this->Ln();
}
$this->SetFont("Times", "", 10);
$rowY = 83 + 15 + (11 * 2 * $row);
//Colonna 1
$this->SetXY(15, $rowY);
$this->Write(11 * 2, utf8_decode($rc->numeroPortatili));
//Colonna 2
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"]);
$this->Write(11, utf8_decode($radio["produttore"] . "\n" . $radio["modello"]));
//Colonna 3
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"] + $columns["2"]["width"]);
$this->Write(11, utf8_decode("Gomma\nGuad. 0db"));
//Colonna 4
$this->SetY($rowY);
$this->SetLeftMargin(15 + $columns["1"]["width"] + $columns["2"]["width"] + $columns["3"]["width"]);
$this->SetFont("Times", "", 8);
$this->Write(11, utf8_decode("TX " . $this->canali["tx"] . "\nRX " . $this->canali["rx"]));
$this->SetFont("Times", "", 10);
$lineY = $rowY + (11 * 2);
$this->Line(15, $lineY, (15 + $columns["1"]["width"] + $columns["2"]["width"] + $columns["3"]["width"] + $columns["4"]["width"]), $lineY);
$i++;
$row++;
}
}
}
?>