@@ -298,14 +298,14 @@ discard block |
||
298 | 298 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
299 | 299 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
300 | 300 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
301 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
301 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
302 | 302 | * @param string $link Insere um hiperlink |
303 | 303 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
304 | 304 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
305 | 305 | * e para isso atera o tamanho do fonte até caber no espaço, |
306 | 306 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
307 | - * @param number $hmax |
|
308 | - * @param number $vOffSet incremento forçado na na posição Y |
|
307 | + * @param integer $hmax |
|
308 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
309 | 309 | * @return number $height Qual a altura necessária para desenhar esta textBox |
310 | 310 | */ |
311 | 311 | protected function pTextBox( |
@@ -427,20 +427,20 @@ discard block |
||
427 | 427 | * |
428 | 428 | * @param number $x Posição horizontal da caixa, canto esquerdo superior |
429 | 429 | * @param number $y Posição vertical da caixa, canto esquerdo superior |
430 | - * @param number $w Largura da caixa |
|
431 | - * @param number $h Altura da caixa |
|
430 | + * @param double $w Largura da caixa |
|
431 | + * @param integer $h Altura da caixa |
|
432 | 432 | * @param string $text Conteúdo da caixa |
433 | 433 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
434 | 434 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
435 | 435 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
436 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
436 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
437 | 437 | * @param string $link Insere um hiperlink |
438 | 438 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
439 | 439 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
440 | 440 | * linha e para isso atera o tamanho do fonte até caber no espaço, |
441 | 441 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
442 | - * @param number $hmax |
|
443 | - * @param number $vOffSet incremento forçado na na posição Y |
|
442 | + * @param integer $hmax |
|
443 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
444 | 444 | * @return number $height Qual a altura necessária para desenhar esta textBox |
445 | 445 | */ |
446 | 446 | protected function pTextBox90( |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $tamanho = strlen($numero); |
117 | 117 | $soma = 0; |
118 | 118 | $mult = 2; |
119 | - for ($i = $tamanho-1; $i >= 0; $i--) { |
|
119 | + for ($i = $tamanho - 1; $i >= 0; $i--) { |
|
120 | 120 | $digito = (int) $numero[$i]; |
121 | 121 | $r = $digito * $mult; |
122 | 122 | $soma += $r; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $atDH = explode(':', $inter[0]); |
170 | 170 | $timestampDH = mktime($atDH[0], $atDH[1], $atDH[2], $adDH[1], $adDH[2], $adDH[0]); |
171 | 171 | } else { |
172 | - $timestampDH = mktime($month = $adDH[1], $day = $adDH[2], $year = $adDH[0]); |
|
172 | + $timestampDH = mktime($month = $adDH[1], $day = $adDH[2], $year = $adDH[0]); |
|
173 | 173 | } |
174 | 174 | return $timestampDH; |
175 | 175 | } |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | } |
201 | 201 | //contar o numero de cerquilhas da mascara |
202 | 202 | $aMask = str_split($mascara); |
203 | - $z=0; |
|
204 | - $flag=false; |
|
203 | + $z = 0; |
|
204 | + $flag = false; |
|
205 | 205 | foreach ($aMask as $letra) { |
206 | 206 | if ($letra == '#') { |
207 | 207 | $z++; |
@@ -209,20 +209,20 @@ discard block |
||
209 | 209 | } |
210 | 210 | if ($z > $tCampo) { |
211 | 211 | //o campo é menor que esperado |
212 | - $flag=true; |
|
212 | + $flag = true; |
|
213 | 213 | } |
214 | 214 | //cria uma variável grande o suficiente para conter os dados |
215 | 215 | $sRetorno = ''; |
216 | - $sRetorno = str_pad($sRetorno, $tCampo+$tMask, " ", STR_PAD_LEFT); |
|
216 | + $sRetorno = str_pad($sRetorno, $tCampo + $tMask, " ", STR_PAD_LEFT); |
|
217 | 217 | //pega o tamanho da string de retorno |
218 | 218 | $tRetorno = strlen($sRetorno); |
219 | 219 | //se houve entrada de dados |
220 | - if ($sLimpo != '' && $mascara !='') { |
|
220 | + if ($sLimpo != '' && $mascara != '') { |
|
221 | 221 | //inicia com a posição do ultimo digito da mascara |
222 | 222 | $x = $tMask; |
223 | 223 | $y = $tCampo; |
224 | 224 | $cI = 0; |
225 | - for ($i = $tMaior-1; $i >= 0; $i--) { |
|
225 | + for ($i = $tMaior - 1; $i >= 0; $i--) { |
|
226 | 226 | if ($cI < $z) { |
227 | 227 | // e o digito da mascara é # trocar pelo digito do campo |
228 | 228 | // se o inicio da string da mascara for atingido antes de terminar |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | //se o fim do campo for atingido antes do fim da mascara |
236 | 236 | //verificar se é ( se não for não use |
237 | - if ($digMask=='#') { |
|
237 | + if ($digMask == '#') { |
|
238 | 238 | $cI++; |
239 | 239 | if ($y > 0) { |
240 | 240 | $sRetorno[--$tRetorno] = $sLimpo[--$y]; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | if ($y > 0) { |
246 | 246 | $sRetorno[--$tRetorno] = $mascara[$x]; |
247 | 247 | } else { |
248 | - if ($mascara[$x] =='(') { |
|
248 | + if ($mascara[$x] == '(') { |
|
249 | 249 | $sRetorno[--$tRetorno] = $mascara[$x]; |
250 | 250 | } |
251 | 251 | } |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | * @param array $aFont |
274 | 274 | * @return number numero de linhas |
275 | 275 | */ |
276 | - protected function pGetNumLines($text, $width, $aFont = array('font'=>'Times','size'=>8,'style'=>'')) |
|
276 | + protected function pGetNumLines($text, $width, $aFont = array('font'=>'Times', 'size'=>8, 'style'=>'')) |
|
277 | 277 | { |
278 | 278 | $text = trim($text); |
279 | 279 | $this->pdf->SetFont($aFont['font'], $aFont['style'], $aFont['size']); |
280 | - $n = $this->pdf->WordWrap($text, $width-0.2); |
|
280 | + $n = $this->pdf->WordWrap($text, $width - 0.2); |
|
281 | 281 | return $n; |
282 | 282 | } |
283 | 283 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $w, |
315 | 315 | $h, |
316 | 316 | $text = '', |
317 | - $aFont = array('font'=>'Times','size'=>8,'style'=>''), |
|
317 | + $aFont = array('font'=>'Times', 'size'=>8, 'style'=>''), |
|
318 | 318 | $vAlign = 'T', |
319 | 319 | $hAlign = 'L', |
320 | 320 | $border = 1, |
@@ -361,15 +361,15 @@ discard block |
||
361 | 361 | //verificar o alinhamento vertical |
362 | 362 | if ($vAlign == 'T') { |
363 | 363 | //alinhado ao topo |
364 | - $y1 = $y+$incY; |
|
364 | + $y1 = $y + $incY; |
|
365 | 365 | } |
366 | 366 | if ($vAlign == 'C') { |
367 | 367 | //alinhado ao centro |
368 | - $y1 = $y + $incY + (($h-$altText)/2); |
|
368 | + $y1 = $y + $incY + (($h - $altText) / 2); |
|
369 | 369 | } |
370 | 370 | if ($vAlign == 'B') { |
371 | 371 | //alinhado a base |
372 | - $y1 = ($y + $h)-0.5; |
|
372 | + $y1 = ($y + $h) - 0.5; |
|
373 | 373 | } |
374 | 374 | //para cada linha |
375 | 375 | foreach ($lines as $line) { |
@@ -386,17 +386,17 @@ discard block |
||
386 | 386 | } |
387 | 387 | //ajustar ao alinhamento horizontal |
388 | 388 | if ($hAlign == 'L') { |
389 | - $x1 = $x+0.5; |
|
389 | + $x1 = $x + 0.5; |
|
390 | 390 | } |
391 | 391 | if ($hAlign == 'C') { |
392 | - $x1 = $x + (($w - $comp)/2); |
|
392 | + $x1 = $x + (($w - $comp) / 2); |
|
393 | 393 | } |
394 | 394 | if ($hAlign == 'R') { |
395 | - $x1 = $x + $w - ($comp+0.5); |
|
395 | + $x1 = $x + $w - ($comp + 0.5); |
|
396 | 396 | } |
397 | 397 | //escrever o texto |
398 | 398 | if ($vOffSet > 0) { |
399 | - if ($y1 > ($oldY+$vOffSet)) { |
|
399 | + if ($y1 > ($oldY + $vOffSet)) { |
|
400 | 400 | if (!$resetou) { |
401 | 401 | $y1 = $oldY; |
402 | 402 | $resetou = true; |
@@ -408,12 +408,12 @@ discard block |
||
408 | 408 | } |
409 | 409 | //incrementar para escrever o proximo |
410 | 410 | $y1 += $incY; |
411 | - if (($hmax > 0) && ($y1 > ($y+($hmax-1)))) { |
|
411 | + if (($hmax > 0) && ($y1 > ($y + ($hmax - 1)))) { |
|
412 | 412 | $temObs = true; |
413 | 413 | break; |
414 | 414 | } |
415 | 415 | } |
416 | - return ($y1-$y)-$incY; |
|
416 | + return ($y1 - $y) - $incY; |
|
417 | 417 | } // fim função __textBox |
418 | 418 | |
419 | 419 | /** |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $w, |
450 | 450 | $h, |
451 | 451 | $text = '', |
452 | - $aFont = array('font'=>'Times','size'=>8,'style'=>''), |
|
452 | + $aFont = array('font'=>'Times', 'size'=>8, 'style'=>''), |
|
453 | 453 | $vAlign = 'T', |
454 | 454 | $hAlign = 'L', |
455 | 455 | $border = 1, |
@@ -498,15 +498,15 @@ discard block |
||
498 | 498 | //verificar o alinhamento vertical |
499 | 499 | if ($vAlign == 'T') { |
500 | 500 | //alinhado ao topo |
501 | - $y1 = $y+$incY; |
|
501 | + $y1 = $y + $incY; |
|
502 | 502 | } |
503 | 503 | if ($vAlign == 'C') { |
504 | 504 | //alinhado ao centro |
505 | - $y1 = $y + $incY + (($h-$altText)/2); |
|
505 | + $y1 = $y + $incY + (($h - $altText) / 2); |
|
506 | 506 | } |
507 | 507 | if ($vAlign == 'B') { |
508 | 508 | //alinhado a base |
509 | - $y1 = ($y + $h)-0.5; |
|
509 | + $y1 = ($y + $h) - 0.5; |
|
510 | 510 | } |
511 | 511 | //para cada linha |
512 | 512 | foreach ($lines as $line) { |
@@ -523,17 +523,17 @@ discard block |
||
523 | 523 | } |
524 | 524 | //ajustar ao alinhamento horizontal |
525 | 525 | if ($hAlign == 'L') { |
526 | - $x1 = $x+0.5; |
|
526 | + $x1 = $x + 0.5; |
|
527 | 527 | } |
528 | 528 | if ($hAlign == 'C') { |
529 | - $x1 = $x + (($w - $comp)/2); |
|
529 | + $x1 = $x + (($w - $comp) / 2); |
|
530 | 530 | } |
531 | 531 | if ($hAlign == 'R') { |
532 | - $x1 = $x + $w - ($comp+0.5); |
|
532 | + $x1 = $x + $w - ($comp + 0.5); |
|
533 | 533 | } |
534 | 534 | //escrever o texto |
535 | 535 | if ($vOffSet > 0) { |
536 | - if ($y1 > ($oldY+$vOffSet)) { |
|
536 | + if ($y1 > ($oldY + $vOffSet)) { |
|
537 | 537 | if (!$resetou) { |
538 | 538 | $y1 = $oldY; |
539 | 539 | $resetou = true; |
@@ -545,13 +545,13 @@ discard block |
||
545 | 545 | } |
546 | 546 | //incrementar para escrever o proximo |
547 | 547 | $y1 += $incY; |
548 | - if (($hmax > 0) && ($y1 > ($y+($hmax-1)))) { |
|
548 | + if (($hmax > 0) && ($y1 > ($y + ($hmax - 1)))) { |
|
549 | 549 | $temObs = true; |
550 | 550 | break; |
551 | 551 | } |
552 | 552 | } |
553 | 553 | //Zerando rotação |
554 | 554 | $this->pdf->Rotate(0, $x, $y); |
555 | - return ($y1-$y)-$incY; |
|
555 | + return ($y1 - $y) - $incY; |
|
556 | 556 | } |
557 | 557 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
100 | 100 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
101 | 101 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
102 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
102 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
103 | 103 | * @param string $preVisualizar 0-Não 1-Sim |
104 | 104 | */ |
105 | 105 | public function __construct( |
@@ -536,8 +536,8 @@ discard block |
||
536 | 536 | * zCabecalho |
537 | 537 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
538 | 538 | * |
539 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
540 | - * @param number $y Posição vertical inicial, canto superior |
|
539 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
540 | + * @param integer $y Posição vertical inicial, canto superior |
|
541 | 541 | * @param number $pag Número da Página |
542 | 542 | * @param number $totPag Total de páginas |
543 | 543 | * @return number Posição vertical final |
@@ -1199,8 +1199,7 @@ discard block |
||
1199 | 1199 | * rodapeDACTE |
1200 | 1200 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
1201 | 1201 | * |
1202 | - * @param number $xInic Posição horizontal canto esquerdo |
|
1203 | - * @param number $yFinal Posição vertical final para impressão |
|
1202 | + * @param integer $x |
|
1204 | 1203 | */ |
1205 | 1204 | protected function zRodape($x, $y) |
1206 | 1205 | { |
@@ -1223,8 +1222,8 @@ discard block |
||
1223 | 1222 | * zRemetente |
1224 | 1223 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1225 | 1224 | * |
1226 | - * @param number $x Posição horizontal canto esquerdo |
|
1227 | - * @param number $y Posição vertical canto superior |
|
1225 | + * @param integer $x Posição horizontal canto esquerdo |
|
1226 | + * @param integer $y Posição vertical canto superior |
|
1228 | 1227 | * @return number Posição vertical final |
1229 | 1228 | */ |
1230 | 1229 | protected function zRemetente($x = 0, $y = 0) |
@@ -1310,8 +1309,8 @@ discard block |
||
1310 | 1309 | * zDestinatario |
1311 | 1310 | * Monta o campo com os dados do destinatário na DACTE. |
1312 | 1311 | * |
1313 | - * @param number $x Posição horizontal canto esquerdo |
|
1314 | - * @param number $y Posição vertical canto superior |
|
1312 | + * @param integer $x Posição horizontal canto esquerdo |
|
1313 | + * @param integer $y Posição vertical canto superior |
|
1315 | 1314 | * @return number Posição vertical final |
1316 | 1315 | */ |
1317 | 1316 | protected function zDestinatario($x = 0, $y = 0) |
@@ -1396,8 +1395,8 @@ discard block |
||
1396 | 1395 | * zExpedidor |
1397 | 1396 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1398 | 1397 | * |
1399 | - * @param number $x Posição horizontal canto esquerdo |
|
1400 | - * @param number $y Posição vertical canto superior |
|
1398 | + * @param integer $x Posição horizontal canto esquerdo |
|
1399 | + * @param integer $y Posição vertical canto superior |
|
1401 | 1400 | * @return number Posição vertical final |
1402 | 1401 | */ |
1403 | 1402 | protected function zExpedidor($x = 0, $y = 0) |
@@ -1493,8 +1492,8 @@ discard block |
||
1493 | 1492 | * zRecebedor |
1494 | 1493 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1495 | 1494 | * |
1496 | - * @param number $x Posição horizontal canto esquerdo |
|
1497 | - * @param number $y Posição vertical canto superior |
|
1495 | + * @param integer $x Posição horizontal canto esquerdo |
|
1496 | + * @param integer $y Posição vertical canto superior |
|
1498 | 1497 | * @return number Posição vertical final |
1499 | 1498 | */ |
1500 | 1499 | protected function zRecebedor($x = 0, $y = 0) |
@@ -1590,8 +1589,8 @@ discard block |
||
1590 | 1589 | * zTomador |
1591 | 1590 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1592 | 1591 | * |
1593 | - * @param number $x Posição horizontal canto esquerdo |
|
1594 | - * @param number $y Posição vertical canto superior |
|
1592 | + * @param integer $x Posição horizontal canto esquerdo |
|
1593 | + * @param integer $y Posição vertical canto superior |
|
1595 | 1594 | * @return number Posição vertical final |
1596 | 1595 | */ |
1597 | 1596 | protected function zTomador($x = 0, $y = 0) |
@@ -1679,8 +1678,8 @@ discard block |
||
1679 | 1678 | * zDescricaoCarga |
1680 | 1679 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1681 | 1680 | * |
1682 | - * @param number $x Posição horizontal canto esquerdo |
|
1683 | - * @param number $y Posição vertical canto superior |
|
1681 | + * @param integer $x Posição horizontal canto esquerdo |
|
1682 | + * @param integer $y Posição vertical canto superior |
|
1684 | 1683 | * @return number Posição vertical final |
1685 | 1684 | */ |
1686 | 1685 | protected function zDescricaoCarga($x = 0, $y = 0) |
@@ -1886,8 +1885,8 @@ discard block |
||
1886 | 1885 | * zCompValorServ |
1887 | 1886 | * Monta o campo com os componentes da prestação de serviços. |
1888 | 1887 | * |
1889 | - * @param number $x Posição horizontal canto esquerdo |
|
1890 | - * @param number $y Posição vertical canto superior |
|
1888 | + * @param integer $x Posição horizontal canto esquerdo |
|
1889 | + * @param integer $y Posição vertical canto superior |
|
1891 | 1890 | * @return number Posição vertical final |
1892 | 1891 | */ |
1893 | 1892 | protected function zCompValorServ($x = 0, $y = 0) |
@@ -1985,8 +1984,8 @@ discard block |
||
1985 | 1984 | * zImpostos |
1986 | 1985 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1987 | 1986 | * |
1988 | - * @param number $x Posição horizontal canto esquerdo |
|
1989 | - * @param number $y Posição vertical canto superior |
|
1987 | + * @param integer $x Posição horizontal canto esquerdo |
|
1988 | + * @param integer $y Posição vertical canto superior |
|
1990 | 1989 | * @return number Posição vertical final |
1991 | 1990 | */ |
1992 | 1991 | protected function zImpostos($x = 0, $y = 0) |
@@ -2148,8 +2147,8 @@ discard block |
||
2148 | 2147 | * zDocOrig |
2149 | 2148 | * Monta o campo com os documentos originarios. |
2150 | 2149 | * |
2151 | - * @param number $x Posição horizontal canto esquerdo |
|
2152 | - * @param number $y Posição vertical canto superior |
|
2150 | + * @param integer $x Posição horizontal canto esquerdo |
|
2151 | + * @param integer $y Posição vertical canto superior |
|
2153 | 2152 | * @return number Posição vertical final |
2154 | 2153 | */ |
2155 | 2154 | protected function zDocOrig($x = 0, $y = 0) |
@@ -2342,8 +2341,8 @@ discard block |
||
2342 | 2341 | * zDocOrigContinuacao |
2343 | 2342 | * Monta o campo com os documentos originarios. |
2344 | 2343 | * |
2345 | - * @param number $x Posição horizontal canto esquerdo |
|
2346 | - * @param number $y Posição vertical canto superior |
|
2344 | + * @param integer $x Posição horizontal canto esquerdo |
|
2345 | + * @param integer $y Posição vertical canto superior |
|
2347 | 2346 | * @return number Posição vertical final |
2348 | 2347 | */ |
2349 | 2348 | protected function zDocOrigContinuacao($x = 0, $y = 0) |
@@ -2457,8 +2456,8 @@ discard block |
||
2457 | 2456 | * zDocCompl |
2458 | 2457 | * Monta o campo com os dados do remetente na DACTE. |
2459 | 2458 | * |
2460 | - * @param number $x Posição horizontal canto esquerdo |
|
2461 | - * @param number $y Posição vertical canto superior |
|
2459 | + * @param integer $x Posição horizontal canto esquerdo |
|
2460 | + * @param integer $y Posição vertical canto superior |
|
2462 | 2461 | * @return number Posição vertical final |
2463 | 2462 | */ |
2464 | 2463 | protected function zDocCompl($x = 0, $y = 0) |
@@ -2520,8 +2519,8 @@ discard block |
||
2520 | 2519 | * zObs |
2521 | 2520 | * Monta o campo com os dados do remetente na DACTE. |
2522 | 2521 | * |
2523 | - * @param number $x Posição horizontal canto esquerdo |
|
2524 | - * @param number $y Posição vertical canto superior |
|
2522 | + * @param integer $x Posição horizontal canto esquerdo |
|
2523 | + * @param integer $y Posição vertical canto superior |
|
2525 | 2524 | * @return number Posição vertical final |
2526 | 2525 | */ |
2527 | 2526 | protected function zObs($x = 0, $y = 0) |
@@ -2585,8 +2584,8 @@ discard block |
||
2585 | 2584 | * zModalRod |
2586 | 2585 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2587 | 2586 | * |
2588 | - * @param number $x Posição horizontal canto esquerdo |
|
2589 | - * @param number $y Posição vertical canto superior |
|
2587 | + * @param integer $x Posição horizontal canto esquerdo |
|
2588 | + * @param integer $y Posição vertical canto superior |
|
2590 | 2589 | * @return number Posição vertical final |
2591 | 2590 | */ |
2592 | 2591 | protected function zModalRod($x = 0, $y = 0) |
@@ -2815,8 +2814,8 @@ discard block |
||
2815 | 2814 | * zModalAquaviario |
2816 | 2815 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2817 | 2816 | * |
2818 | - * @param number $x Posição horizontal canto esquerdo |
|
2819 | - * @param number $y Posição vertical canto superior |
|
2817 | + * @param integer $x Posição horizontal canto esquerdo |
|
2818 | + * @param integer $y Posição vertical canto superior |
|
2820 | 2819 | * @return number Posição vertical final |
2821 | 2820 | */ |
2822 | 2821 | protected function zModalAquaviario($x = 0, $y = 0) |
@@ -2985,8 +2984,8 @@ discard block |
||
2985 | 2984 | * zModalFerr |
2986 | 2985 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2987 | 2986 | * |
2988 | - * @param number $x Posição horizontal canto esquerdo |
|
2989 | - * @param number $y Posição vertical canto superior |
|
2987 | + * @param integer $x Posição horizontal canto esquerdo |
|
2988 | + * @param integer $y Posição vertical canto superior |
|
2990 | 2989 | * @return number Posição vertical final |
2991 | 2990 | */ |
2992 | 2991 | protected function zModalFerr($x = 0, $y = 0) |
@@ -3263,8 +3262,8 @@ discard block |
||
3263 | 3262 | * zCanhoto |
3264 | 3263 | * Monta o campo com os dados do remetente na DACTE. |
3265 | 3264 | * |
3266 | - * @param number $x Posição horizontal canto esquerdo |
|
3267 | - * @param number $y Posição vertical canto superior |
|
3265 | + * @param integer $x Posição horizontal canto esquerdo |
|
3266 | + * @param integer $y Posição vertical canto superior |
|
3268 | 3267 | * @return number Posição vertical final |
3269 | 3268 | */ |
3270 | 3269 | protected function zCanhoto($x = 0, $y = 0) |
@@ -3348,9 +3347,10 @@ discard block |
||
3348 | 3347 | * zDadosAdic |
3349 | 3348 | * Coloca o grupo de dados adicionais da DACTE. |
3350 | 3349 | * |
3351 | - * @param number $x Posição horizontal canto esquerdo |
|
3350 | + * @param integer $x Posição horizontal canto esquerdo |
|
3352 | 3351 | * @param number $y Posição vertical canto superior |
3353 | - * @param number $h altura do campo |
|
3352 | + * @param integer $h altura do campo |
|
3353 | + * @param integer $pag |
|
3354 | 3354 | * @return number Posição vertical final |
3355 | 3355 | */ |
3356 | 3356 | protected function zDadosAdic($x, $y, $pag, $h) |
@@ -3431,11 +3431,11 @@ discard block |
||
3431 | 3431 | * zhDashedLine |
3432 | 3432 | * Desenha uma linha horizontal tracejada com o FPDF |
3433 | 3433 | * |
3434 | - * @param number $x Posição horizontal inicial, em mm |
|
3435 | - * @param number $y Posição vertical inicial, em mm |
|
3434 | + * @param integer $x Posição horizontal inicial, em mm |
|
3435 | + * @param integer $y Posição vertical inicial, em mm |
|
3436 | 3436 | * @param number $w Comprimento da linha, em mm |
3437 | - * @param number $h Espessura da linha, em mm |
|
3438 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
3437 | + * @param double $h Espessura da linha, em mm |
|
3438 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
3439 | 3439 | * @return none |
3440 | 3440 | */ |
3441 | 3441 | protected function zhDashedLine($x, $y, $w, $h, $n) |
@@ -3590,7 +3590,7 @@ discard block |
||
3590 | 3590 | * Fornece a imformação multiplicação de peso contida na CTe |
3591 | 3591 | * |
3592 | 3592 | * @param interger $U Informação de peso extraida da CTe |
3593 | - * @return interger |
|
3593 | + * @return integer |
|
3594 | 3594 | */ |
3595 | 3595 | protected function zMultiUniPeso($U = '') |
3596 | 3596 | { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | $x = $xInic; |
428 | 428 | $r = $this->zObs($x, $y); |
429 | - $y = $y-6; |
|
429 | + $y = $y - 6; |
|
430 | 430 | switch ($this->modal) { |
431 | 431 | case '1': |
432 | 432 | $y += 17.9; |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | 'style' => ''); |
874 | 874 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
875 | 875 | //$texto = '1/1'; |
876 | - $texto = $pag."/".$totPag; |
|
876 | + $texto = $pag . "/" . $totPag; |
|
877 | 877 | $aFont = $this->formatNegrito; |
878 | 878 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
879 | 879 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | $this->pdf->SetTextColor(0, 0, 0); |
1076 | 1076 | } |
1077 | 1077 | //indicar sem valor |
1078 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
1078 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
1079 | 1079 | $x = 10; |
1080 | 1080 | if ($this->orientacao == 'P') { |
1081 | 1081 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
1099 | 1099 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1100 | 1100 | $this->pdf->SetTextColor(0, 0, 0); |
1101 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
1101 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
1102 | 1102 | $h = 5; |
1103 | 1103 | $w = $maxW - (2 * 10); |
1104 | 1104 | $x = 55; |
@@ -1116,14 +1116,14 @@ discard block |
||
1116 | 1116 | 'size' => 41, |
1117 | 1117 | 'style' => 'B'); |
1118 | 1118 | $texto = "Sem Validade Jurídica"; |
1119 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1119 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1120 | 1120 | $this->pdf->SetTextColor(90, 90, 90); |
1121 | 1121 | $texto = "SEM VALOR FISCAL"; |
1122 | 1122 | $aFont = array( |
1123 | 1123 | 'font' => $this->fontePadrao, |
1124 | 1124 | 'size' => 48, |
1125 | 1125 | 'style' => 'B'); |
1126 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1126 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1127 | 1127 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
1128 | 1128 | } else { |
1129 | 1129 | $x = 10; |
@@ -1426,8 +1426,7 @@ discard block |
||
1426 | 1426 | $texto = $this->pSimpleGetValue($this->enderExped, "xLgr") . ', '; |
1427 | 1427 | $texto .= $this->pSimpleGetValue($this->enderExped, "nro"); |
1428 | 1428 | $texto .= $this->pSimpleGetValue($this->enderExped, "xCpl") != "" ? |
1429 | - ' - ' . $this->pSimpleGetValue($this->enderExped, "xCpl") : |
|
1430 | - ''; |
|
1429 | + ' - ' . $this->pSimpleGetValue($this->enderExped, "xCpl") : ''; |
|
1431 | 1430 | } else { |
1432 | 1431 | $texto = ''; |
1433 | 1432 | } |
@@ -1523,8 +1522,7 @@ discard block |
||
1523 | 1522 | $texto = $this->pSimpleGetValue($this->enderReceb, "xLgr") . ', '; |
1524 | 1523 | $texto .= $this->pSimpleGetValue($this->enderReceb, "nro"); |
1525 | 1524 | $texto .= ($this->pSimpleGetValue($this->enderReceb, "xCpl") != "") ? |
1526 | - ' - ' . $this->pSimpleGetValue($this->enderReceb, "xCpl") : |
|
1527 | - ''; |
|
1525 | + ' - ' . $this->pSimpleGetValue($this->enderReceb, "xCpl") : ''; |
|
1528 | 1526 | } else { |
1529 | 1527 | $texto = ''; |
1530 | 1528 | } |
@@ -1798,8 +1796,7 @@ discard block |
||
1798 | 1796 | 3, |
1799 | 1797 | ".", |
1800 | 1798 | "" |
1801 | - ) : |
|
1802 | - ''; |
|
1799 | + ) : ''; |
|
1803 | 1800 | $texto = $this->pSimpleGetValue($this->infQ->item(2), "qCarga") == '' ? '' : $texto; |
1804 | 1801 | $texto .= ' ' . $this->zUnidade($this->pSimpleGetValue($this->infQ->item(2), "cUnid")); |
1805 | 1802 | $aFont = array( |
@@ -2015,7 +2012,7 @@ discard block |
||
2015 | 2012 | $aFont = $this->formatPadrao; |
2016 | 2013 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2017 | 2014 | |
2018 | - $wCol02=0.18; |
|
2015 | + $wCol02 = 0.18; |
|
2019 | 2016 | $x += $w * $wCol02; |
2020 | 2017 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
2021 | 2018 | $texto = 'ALÍQ ICMS'; |
@@ -2092,7 +2089,7 @@ discard block |
||
2092 | 2089 | $x += $w * $wCol02; |
2093 | 2090 | |
2094 | 2091 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
2095 | - number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
2092 | + number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
2096 | 2093 | $aFont = $this->formatNegrito; |
2097 | 2094 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2098 | 2095 | |
@@ -2262,13 +2259,13 @@ discard block |
||
2262 | 2259 | $chaveNFe = $this->infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue; |
2263 | 2260 | $this->arrayNFe[] = $chaveNFe; |
2264 | 2261 | } |
2265 | - if (count($this->arrayNFe) >15) { |
|
2262 | + if (count($this->arrayNFe) > 15) { |
|
2266 | 2263 | $this->flagDocOrigContinuacao = 1; |
2267 | 2264 | $totPag = '2'; |
2268 | 2265 | } else { |
2269 | 2266 | $totPag = '1'; |
2270 | 2267 | } |
2271 | - $totPag = count($this->arrayNFe) >15 ? '2' : '1'; |
|
2268 | + $totPag = count($this->arrayNFe) > 15 ? '2' : '1'; |
|
2272 | 2269 | $r = $this->zCabecalho(1, 1, '1', $totPag); |
2273 | 2270 | $contador = 0; |
2274 | 2271 | while ($contador < count($this->arrayNFe)) { |
@@ -2369,9 +2366,9 @@ discard block |
||
2369 | 2366 | //$h = 6 + 3; // de altura do texto (primeira linha |
2370 | 2367 | //$h = 9 + 3.5 ;// segunda linha |
2371 | 2368 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
2372 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
2373 | - if (count($this->arrayNFe)%2 !=0) { |
|
2374 | - $h = $h+3.5; |
|
2369 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
2370 | + if (count($this->arrayNFe) % 2 != 0) { |
|
2371 | + $h = $h + 3.5; |
|
2375 | 2372 | } // Caso tenha apenas 1 registro na ultima linha |
2376 | 2373 | |
2377 | 2374 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
@@ -2632,22 +2629,22 @@ discard block |
||
2632 | 2629 | $x += $w * 0.23; |
2633 | 2630 | |
2634 | 2631 | //$this->pdf->Line($x, $y, $x, $y + 8.5); |
2635 | - $this->pdf->Line($x-20, $y, $x-20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2632 | + $this->pdf->Line($x - 20, $y, $x - 20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2636 | 2633 | $texto = 'CIOT'; |
2637 | 2634 | $aFont = $this->formatPadrao; |
2638 | - $this->pTextBox($x-20, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2635 | + $this->pTextBox($x - 20, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2639 | 2636 | $texto = $this->pSimpleGetValue($this->rodo, "CIOT"); |
2640 | 2637 | $aFont = $this->formatNegrito; |
2641 | - $this->pTextBox($x-20, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2638 | + $this->pTextBox($x - 20, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2642 | 2639 | |
2643 | 2640 | //$this->pdf->Line($x, $y, $x, $y + 8.5); |
2644 | - $this->pdf->Line($x+10, $y, $x+10, $y + 8.5); // LINHA A FRENTE DO CIOT |
|
2641 | + $this->pdf->Line($x + 10, $y, $x + 10, $y + 8.5); // LINHA A FRENTE DO CIOT |
|
2645 | 2642 | $texto = 'LOTAÇÃO'; |
2646 | 2643 | $aFont = $this->formatPadrao; |
2647 | - $this->pTextBox($x+10, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2644 | + $this->pTextBox($x + 10, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2648 | 2645 | $texto = $lotacao; |
2649 | 2646 | $aFont = $this->formatNegrito; |
2650 | - $this->pTextBox($x+10, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2647 | + $this->pTextBox($x + 10, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2651 | 2648 | |
2652 | 2649 | $x += $w * 0.13; |
2653 | 2650 | $this->pdf->Line($x, $y, $x, $y + 8.5); |
@@ -2771,7 +2768,7 @@ discard block |
||
2771 | 2768 | 'style' => ''); |
2772 | 2769 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2773 | 2770 | //$texto = !empty($this->moto) ? $this->pSimpleGetValue($this->moto, "CPF") : ''; // CPF SEM MASCARA |
2774 | - $texto = !empty($this->moto) ? $this->zFormatCNPJCPF($this->moto) : ''; // CPF COM MASCARA |
|
2771 | + $texto = !empty($this->moto) ? $this->zFormatCNPJCPF($this->moto) : ''; // CPF COM MASCARA |
|
2775 | 2772 | $aFont = array( |
2776 | 2773 | 'font' => $this->fontePadrao, |
2777 | 2774 | 'size' => 7, |
@@ -3276,7 +3273,7 @@ discard block |
||
3276 | 3273 | */ |
3277 | 3274 | protected function zCanhoto($x = 0, $y = 0) |
3278 | 3275 | { |
3279 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
3276 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
3280 | 3277 | $y = $y + 2; |
3281 | 3278 | $oldX = $x; |
3282 | 3279 | $oldY = $y; |
@@ -3315,7 +3312,7 @@ discard block |
||
3315 | 3312 | |
3316 | 3313 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
3317 | 3314 | |
3318 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
3315 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
3319 | 3316 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
3320 | 3317 | $aFont = array( |
3321 | 3318 | 'font' => $this->fontePadrao, |
@@ -3325,14 +3322,14 @@ discard block |
||
3325 | 3322 | $x = $oldX; |
3326 | 3323 | $y = $y + 5; |
3327 | 3324 | |
3328 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3325 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3329 | 3326 | |
3330 | 3327 | $texto = 'RG'; |
3331 | 3328 | $aFont = array( |
3332 | 3329 | 'font' => $this->fontePadrao, |
3333 | 3330 | 'size' => 6, |
3334 | 3331 | 'style' => ''); |
3335 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3332 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3336 | 3333 | $x += $w * 0.85; |
3337 | 3334 | |
3338 | 3335 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -137,7 +137,6 @@ |
||
137 | 137 | /** |
138 | 138 | * listDir |
139 | 139 | * Obtem todo o conteúdo de um diretorio, e que atendam ao critério indicado. |
140 | - * @param string $dir Diretorio a ser pesquisado |
|
141 | 140 | * @param string $fileMatch Critério de seleção pode ser usados coringas como *-nfe.xml |
142 | 141 | * @param boolean $retpath se true retorna o path completo dos arquivos se false so retorna o nome dos arquivos |
143 | 142 | * @return array com os nome dos arquivos que atendem ao critério estabelecido ou false |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | class FilesFolders |
19 | 19 | { |
20 | 20 | |
21 | - protected static $ambientes = array('homologacao','producao'); |
|
21 | + protected static $ambientes = array('homologacao', 'producao'); |
|
22 | 22 | protected static $subdirs = array( |
23 | 23 | 'entradas', |
24 | 24 | 'assinadas', |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | . DIRECTORY_SEPARATOR |
70 | 70 | . $subdir; |
71 | 71 | |
72 | - if (! is_dir($path)) { |
|
72 | + if (!is_dir($path)) { |
|
73 | 73 | $msg = "Não existe o diretorio $path !"; |
74 | 74 | throw new RuntimeException($msg); |
75 | 75 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | //monta a arvore de diretórios necessária e estabelece permissões de acesso |
89 | 89 | self::createFolder($dirPath); |
90 | 90 | foreach (self::$ambientes as $ambiente) { |
91 | - $folder = $dirPath.DIRECTORY_SEPARATOR.$ambiente; |
|
91 | + $folder = $dirPath . DIRECTORY_SEPARATOR . $ambiente; |
|
92 | 92 | self::createFolder($folder); |
93 | 93 | foreach (self::$subdirs as $subdir) { |
94 | - $folder = $dirPath.DIRECTORY_SEPARATOR.$ambiente.DIRECTORY_SEPARATOR.$subdir; |
|
94 | + $folder = $dirPath . DIRECTORY_SEPARATOR . $ambiente . DIRECTORY_SEPARATOR . $subdir; |
|
95 | 95 | self::createFolder($folder); |
96 | 96 | } |
97 | 97 | } |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public static function createFolder($folder = '') |
107 | 107 | { |
108 | - if (! is_dir($folder)) { |
|
109 | - if (! mkdir($folder, 0777, true)) { |
|
108 | + if (!is_dir($folder)) { |
|
109 | + if (!mkdir($folder, 0777, true)) { |
|
110 | 110 | throw new RuntimeException( |
111 | 111 | "Não foi possivel criar o diretorio $folder. Verifique as permissões" |
112 | 112 | ); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | public static function saveFile($path = '', $filename = '', $content = '') |
125 | 125 | { |
126 | 126 | self::createFolder($path); |
127 | - $filePath = $path.DIRECTORY_SEPARATOR.$filename; |
|
128 | - if (! file_put_contents($filePath, $content)) { |
|
127 | + $filePath = $path . DIRECTORY_SEPARATOR . $filename; |
|
128 | + if (!file_put_contents($filePath, $content)) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | - if (! chmod($filePath, 0777)) { |
|
131 | + if (!chmod($filePath, 0777)) { |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | return true; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | "É necessário passar os parametros diretório e filtro!!!" |
151 | 151 | ); |
152 | 152 | } |
153 | - if (! is_dir($folder)) { |
|
153 | + if (!is_dir($folder)) { |
|
154 | 154 | throw new InvalidArgumentException( |
155 | 155 | "O diretório não existe $folder !!!" |
156 | 156 | ); |
@@ -158,15 +158,15 @@ discard block |
||
158 | 158 | $aList = array(); |
159 | 159 | $search = $folder; |
160 | 160 | if (substr($folder, -1) == DIRECTORY_SEPARATOR) { |
161 | - $search = substr($folder, 0, strlen($folder)-1); |
|
161 | + $search = substr($folder, 0, strlen($folder) - 1); |
|
162 | 162 | } |
163 | - $searchmatch = $search.DIRECTORY_SEPARATOR.$fileMatch; |
|
163 | + $searchmatch = $search . DIRECTORY_SEPARATOR . $fileMatch; |
|
164 | 164 | $aGlob = glob($searchmatch); |
165 | 165 | $aList = $aGlob; |
166 | - if (! $retpath && ! empty($aGlob)) { |
|
166 | + if (!$retpath && !empty($aGlob)) { |
|
167 | 167 | $aList = array(); |
168 | 168 | foreach ($aGlob as $pathFile) { |
169 | - $aList[] = str_replace($search.DIRECTORY_SEPARATOR, '', $pathFile); |
|
169 | + $aList[] = str_replace($search . DIRECTORY_SEPARATOR, '', $pathFile); |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | return $aList; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $comentDir = 'O diretório NÃO EXISTE'; |
188 | 188 | $corDir = $cRed; |
189 | 189 | if (is_dir($path)) { |
190 | - $filen = $path.DIRECTORY_SEPARATOR.'teste.txt'; |
|
190 | + $filen = $path . DIRECTORY_SEPARATOR . 'teste.txt'; |
|
191 | 191 | $comentDir = ' Sem permissão !!'; |
192 | 192 | if (file_put_contents($filen, "teste\r\n")) { |
193 | 193 | $corDir = $cGreen; |
@@ -213,19 +213,19 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public static function removeFolder($dirPath) |
215 | 215 | { |
216 | - $files = array_diff(scandir($dirPath), array('.','..')); |
|
216 | + $files = array_diff(scandir($dirPath), array('.', '..')); |
|
217 | 217 | foreach ($files as $file) { |
218 | 218 | if (is_dir("$dirPath/$file")) { |
219 | 219 | self::removeFolder("$dirPath/$file"); |
220 | 220 | } else { |
221 | - if (! unlink("$dirPath/$file")) { |
|
221 | + if (!unlink("$dirPath/$file")) { |
|
222 | 222 | throw new RuntimeException( |
223 | 223 | "Falha! sem permissão de exclusão do arquivo $dirPath/$file" |
224 | 224 | ); |
225 | 225 | } |
226 | 226 | } |
227 | 227 | } |
228 | - if (! rmdir($dirPath)) { |
|
228 | + if (!rmdir($dirPath)) { |
|
229 | 229 | $msg = "Falha! sem permissão de exclusão do diretório $dirPath"; |
230 | 230 | throw new RuntimeException($msg); |
231 | 231 | } |
@@ -245,11 +245,11 @@ discard block |
||
245 | 245 | $msg = "Um caminho para o arquivo deve ser passado!!"; |
246 | 246 | throw new InvalidArgumentException($msg); |
247 | 247 | } |
248 | - if (! is_file($pathFile)) { |
|
248 | + if (!is_file($pathFile)) { |
|
249 | 249 | $msg = "O arquivo indicado não foi localizado!! $pathFile"; |
250 | 250 | throw new InvalidArgumentException($msg); |
251 | 251 | } |
252 | - if (! is_readable($pathFile)) { |
|
252 | + if (!is_readable($pathFile)) { |
|
253 | 253 | $msg = "O arquivo indicado não pode ser lido. Permissões!! $pathFile"; |
254 | 254 | throw new RuntimeException($msg); |
255 | 255 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @param string $sDestino Destino do PDF I-browser D-download S-string F-salva |
73 | 73 | * @param array $aEnd array com o endereço do emitente |
74 | 74 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
75 | - * @param string $fonteDANFE Nome da fonte alternativa do DAnfe |
|
76 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
75 | + * @param string $fontePDF Nome da fonte alternativa do DAnfe |
|
76 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
77 | 77 | */ |
78 | 78 | public function __construct( |
79 | 79 | $docXML = '', |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | |
229 | 229 | /** |
230 | 230 | * Monta o cabeçalho |
231 | - * @param number $x |
|
232 | - * @param number $y |
|
233 | - * @param number $pag |
|
231 | + * @param integer $x |
|
232 | + * @param integer $y |
|
233 | + * @param integer $pag |
|
234 | 234 | * @return number |
235 | 235 | */ |
236 | 236 | private function pHeader($x, $y, $pag) |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | |
418 | 418 | /** |
419 | 419 | * Monta o corpo da pagina |
420 | - * @param number $x |
|
421 | - * @param number $y |
|
420 | + * @param integer $x |
|
421 | + * @param double $y |
|
422 | 422 | */ |
423 | 423 | private function pBody($x, $y) |
424 | 424 | { |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | /** |
471 | 471 | * Monta o rodapé |
472 | - * @param number $x |
|
472 | + * @param integer $x |
|
473 | 473 | * @param number $y |
474 | 474 | */ |
475 | 475 | protected function pFooter($x, $y) |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | $tw = $w; |
302 | 302 | } |
303 | 303 | // Nome emitente |
304 | - $aFont = ['font' => $this->fontePadrao,'size' => 12,'style' => 'B']; |
|
304 | + $aFont = ['font' => $this->fontePadrao, 'size' => 12, 'style' => 'B']; |
|
305 | 305 | $texto = $this->aEnd['razao']; |
306 | 306 | $this->pTextBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
307 | 307 | // endereço |
308 | 308 | $y1 = $y1 + 6; |
309 | - $aFont = ['font' => $this->fontePadrao,'size' => 8,'style' => '']; |
|
309 | + $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => '']; |
|
310 | 310 | $lgr = $this->aEnd['logradouro']; |
311 | 311 | $nro = $this->aEnd['numero']; |
312 | 312 | $cpl = $this->aEnd['complemento']; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $x += $w; |
337 | 337 | $this->pTextBox($x, $y, $w2, $h); |
338 | 338 | $y1 = $y + $h; |
339 | - $aFont = ['font' => $this->fontePadrao,'size' => 16,'style' => 'B']; |
|
339 | + $aFont = ['font' => $this->fontePadrao, 'size' => 16, 'style' => 'B']; |
|
340 | 340 | $this->pTextBox($x, $y + 2, $w2, 8, 'Representação Gráfica de CC-e', $aFont, 'T', 'C', 0, ''); |
341 | 341 | $aFont = array( |
342 | 342 | 'font' => $this->fontePadrao, |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | ); |
346 | 346 | $this->pTextBox($x, $y + 7, $w2, 8, '(Carta de Correção Eletrônica)', $aFont, 'T', 'C', 0, ''); |
347 | 347 | $texto = 'ID do Evento: ' . $this->id; |
348 | - $aFont = ['font' => $this->fontePadrao,'size' => 10,'style' => '']; |
|
348 | + $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => '']; |
|
349 | 349 | $this->pTextBox($x, $y + 15, $w2, 8, $texto, $aFont, 'T', 'L', 0, ''); |
350 | 350 | $tsHora = $this->pConvertTime($this->dhEvento); |
351 | 351 | $texto = 'Criado em : ' . date('d/m/Y H:i:s', $tsHora); |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | $x = $oldX; |
358 | 358 | $this->pTextBox($x, $y1, $maxW, 40); |
359 | 359 | $sY = $y1 + 40; |
360 | - $texto = 'De acordo com as determinações legais vigentes, vimos por meio desta comunicar-lhe'. |
|
360 | + $texto = 'De acordo com as determinações legais vigentes, vimos por meio desta comunicar-lhe' . |
|
361 | 361 | ' que a Nota Fiscal, abaixo referenciada, contêm irregularidades que estão destacadas e' . |
362 | - ' suas respectivas correções, solicitamos que sejam aplicadas essas correções ao executar'. |
|
362 | + ' suas respectivas correções, solicitamos que sejam aplicadas essas correções ao executar' . |
|
363 | 363 | ' seus lançamentos fiscais.'; |
364 | 364 | $aFont = array( |
365 | 365 | 'font' => $this->fontePadrao, |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
100 | 100 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
101 | 101 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
102 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
102 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
103 | 103 | * @param string $preVisualizar 0-Não 1-Sim |
104 | 104 | */ |
105 | 105 | public function __construct( |
@@ -536,8 +536,8 @@ discard block |
||
536 | 536 | * zCabecalho |
537 | 537 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
538 | 538 | * |
539 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
540 | - * @param number $y Posição vertical inicial, canto superior |
|
539 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
540 | + * @param integer $y Posição vertical inicial, canto superior |
|
541 | 541 | * @param number $pag Número da Página |
542 | 542 | * @param number $totPag Total de páginas |
543 | 543 | * @return number Posição vertical final |
@@ -1199,8 +1199,7 @@ discard block |
||
1199 | 1199 | * rodapeDACTE |
1200 | 1200 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
1201 | 1201 | * |
1202 | - * @param number $xInic Posição horizontal canto esquerdo |
|
1203 | - * @param number $yFinal Posição vertical final para impressão |
|
1202 | + * @param integer $x |
|
1204 | 1203 | */ |
1205 | 1204 | protected function zRodape($x, $y) |
1206 | 1205 | { |
@@ -1223,8 +1222,8 @@ discard block |
||
1223 | 1222 | * zRemetente |
1224 | 1223 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1225 | 1224 | * |
1226 | - * @param number $x Posição horizontal canto esquerdo |
|
1227 | - * @param number $y Posição vertical canto superior |
|
1225 | + * @param integer $x Posição horizontal canto esquerdo |
|
1226 | + * @param integer $y Posição vertical canto superior |
|
1228 | 1227 | * @return number Posição vertical final |
1229 | 1228 | */ |
1230 | 1229 | protected function zRemetente($x = 0, $y = 0) |
@@ -1310,8 +1309,8 @@ discard block |
||
1310 | 1309 | * zDestinatario |
1311 | 1310 | * Monta o campo com os dados do destinatário na DACTE. |
1312 | 1311 | * |
1313 | - * @param number $x Posição horizontal canto esquerdo |
|
1314 | - * @param number $y Posição vertical canto superior |
|
1312 | + * @param integer $x Posição horizontal canto esquerdo |
|
1313 | + * @param integer $y Posição vertical canto superior |
|
1315 | 1314 | * @return number Posição vertical final |
1316 | 1315 | */ |
1317 | 1316 | protected function zDestinatario($x = 0, $y = 0) |
@@ -1396,8 +1395,8 @@ discard block |
||
1396 | 1395 | * zExpedidor |
1397 | 1396 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1398 | 1397 | * |
1399 | - * @param number $x Posição horizontal canto esquerdo |
|
1400 | - * @param number $y Posição vertical canto superior |
|
1398 | + * @param integer $x Posição horizontal canto esquerdo |
|
1399 | + * @param integer $y Posição vertical canto superior |
|
1401 | 1400 | * @return number Posição vertical final |
1402 | 1401 | */ |
1403 | 1402 | protected function zExpedidor($x = 0, $y = 0) |
@@ -1493,8 +1492,8 @@ discard block |
||
1493 | 1492 | * zRecebedor |
1494 | 1493 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1495 | 1494 | * |
1496 | - * @param number $x Posição horizontal canto esquerdo |
|
1497 | - * @param number $y Posição vertical canto superior |
|
1495 | + * @param integer $x Posição horizontal canto esquerdo |
|
1496 | + * @param integer $y Posição vertical canto superior |
|
1498 | 1497 | * @return number Posição vertical final |
1499 | 1498 | */ |
1500 | 1499 | protected function zRecebedor($x = 0, $y = 0) |
@@ -1590,8 +1589,8 @@ discard block |
||
1590 | 1589 | * zTomador |
1591 | 1590 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1592 | 1591 | * |
1593 | - * @param number $x Posição horizontal canto esquerdo |
|
1594 | - * @param number $y Posição vertical canto superior |
|
1592 | + * @param integer $x Posição horizontal canto esquerdo |
|
1593 | + * @param integer $y Posição vertical canto superior |
|
1595 | 1594 | * @return number Posição vertical final |
1596 | 1595 | */ |
1597 | 1596 | protected function zTomador($x = 0, $y = 0) |
@@ -1679,8 +1678,8 @@ discard block |
||
1679 | 1678 | * zDescricaoCarga |
1680 | 1679 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1681 | 1680 | * |
1682 | - * @param number $x Posição horizontal canto esquerdo |
|
1683 | - * @param number $y Posição vertical canto superior |
|
1681 | + * @param integer $x Posição horizontal canto esquerdo |
|
1682 | + * @param integer $y Posição vertical canto superior |
|
1684 | 1683 | * @return number Posição vertical final |
1685 | 1684 | */ |
1686 | 1685 | protected function zDescricaoCarga($x = 0, $y = 0) |
@@ -1886,8 +1885,8 @@ discard block |
||
1886 | 1885 | * zCompValorServ |
1887 | 1886 | * Monta o campo com os componentes da prestação de serviços. |
1888 | 1887 | * |
1889 | - * @param number $x Posição horizontal canto esquerdo |
|
1890 | - * @param number $y Posição vertical canto superior |
|
1888 | + * @param integer $x Posição horizontal canto esquerdo |
|
1889 | + * @param integer $y Posição vertical canto superior |
|
1891 | 1890 | * @return number Posição vertical final |
1892 | 1891 | */ |
1893 | 1892 | protected function zCompValorServ($x = 0, $y = 0) |
@@ -1985,8 +1984,8 @@ discard block |
||
1985 | 1984 | * zImpostos |
1986 | 1985 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1987 | 1986 | * |
1988 | - * @param number $x Posição horizontal canto esquerdo |
|
1989 | - * @param number $y Posição vertical canto superior |
|
1987 | + * @param integer $x Posição horizontal canto esquerdo |
|
1988 | + * @param integer $y Posição vertical canto superior |
|
1990 | 1989 | * @return number Posição vertical final |
1991 | 1990 | */ |
1992 | 1991 | protected function zImpostos($x = 0, $y = 0) |
@@ -2148,8 +2147,8 @@ discard block |
||
2148 | 2147 | * zDocOrig |
2149 | 2148 | * Monta o campo com os documentos originarios. |
2150 | 2149 | * |
2151 | - * @param number $x Posição horizontal canto esquerdo |
|
2152 | - * @param number $y Posição vertical canto superior |
|
2150 | + * @param integer $x Posição horizontal canto esquerdo |
|
2151 | + * @param integer $y Posição vertical canto superior |
|
2153 | 2152 | * @return number Posição vertical final |
2154 | 2153 | */ |
2155 | 2154 | protected function zDocOrig($x = 0, $y = 0) |
@@ -2342,8 +2341,8 @@ discard block |
||
2342 | 2341 | * zDocOrigContinuacao |
2343 | 2342 | * Monta o campo com os documentos originarios. |
2344 | 2343 | * |
2345 | - * @param number $x Posição horizontal canto esquerdo |
|
2346 | - * @param number $y Posição vertical canto superior |
|
2344 | + * @param integer $x Posição horizontal canto esquerdo |
|
2345 | + * @param integer $y Posição vertical canto superior |
|
2347 | 2346 | * @return number Posição vertical final |
2348 | 2347 | */ |
2349 | 2348 | protected function zDocOrigContinuacao($x = 0, $y = 0) |
@@ -2457,8 +2456,8 @@ discard block |
||
2457 | 2456 | * zDocCompl |
2458 | 2457 | * Monta o campo com os dados do remetente na DACTE. |
2459 | 2458 | * |
2460 | - * @param number $x Posição horizontal canto esquerdo |
|
2461 | - * @param number $y Posição vertical canto superior |
|
2459 | + * @param integer $x Posição horizontal canto esquerdo |
|
2460 | + * @param integer $y Posição vertical canto superior |
|
2462 | 2461 | * @return number Posição vertical final |
2463 | 2462 | */ |
2464 | 2463 | protected function zDocCompl($x = 0, $y = 0) |
@@ -2520,8 +2519,8 @@ discard block |
||
2520 | 2519 | * zObs |
2521 | 2520 | * Monta o campo com os dados do remetente na DACTE. |
2522 | 2521 | * |
2523 | - * @param number $x Posição horizontal canto esquerdo |
|
2524 | - * @param number $y Posição vertical canto superior |
|
2522 | + * @param integer $x Posição horizontal canto esquerdo |
|
2523 | + * @param integer $y Posição vertical canto superior |
|
2525 | 2524 | * @return number Posição vertical final |
2526 | 2525 | */ |
2527 | 2526 | protected function zObs($x = 0, $y = 0) |
@@ -2585,8 +2584,8 @@ discard block |
||
2585 | 2584 | * zModalRod |
2586 | 2585 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2587 | 2586 | * |
2588 | - * @param number $x Posição horizontal canto esquerdo |
|
2589 | - * @param number $y Posição vertical canto superior |
|
2587 | + * @param integer $x Posição horizontal canto esquerdo |
|
2588 | + * @param integer $y Posição vertical canto superior |
|
2590 | 2589 | * @return number Posição vertical final |
2591 | 2590 | */ |
2592 | 2591 | protected function zModalRod($x = 0, $y = 0) |
@@ -2815,8 +2814,8 @@ discard block |
||
2815 | 2814 | * zModalAquaviario |
2816 | 2815 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2817 | 2816 | * |
2818 | - * @param number $x Posição horizontal canto esquerdo |
|
2819 | - * @param number $y Posição vertical canto superior |
|
2817 | + * @param integer $x Posição horizontal canto esquerdo |
|
2818 | + * @param integer $y Posição vertical canto superior |
|
2820 | 2819 | * @return number Posição vertical final |
2821 | 2820 | */ |
2822 | 2821 | protected function zModalAquaviario($x = 0, $y = 0) |
@@ -2985,8 +2984,8 @@ discard block |
||
2985 | 2984 | * zModalFerr |
2986 | 2985 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
2987 | 2986 | * |
2988 | - * @param number $x Posição horizontal canto esquerdo |
|
2989 | - * @param number $y Posição vertical canto superior |
|
2987 | + * @param integer $x Posição horizontal canto esquerdo |
|
2988 | + * @param integer $y Posição vertical canto superior |
|
2990 | 2989 | * @return number Posição vertical final |
2991 | 2990 | */ |
2992 | 2991 | protected function zModalFerr($x = 0, $y = 0) |
@@ -3263,8 +3262,8 @@ discard block |
||
3263 | 3262 | * zCanhoto |
3264 | 3263 | * Monta o campo com os dados do remetente na DACTE. |
3265 | 3264 | * |
3266 | - * @param number $x Posição horizontal canto esquerdo |
|
3267 | - * @param number $y Posição vertical canto superior |
|
3265 | + * @param integer $x Posição horizontal canto esquerdo |
|
3266 | + * @param integer $y Posição vertical canto superior |
|
3268 | 3267 | * @return number Posição vertical final |
3269 | 3268 | */ |
3270 | 3269 | protected function zCanhoto($x = 0, $y = 0) |
@@ -3348,9 +3347,10 @@ discard block |
||
3348 | 3347 | * zDadosAdic |
3349 | 3348 | * Coloca o grupo de dados adicionais da DACTE. |
3350 | 3349 | * |
3351 | - * @param number $x Posição horizontal canto esquerdo |
|
3350 | + * @param integer $x Posição horizontal canto esquerdo |
|
3352 | 3351 | * @param number $y Posição vertical canto superior |
3353 | - * @param number $h altura do campo |
|
3352 | + * @param integer $h altura do campo |
|
3353 | + * @param integer $pag |
|
3354 | 3354 | * @return number Posição vertical final |
3355 | 3355 | */ |
3356 | 3356 | protected function zDadosAdic($x, $y, $pag, $h) |
@@ -3431,11 +3431,11 @@ discard block |
||
3431 | 3431 | * zhDashedLine |
3432 | 3432 | * Desenha uma linha horizontal tracejada com o FPDF |
3433 | 3433 | * |
3434 | - * @param number $x Posição horizontal inicial, em mm |
|
3435 | - * @param number $y Posição vertical inicial, em mm |
|
3434 | + * @param integer $x Posição horizontal inicial, em mm |
|
3435 | + * @param integer $y Posição vertical inicial, em mm |
|
3436 | 3436 | * @param number $w Comprimento da linha, em mm |
3437 | - * @param number $h Espessura da linha, em mm |
|
3438 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
3437 | + * @param double $h Espessura da linha, em mm |
|
3438 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
3439 | 3439 | * @return none |
3440 | 3440 | */ |
3441 | 3441 | protected function zhDashedLine($x, $y, $w, $h, $n) |
@@ -3590,7 +3590,7 @@ discard block |
||
3590 | 3590 | * Fornece a imformação multiplicação de peso contida na CTe |
3591 | 3591 | * |
3592 | 3592 | * @param interger $U Informação de peso extraida da CTe |
3593 | - * @return interger |
|
3593 | + * @return integer |
|
3594 | 3594 | */ |
3595 | 3595 | protected function zMultiUniPeso($U = '') |
3596 | 3596 | { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | $x = $xInic; |
443 | 443 | $r = $this->zObs($x, $y); |
444 | - $y = $y-6; |
|
444 | + $y = $y - 6; |
|
445 | 445 | switch ($this->modal) { |
446 | 446 | case '1': |
447 | 447 | $y += 25.9; |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | 'font' => $this->fontePadrao, |
644 | 644 | 'size' => 7, |
645 | 645 | 'style' => ''); |
646 | - $fone = $this->pSimpleGetValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
646 | + $fone = $this->pSimpleGetValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
647 | 647 | $lgr = $this->pSimpleGetValue($this->enderEmit, "xLgr"); |
648 | 648 | $nro = $this->pSimpleGetValue($this->enderEmit, "nro"); |
649 | 649 | $cpl = $this->pSimpleGetValue($this->enderEmit, "xCpl"); |
@@ -736,31 +736,31 @@ discard block |
||
736 | 736 | $this->pdf->Line($x, $y1 + 8, $w + 3, $y1 + 8); |
737 | 737 | $toma = $this->pSimpleGetValue($this->ide, "indGlobalizado"); |
738 | 738 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros |
739 | - if ($toma==1) { |
|
739 | + if ($toma == 1) { |
|
740 | 740 | $aFont = array( |
741 | 741 | 'font' => $this->fontePadrao, |
742 | 742 | 'size' => 11, |
743 | 743 | 'style' => ''); |
744 | - $this->pTextBox($x-14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
744 | + $this->pTextBox($x - 14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
745 | 745 | } else { |
746 | 746 | $aFont = array( |
747 | 747 | 'font' => $this->fontePadrao, |
748 | 748 | 'size' => 11, |
749 | 749 | 'style' => ''); |
750 | - $this->pTextBox($x+3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
750 | + $this->pTextBox($x + 3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
751 | 751 | } |
752 | 752 | $aFont = $this->formatNegrito; |
753 | - $this->pdf->Line($x+5, $x+48, $x+5, $x+52); |
|
754 | - $this->pdf->Line($x+10, $x+48, $x+10, $x+52); |
|
755 | - $this->pdf->Line($x+5, $x+48, $x+10, $x+48); |
|
756 | - $this->pdf->Line($x+5, $x+52, $x+10, $x+52); |
|
757 | - $this->pTextBox($x-9, $y2+1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
753 | + $this->pdf->Line($x + 5, $x + 48, $x + 5, $x + 52); |
|
754 | + $this->pdf->Line($x + 10, $x + 48, $x + 10, $x + 52); |
|
755 | + $this->pdf->Line($x + 5, $x + 48, $x + 10, $x + 48); |
|
756 | + $this->pdf->Line($x + 5, $x + 52, $x + 10, $x + 52); |
|
757 | + $this->pTextBox($x - 9, $y2 + 1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
758 | 758 | |
759 | - $this->pdf->Line($x+23, $x+48, $x+23, $x+52); |
|
760 | - $this->pdf->Line($x+28, $x+48, $x+28, $x+52); |
|
761 | - $this->pdf->Line($x+23, $x+48, $x+28, $x+48); |
|
762 | - $this->pdf->Line($x+23, $x+52, $x+28, $x+52); |
|
763 | - $this->pTextBox($x+9.8, $y2+1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
759 | + $this->pdf->Line($x + 23, $x + 48, $x + 23, $x + 52); |
|
760 | + $this->pdf->Line($x + 28, $x + 48, $x + 28, $x + 52); |
|
761 | + $this->pdf->Line($x + 23, $x + 48, $x + 28, $x + 48); |
|
762 | + $this->pdf->Line($x + 23, $x + 52, $x + 28, $x + 52); |
|
763 | + $this->pTextBox($x + 9.8, $y2 + 1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
764 | 764 | |
765 | 765 | //FORMA DE PAGAMENTO |
766 | 766 | $texto = 'NFORMAÇÕES DO CT-E GLOBALIZADO'; |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | 'font' => $this->fontePadrao, |
770 | 770 | 'size' => 8, |
771 | 771 | 'style' => ''); |
772 | - $this->pTextBox($x+2 + $wa + 4.5, $y2-0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
772 | + $this->pTextBox($x + 2 + $wa + 4.5, $y2 - 0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
773 | 773 | $forma = $this->pSimpleGetValue($this->ide, "forPag"); |
774 | 774 | //################################################################## |
775 | 775 | //coluna direita |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | 'style' => ''); |
878 | 878 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
879 | 879 | //$texto = '1/1'; |
880 | - $texto = $pag."/".$totPag; |
|
880 | + $texto = $pag . "/" . $totPag; |
|
881 | 881 | $aFont = $this->formatNegrito; |
882 | 882 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
883 | 883 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | $this->pdf->SetTextColor(0, 0, 0); |
1080 | 1080 | } |
1081 | 1081 | //indicar sem valor |
1082 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
1082 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
1083 | 1083 | $x = 10; |
1084 | 1084 | if ($this->orientacao == 'P') { |
1085 | 1085 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
1103 | 1103 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
1104 | 1104 | $this->pdf->SetTextColor(0, 0, 0); |
1105 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
1105 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
1106 | 1106 | $h = 5; |
1107 | 1107 | $w = $maxW - (2 * 10); |
1108 | 1108 | $x = 55; |
@@ -1120,14 +1120,14 @@ discard block |
||
1120 | 1120 | 'size' => 41, |
1121 | 1121 | 'style' => 'B'); |
1122 | 1122 | $texto = "Sem Validade Jurídica"; |
1123 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1123 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1124 | 1124 | $this->pdf->SetTextColor(90, 90, 90); |
1125 | 1125 | $texto = "SEM VALOR FISCAL"; |
1126 | 1126 | $aFont = array( |
1127 | 1127 | 'font' => $this->fontePadrao, |
1128 | 1128 | 'size' => 48, |
1129 | 1129 | 'style' => 'B'); |
1130 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1130 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1131 | 1131 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
1132 | 1132 | } else { |
1133 | 1133 | $x = 10; |
@@ -1213,13 +1213,13 @@ discard block |
||
1213 | 1213 | 'font' => $this->fontePadrao, |
1214 | 1214 | 'size' => 6, |
1215 | 1215 | 'style' => ''); |
1216 | - $this->pTextBox($x-1, $y+2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1217 | - $texto = $this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
1216 | + $this->pTextBox($x - 1, $y + 2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1217 | + $texto = $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
1218 | 1218 | $aFont = array( |
1219 | 1219 | 'font' => $this->fontePadrao, |
1220 | 1220 | 'size' => 6, |
1221 | 1221 | 'style' => ''); |
1222 | - $this->pTextBox($x-50, $y+2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1222 | + $this->pTextBox($x - 50, $y + 2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1223 | 1223 | } //fim zRodape |
1224 | 1224 | |
1225 | 1225 | /** |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | $aFont = $this->formatPadrao; |
1306 | 1306 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1307 | 1307 | //$texto = $this->zFormatFone($this->rem); |
1308 | - $texto = $this->pSimpleGetValue($this->rem, "fone")!=""? $this->zFormatFone($this->rem):''; |
|
1308 | + $texto = $this->pSimpleGetValue($this->rem, "fone") != "" ? $this->zFormatFone($this->rem) : ''; |
|
1309 | 1309 | $aFont = $this->formatNegrito; |
1310 | 1310 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1311 | 1311 | } //fim da função remetenteDACTE |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | $aFont = $this->formatPadrao; |
1393 | 1393 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1394 | 1394 | //$texto = $this->zFormatFone($this->dest); |
1395 | - $texto = $this->pSimpleGetValue($this->dest, "fone")!=""? $this->zFormatFone($this->dest):''; |
|
1395 | + $texto = $this->pSimpleGetValue($this->dest, "fone") != "" ? $this->zFormatFone($this->dest) : ''; |
|
1396 | 1396 | $aFont = $this->formatNegrito; |
1397 | 1397 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1398 | 1398 | } //fim da função destinatarioDACTE |
@@ -1432,8 +1432,7 @@ discard block |
||
1432 | 1432 | $texto = $this->pSimpleGetValue($this->enderExped, "xLgr") . ', '; |
1433 | 1433 | $texto .= $this->pSimpleGetValue($this->enderExped, "nro"); |
1434 | 1434 | $texto .= $this->pSimpleGetValue($this->enderExped, "xCpl") != "" ? |
1435 | - ' - ' . $this->pSimpleGetValue($this->enderExped, "xCpl") : |
|
1436 | - ''; |
|
1435 | + ' - ' . $this->pSimpleGetValue($this->enderExped, "xCpl") : ''; |
|
1437 | 1436 | } else { |
1438 | 1437 | $texto = ''; |
1439 | 1438 | } |
@@ -1488,7 +1487,7 @@ discard block |
||
1488 | 1487 | $aFont = $this->formatPadrao; |
1489 | 1488 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1490 | 1489 | if (isset($this->exped)) { |
1491 | - $texto = $this->pSimpleGetValue($this->exped, "fone")!=""? $this->zFormatFone($this->exped):''; |
|
1490 | + $texto = $this->pSimpleGetValue($this->exped, "fone") != "" ? $this->zFormatFone($this->exped) : ''; |
|
1492 | 1491 | $aFont = $this->formatNegrito; |
1493 | 1492 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1494 | 1493 | } |
@@ -1529,8 +1528,7 @@ discard block |
||
1529 | 1528 | $texto = $this->pSimpleGetValue($this->enderReceb, "xLgr") . ', '; |
1530 | 1529 | $texto .= $this->pSimpleGetValue($this->enderReceb, "nro"); |
1531 | 1530 | $texto .= ($this->pSimpleGetValue($this->enderReceb, "xCpl") != "") ? |
1532 | - ' - ' . $this->pSimpleGetValue($this->enderReceb, "xCpl") : |
|
1533 | - ''; |
|
1531 | + ' - ' . $this->pSimpleGetValue($this->enderReceb, "xCpl") : ''; |
|
1534 | 1532 | } else { |
1535 | 1533 | $texto = ''; |
1536 | 1534 | } |
@@ -1585,7 +1583,7 @@ discard block |
||
1585 | 1583 | $aFont = $this->formatPadrao; |
1586 | 1584 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1587 | 1585 | if (isset($this->receb)) { |
1588 | - $texto = $this->pSimpleGetValue($this->receb, "fone")!=""? $this->zFormatFone($this->receb):''; |
|
1586 | + $texto = $this->pSimpleGetValue($this->receb, "fone") != "" ? $this->zFormatFone($this->receb) : ''; |
|
1589 | 1587 | $aFont = $this->formatNegrito; |
1590 | 1588 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1591 | 1589 | } |
@@ -1675,7 +1673,7 @@ discard block |
||
1675 | 1673 | $texto = 'FONE'; |
1676 | 1674 | $aFont = $this->formatPadrao; |
1677 | 1675 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1678 | - $texto = $this->pSimpleGetValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
1676 | + $texto = $this->pSimpleGetValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
1679 | 1677 | $aFont = $this->formatNegrito; |
1680 | 1678 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1681 | 1679 | } //fim da função tomadorDACTE |
@@ -1734,7 +1732,7 @@ discard block |
||
1734 | 1732 | 'font' => $this->fontePadrao, |
1735 | 1733 | 'size' => 5, |
1736 | 1734 | 'style' => ''); |
1737 | - $this->pTextBox($x+8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1735 | + $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1738 | 1736 | //$texto = $this->pSimpleGetValue($this->infQ->item(0), "qCarga") . "\r\n"; |
1739 | 1737 | $texto = number_format( |
1740 | 1738 | $this->pSimpleGetValue( |
@@ -1750,15 +1748,15 @@ discard block |
||
1750 | 1748 | 'font' => $this->fontePadrao, |
1751 | 1749 | 'size' => 7, |
1752 | 1750 | 'style' => 'B'); |
1753 | - $this->pTextBox($x+2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1751 | + $this->pTextBox($x + 2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1754 | 1752 | $x = $w * 0.12; |
1755 | - $this->pdf->Line($x+13.5, $y, $x+13.5, $y + 9); |
|
1753 | + $this->pdf->Line($x + 13.5, $y, $x + 13.5, $y + 9); |
|
1756 | 1754 | $texto = 'PESO BASE CÁLCULO (KG)'; |
1757 | 1755 | $aFont = array( |
1758 | 1756 | 'font' => $this->fontePadrao, |
1759 | 1757 | 'size' => 5, |
1760 | 1758 | 'style' => ''); |
1761 | - $this->pTextBox($x+20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1759 | + $this->pTextBox($x + 20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1762 | 1760 | $texto = number_format( |
1763 | 1761 | $this->pSimpleGetValue( |
1764 | 1762 | $this->infQ->item(0), |
@@ -1772,15 +1770,15 @@ discard block |
||
1772 | 1770 | 'font' => $this->fontePadrao, |
1773 | 1771 | 'size' => 7, |
1774 | 1772 | 'style' => 'B'); |
1775 | - $this->pTextBox($x+17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1773 | + $this->pTextBox($x + 17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1776 | 1774 | $x = $w * 0.24; |
1777 | - $this->pdf->Line($x+25, $y, $x+25, $y + 9); |
|
1775 | + $this->pdf->Line($x + 25, $y, $x + 25, $y + 9); |
|
1778 | 1776 | $texto = 'PESO AFERIDO (KG)'; |
1779 | 1777 | $aFont = array( |
1780 | 1778 | 'font' => $this->fontePadrao, |
1781 | 1779 | 'size' => 5, |
1782 | 1780 | 'style' => ''); |
1783 | - $this->pTextBox($x+35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1781 | + $this->pTextBox($x + 35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1784 | 1782 | $texto = number_format( |
1785 | 1783 | $this->pSimpleGetValue( |
1786 | 1784 | $this->infQ->item(0), |
@@ -1794,12 +1792,12 @@ discard block |
||
1794 | 1792 | 'font' => $this->fontePadrao, |
1795 | 1793 | 'size' => 7, |
1796 | 1794 | 'style' => 'B'); |
1797 | - $this->pTextBox($x+28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1795 | + $this->pTextBox($x + 28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1798 | 1796 | $x = $w * 0.36; |
1799 | - $this->pdf->Line($x+41.3, $y, $x+41.3, $y + 9); |
|
1797 | + $this->pdf->Line($x + 41.3, $y, $x + 41.3, $y + 9); |
|
1800 | 1798 | $texto = 'CUBAGEM(M3)'; |
1801 | 1799 | $aFont = $this->formatPadrao; |
1802 | - $this->pTextBox($x+60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1800 | + $this->pTextBox($x + 60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1803 | 1801 | $qCarga = ''; |
1804 | 1802 | if ($this->pSimpleGetValue($this->infQ->item(0), "cUnid") == '00') { |
1805 | 1803 | $qCarga = $this->pSimpleGetValue($this->infQ->item(0), "qCarga"); |
@@ -1813,12 +1811,12 @@ discard block |
||
1813 | 1811 | 'font' => $this->fontePadrao, |
1814 | 1812 | 'size' => 7, |
1815 | 1813 | 'style' => 'B'); |
1816 | - $this->pTextBox($x+50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1814 | + $this->pTextBox($x + 50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1817 | 1815 | $x = $w * 0.45; |
1818 | 1816 | //$this->pdf->Line($x+37, $y, $x+37, $y + 9); |
1819 | 1817 | $texto = 'QTDE(VOL)'; |
1820 | 1818 | $aFont = $this->formatPadrao; |
1821 | - $this->pTextBox($x+85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1819 | + $this->pTextBox($x + 85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1822 | 1820 | $qCarga = ''; |
1823 | 1821 | if ($this->pSimpleGetValue($this->infQ->item(2), "cUnid") == 03) { |
1824 | 1822 | $qCarga = $this->pSimpleGetValue($this->infQ->item(2), "qCarga"); |
@@ -1830,9 +1828,9 @@ discard block |
||
1830 | 1828 | 'font' => $this->fontePadrao, |
1831 | 1829 | 'size' => 7, |
1832 | 1830 | 'style' => 'B'); |
1833 | - $this->pTextBox($x+85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1831 | + $this->pTextBox($x + 85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
1834 | 1832 | $x = $w * 0.53; |
1835 | - $this->pdf->Line($x+56, $y, $x+56, $y + 9); |
|
1833 | + $this->pdf->Line($x + 56, $y, $x + 56, $y + 9); |
|
1836 | 1834 | /*$texto = 'NOME DA SEGURADORA'; |
1837 | 1835 | $aFont = $this->formatPadrao; |
1838 | 1836 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2011,7 +2009,7 @@ discard block |
||
2011 | 2009 | $aFont = $this->formatPadrao; |
2012 | 2010 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2013 | 2011 | |
2014 | - $wCol02=0.18; |
|
2012 | + $wCol02 = 0.18; |
|
2015 | 2013 | $x += $w * $wCol02; |
2016 | 2014 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
2017 | 2015 | $texto = 'ALÍQ ICMS'; |
@@ -2088,7 +2086,7 @@ discard block |
||
2088 | 2086 | $x += $w * $wCol02; |
2089 | 2087 | |
2090 | 2088 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
2091 | - number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
2089 | + number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
2092 | 2090 | $aFont = $this->formatNegrito; |
2093 | 2091 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2094 | 2092 | |
@@ -2259,7 +2257,7 @@ discard block |
||
2259 | 2257 | $this->arrayNFe[] = $chaveNFe; |
2260 | 2258 | } |
2261 | 2259 | $qtdeNFe = 1; |
2262 | - if (count($this->arrayNFe) >15) { |
|
2260 | + if (count($this->arrayNFe) > 15) { |
|
2263 | 2261 | $this->flagDocOrigContinuacao = 1; |
2264 | 2262 | $qtdeNFe = count($this->arrayNFe); |
2265 | 2263 | } |
@@ -2439,9 +2437,9 @@ discard block |
||
2439 | 2437 | //$h = 6 + 3; // de altura do texto (primeira linha |
2440 | 2438 | //$h = 9 + 3.5 ;// segunda linha |
2441 | 2439 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
2442 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
2443 | - if (count($this->arrayNFe)%2 !=0) { |
|
2444 | - $h = $h+3.5; |
|
2440 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
2441 | + if (count($this->arrayNFe) % 2 != 0) { |
|
2442 | + $h = $h + 3.5; |
|
2445 | 2443 | } // Caso tenha apenas 1 registro na ultima linha |
2446 | 2444 | |
2447 | 2445 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
@@ -2497,7 +2495,7 @@ discard block |
||
2497 | 2495 | $yIniDados += 3; |
2498 | 2496 | |
2499 | 2497 | while ($contador < (count($this->arrayNFe))) { |
2500 | - if ($contador%(116*($i-1)) == 0) { |
|
2498 | + if ($contador % (116 * ($i - 1)) == 0) { |
|
2501 | 2499 | // $contador++; |
2502 | 2500 | break; |
2503 | 2501 | } |
@@ -2632,7 +2630,7 @@ discard block |
||
2632 | 2630 | $texto .= $xObs; |
2633 | 2631 | } |
2634 | 2632 | $textoObs = explode("Motorista:", $texto); |
2635 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
2633 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
2636 | 2634 | $texto .= $this->pSimpleGetValue($this->imp, "infAdFisco", "\r\n"); |
2637 | 2635 | $texto .= $this->zLocalEntrega(); |
2638 | 2636 | $aFont = array( |
@@ -2640,7 +2638,7 @@ discard block |
||
2640 | 2638 | 'size' => 7.5, |
2641 | 2639 | 'style' => ''); |
2642 | 2640 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
2643 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
2641 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
2644 | 2642 | } //fim da função obsDACTE |
2645 | 2643 | |
2646 | 2644 | /** |
@@ -2703,11 +2701,11 @@ discard block |
||
2703 | 2701 | $this->pTextBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2704 | 2702 | $x += $w * 0.23; |
2705 | 2703 | |
2706 | - $this->pdf->Line($x-20, $y, $x-20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2704 | + $this->pdf->Line($x - 20, $y, $x - 20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
2707 | 2705 | |
2708 | 2706 | $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR'; |
2709 | 2707 | $aFont = $this->formatPadrao; |
2710 | - $this->pTextBox($x-20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
2708 | + $this->pTextBox($x - 20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
2711 | 2709 | } //fim da função zModalRod |
2712 | 2710 | |
2713 | 2711 | /** |
@@ -3168,7 +3166,7 @@ discard block |
||
3168 | 3166 | */ |
3169 | 3167 | protected function zCanhoto($x = 0, $y = 0) |
3170 | 3168 | { |
3171 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
3169 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
3172 | 3170 | $y = $y + 2; |
3173 | 3171 | $oldX = $x; |
3174 | 3172 | $oldY = $y; |
@@ -3207,7 +3205,7 @@ discard block |
||
3207 | 3205 | |
3208 | 3206 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
3209 | 3207 | |
3210 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
3208 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
3211 | 3209 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
3212 | 3210 | $aFont = array( |
3213 | 3211 | 'font' => $this->fontePadrao, |
@@ -3217,14 +3215,14 @@ discard block |
||
3217 | 3215 | $x = $oldX; |
3218 | 3216 | $y = $y + 5; |
3219 | 3217 | |
3220 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3218 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
3221 | 3219 | |
3222 | 3220 | $texto = 'RG'; |
3223 | 3221 | $aFont = array( |
3224 | 3222 | 'font' => $this->fontePadrao, |
3225 | 3223 | 'size' => 6, |
3226 | 3224 | 'style' => ''); |
3227 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3225 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
3228 | 3226 | $x += $w * 0.85; |
3229 | 3227 | |
3230 | 3228 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -168,6 +168,9 @@ discard block |
||
168 | 168 | $this->pdfVersion='1.3'; |
169 | 169 | } |
170 | 170 | |
171 | + /** |
|
172 | + * @param integer $right |
|
173 | + */ |
|
171 | 174 | public function setMargins($left, $top, $right = null) |
172 | 175 | { |
173 | 176 | //Set left, top and right margins |
@@ -200,6 +203,9 @@ discard block |
||
200 | 203 | $this->rMargin = $margin; |
201 | 204 | } |
202 | 205 | |
206 | + /** |
|
207 | + * @param boolean $auto |
|
208 | + */ |
|
203 | 209 | public function setAutoPageBreak($auto, $margin = 0) |
204 | 210 | { |
205 | 211 | //Set auto page break mode and triggering margin |
@@ -208,6 +214,9 @@ discard block |
||
208 | 214 | $this->pageBreakTrigger = $this->h-$margin; |
209 | 215 | } |
210 | 216 | |
217 | + /** |
|
218 | + * @param string $zoom |
|
219 | + */ |
|
211 | 220 | public function setDisplayMode($zoom, $layout = 'continuous') |
212 | 221 | { |
213 | 222 | //Set display mode in viewer |
@@ -223,6 +232,9 @@ discard block |
||
223 | 232 | } |
224 | 233 | } |
225 | 234 | |
235 | + /** |
|
236 | + * @param boolean $compress |
|
237 | + */ |
|
226 | 238 | public function setCompression($compress) |
227 | 239 | { |
228 | 240 | //Set page compression |
@@ -284,6 +296,9 @@ discard block |
||
284 | 296 | $this->aliasNbPages=$alias; |
285 | 297 | } |
286 | 298 | |
299 | + /** |
|
300 | + * @param string $msg |
|
301 | + */ |
|
287 | 302 | public function error($msg) |
288 | 303 | { |
289 | 304 | throw new \Exception($msg); |
@@ -400,6 +415,11 @@ discard block |
||
400 | 415 | return $this->page; |
401 | 416 | } |
402 | 417 | |
418 | + /** |
|
419 | + * @param integer $r |
|
420 | + * @param integer $g |
|
421 | + * @param integer $b |
|
422 | + */ |
|
403 | 423 | public function setDrawColor($r, $g = null, $b = null) |
404 | 424 | { |
405 | 425 | //Set color for all stroking operations |
@@ -413,6 +433,11 @@ discard block |
||
413 | 433 | } |
414 | 434 | } |
415 | 435 | |
436 | + /** |
|
437 | + * @param integer $r |
|
438 | + * @param integer $g |
|
439 | + * @param integer $b |
|
440 | + */ |
|
416 | 441 | public function setFillColor($r, $g = null, $b = null) |
417 | 442 | { |
418 | 443 | //Set color for all filling operations |
@@ -427,6 +452,11 @@ discard block |
||
427 | 452 | } |
428 | 453 | } |
429 | 454 | |
455 | + /** |
|
456 | + * @param integer $r |
|
457 | + * @param integer $g |
|
458 | + * @param integer $b |
|
459 | + */ |
|
430 | 460 | public function settextColor($r, $g = null, $b = null) |
431 | 461 | { |
432 | 462 | //Set color for text |
@@ -555,6 +585,9 @@ discard block |
||
555 | 585 | } |
556 | 586 | } |
557 | 587 | |
588 | + /** |
|
589 | + * @param string $family |
|
590 | + */ |
|
558 | 591 | public function setFont($family, $style = '', $size = 0) |
559 | 592 | { |
560 | 593 | //Select a font; size given in points |
@@ -653,6 +686,10 @@ discard block |
||
653 | 686 | $this->links[$link] = array($page, $y); |
654 | 687 | } |
655 | 688 | |
689 | + /** |
|
690 | + * @param double $y |
|
691 | + * @param string $link |
|
692 | + */ |
|
656 | 693 | public function link($x, $y, $w, $h, $link) |
657 | 694 | { |
658 | 695 | //Put a link on the page |
@@ -988,6 +1025,9 @@ discard block |
||
988 | 1025 | } |
989 | 1026 | } |
990 | 1027 | |
1028 | + /** |
|
1029 | + * @param string $file |
|
1030 | + */ |
|
991 | 1031 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
992 | 1032 | { |
993 | 1033 | //Put an image on the page |
@@ -1190,6 +1230,9 @@ discard block |
||
1190 | 1230 | } |
1191 | 1231 | } |
1192 | 1232 | |
1233 | + /** |
|
1234 | + * @param string $format |
|
1235 | + */ |
|
1193 | 1236 | protected function getpageformat($format) |
1194 | 1237 | { |
1195 | 1238 | $format=strtolower($format); |
@@ -1208,6 +1251,10 @@ discard block |
||
1208 | 1251 | return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; |
1209 | 1252 | } |
1210 | 1253 | |
1254 | + /** |
|
1255 | + * @param string $orientation |
|
1256 | + * @param string $format |
|
1257 | + */ |
|
1211 | 1258 | protected function beginPage($orientation, $format) |
1212 | 1259 | { |
1213 | 1260 | $this->page++; |
@@ -1346,6 +1393,9 @@ discard block |
||
1346 | 1393 | return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data); |
1347 | 1394 | } |
1348 | 1395 | |
1396 | + /** |
|
1397 | + * @param string $file |
|
1398 | + */ |
|
1349 | 1399 | protected function parsePNG($file) |
1350 | 1400 | { |
1351 | 1401 | //Extract info from a PNG file |
@@ -6,64 +6,64 @@ discard block |
||
6 | 6 | { |
7 | 7 | const FPDF_VERSION = '1.6'; |
8 | 8 | |
9 | - public $page; //current page number |
|
10 | - public $n; //current object number |
|
11 | - public $offsets; //array of object offsets |
|
12 | - public $buffer; //buffer holding in-memory PDF |
|
13 | - public $pages; //array containing pages |
|
14 | - public $state; //current document state |
|
15 | - public $compress; //compression flag |
|
16 | - public $k; //scale factor (number of points in user unit) |
|
17 | - public $defOrientation; //default orientation |
|
18 | - public $curOrientation; //current orientation |
|
19 | - public $pageFormats; //available page formats |
|
20 | - public $defPageFormat; //default page format |
|
21 | - public $curPageFormat; //current page format |
|
22 | - public $pageSizes; //array storing non-default page sizes |
|
9 | + public $page; //current page number |
|
10 | + public $n; //current object number |
|
11 | + public $offsets; //array of object offsets |
|
12 | + public $buffer; //buffer holding in-memory PDF |
|
13 | + public $pages; //array containing pages |
|
14 | + public $state; //current document state |
|
15 | + public $compress; //compression flag |
|
16 | + public $k; //scale factor (number of points in user unit) |
|
17 | + public $defOrientation; //default orientation |
|
18 | + public $curOrientation; //current orientation |
|
19 | + public $pageFormats; //available page formats |
|
20 | + public $defPageFormat; //default page format |
|
21 | + public $curPageFormat; //current page format |
|
22 | + public $pageSizes; //array storing non-default page sizes |
|
23 | 23 | public $wPt; |
24 | - public $hPt; //dimensions of current page in points |
|
24 | + public $hPt; //dimensions of current page in points |
|
25 | 25 | public $w; |
26 | - public $h; //dimensions of current page in user unit |
|
27 | - public $lMargin; //left margin |
|
28 | - public $tMargin; //top margin |
|
29 | - public $rMargin; //right margin |
|
30 | - public $bMargin; //page break margin |
|
31 | - public $cMargin; //cell margin |
|
26 | + public $h; //dimensions of current page in user unit |
|
27 | + public $lMargin; //left margin |
|
28 | + public $tMargin; //top margin |
|
29 | + public $rMargin; //right margin |
|
30 | + public $bMargin; //page break margin |
|
31 | + public $cMargin; //cell margin |
|
32 | 32 | public $x; |
33 | - public $y; //current position in user unit |
|
34 | - public $lasth; //height of last printed cell |
|
35 | - public $lineWidth; //line width in user unit |
|
36 | - public $coreFonts; //array of standard font names |
|
37 | - public $fonts; //array of used fonts |
|
38 | - public $fontFiles; //array of font files |
|
39 | - public $diffs; //array of encoding differences |
|
40 | - public $fontFamily; //current font family |
|
41 | - public $fontStyle; //current font style |
|
42 | - public $underline; //underlining flag |
|
43 | - public $currentFont; //current font info |
|
44 | - public $fontSizePt; //current font size in points |
|
45 | - public $fontSize; //current font size in user unit |
|
46 | - public $drawColor; //commands for drawing color |
|
47 | - public $fillColor; //commands for filling color |
|
48 | - public $textColor; //commands for text color |
|
49 | - public $colorFlag; //indicates whether fill and text colors are different |
|
50 | - public $ws; //word spacing |
|
51 | - public $images; //array of used images |
|
52 | - public $PageLinks; //array of links in pages |
|
53 | - public $links; //array of internal links |
|
54 | - public $autoPageBreak; //automatic page breaking |
|
55 | - public $pageBreakTrigger; //threshold used to trigger page breaks |
|
56 | - public $inHeader; //flag set when processing header |
|
57 | - public $inFooter; //flag set when processing footer |
|
58 | - public $zoomMode; //zoom display mode |
|
59 | - public $layoutMode; //layout display mode |
|
60 | - public $title; //title |
|
61 | - public $subject; //subject |
|
62 | - public $author; //author |
|
63 | - public $keywords; //keywords |
|
64 | - public $creator; //creator |
|
65 | - public $aliasNbPages; //alias for total number of pages |
|
66 | - public $pdfVersion; //PDF version number |
|
33 | + public $y; //current position in user unit |
|
34 | + public $lasth; //height of last printed cell |
|
35 | + public $lineWidth; //line width in user unit |
|
36 | + public $coreFonts; //array of standard font names |
|
37 | + public $fonts; //array of used fonts |
|
38 | + public $fontFiles; //array of font files |
|
39 | + public $diffs; //array of encoding differences |
|
40 | + public $fontFamily; //current font family |
|
41 | + public $fontStyle; //current font style |
|
42 | + public $underline; //underlining flag |
|
43 | + public $currentFont; //current font info |
|
44 | + public $fontSizePt; //current font size in points |
|
45 | + public $fontSize; //current font size in user unit |
|
46 | + public $drawColor; //commands for drawing color |
|
47 | + public $fillColor; //commands for filling color |
|
48 | + public $textColor; //commands for text color |
|
49 | + public $colorFlag; //indicates whether fill and text colors are different |
|
50 | + public $ws; //word spacing |
|
51 | + public $images; //array of used images |
|
52 | + public $PageLinks; //array of links in pages |
|
53 | + public $links; //array of internal links |
|
54 | + public $autoPageBreak; //automatic page breaking |
|
55 | + public $pageBreakTrigger; //threshold used to trigger page breaks |
|
56 | + public $inHeader; //flag set when processing header |
|
57 | + public $inFooter; //flag set when processing footer |
|
58 | + public $zoomMode; //zoom display mode |
|
59 | + public $layoutMode; //layout display mode |
|
60 | + public $title; //title |
|
61 | + public $subject; //subject |
|
62 | + public $author; //author |
|
63 | + public $keywords; //keywords |
|
64 | + public $creator; //creator |
|
65 | + public $aliasNbPages; //alias for total number of pages |
|
66 | + public $pdfVersion; //PDF version number |
|
67 | 67 | |
68 | 68 | public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4') |
69 | 69 | { |
@@ -114,21 +114,21 @@ discard block |
||
114 | 114 | if ($unit == 'pt') { |
115 | 115 | $this->k = 1; |
116 | 116 | } elseif ($unit == 'mm') { |
117 | - $this->k = 72/25.4; |
|
117 | + $this->k = 72 / 25.4; |
|
118 | 118 | } elseif ($unit == 'cm') { |
119 | - $this->k = 72/2.54; |
|
119 | + $this->k = 72 / 2.54; |
|
120 | 120 | } elseif ($unit == 'in') { |
121 | 121 | $this->k = 72; |
122 | 122 | } else { |
123 | - $this->error('Incorrect unit: '.$unit); |
|
123 | + $this->error('Incorrect unit: ' . $unit); |
|
124 | 124 | } |
125 | 125 | //Page format |
126 | 126 | $this->pageFormats = array( |
127 | - 'a3' => array(841.89,1190.55), |
|
128 | - 'a4' => array(595.28,841.89), |
|
129 | - 'a5' => array(420.94,595.28), |
|
130 | - 'letter' => array(612,792), |
|
131 | - 'legal' => array(612,1008) |
|
127 | + 'a3' => array(841.89, 1190.55), |
|
128 | + 'a4' => array(595.28, 841.89), |
|
129 | + 'a5' => array(420.94, 595.28), |
|
130 | + 'letter' => array(612, 792), |
|
131 | + 'legal' => array(612, 1008) |
|
132 | 132 | ); |
133 | 133 | if (is_string($format)) { |
134 | 134 | $format = $this->getpageformat($format); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | //Page orientation |
139 | 139 | $orientation = strtolower($orientation); |
140 | 140 | if ($orientation == 'p' || $orientation == 'portrait') { |
141 | - $this->defOrientation='P'; |
|
141 | + $this->defOrientation = 'P'; |
|
142 | 142 | $this->w = $this->defPageFormat[0]; |
143 | 143 | $this->h = $this->defPageFormat[1]; |
144 | 144 | } elseif ($orientation == 'l' || $orientation == 'landscape') { |
@@ -146,26 +146,26 @@ discard block |
||
146 | 146 | $this->w = $this->defPageFormat[1]; |
147 | 147 | $this->h = $this->defPageFormat[0]; |
148 | 148 | } else { |
149 | - $this->error('Incorrect orientation: '.$orientation); |
|
149 | + $this->error('Incorrect orientation: ' . $orientation); |
|
150 | 150 | } |
151 | 151 | $this->curOrientation = $this->defOrientation; |
152 | - $this->wPt = $this->w*$this->k; |
|
153 | - $this->hPt = $this->h*$this->k; |
|
152 | + $this->wPt = $this->w * $this->k; |
|
153 | + $this->hPt = $this->h * $this->k; |
|
154 | 154 | //Page margins (1 cm) |
155 | - $margin = 28.35/$this->k; |
|
155 | + $margin = 28.35 / $this->k; |
|
156 | 156 | $this->setMargins($margin, $margin); |
157 | 157 | //Interior cell margin (1 mm) |
158 | - $this->cMargin = $margin/10; |
|
158 | + $this->cMargin = $margin / 10; |
|
159 | 159 | //Line width (0.2 mm) |
160 | - $this->lineWidth = .567/$this->k; |
|
160 | + $this->lineWidth = .567 / $this->k; |
|
161 | 161 | //Automatic page break |
162 | - $this->setAutoPageBreak(true, 2*$margin); |
|
162 | + $this->setAutoPageBreak(true, 2 * $margin); |
|
163 | 163 | //Full width display mode |
164 | 164 | $this->setDisplayMode('fullwidth'); |
165 | 165 | //Enable compression |
166 | 166 | $this->setCompression(true); |
167 | 167 | //Set default PDF version number |
168 | - $this->pdfVersion='1.3'; |
|
168 | + $this->pdfVersion = '1.3'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | public function setMargins($left, $top, $right = null) |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | if ($right === null) { |
177 | 177 | $right = $left; |
178 | 178 | } |
179 | - $this->rMargin=$right; |
|
179 | + $this->rMargin = $right; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | public function setLeftMargin($margin) |
183 | 183 | { |
184 | 184 | //Set left margin |
185 | 185 | $this->lMargin = $margin; |
186 | - if ($this->page>0 && $this->x<$margin) { |
|
186 | + if ($this->page > 0 && $this->x < $margin) { |
|
187 | 187 | $this->x = $margin; |
188 | 188 | } |
189 | 189 | } |
@@ -205,21 +205,21 @@ discard block |
||
205 | 205 | //Set auto page break mode and triggering margin |
206 | 206 | $this->autoPageBreak = $auto; |
207 | 207 | $this->bMargin = $margin; |
208 | - $this->pageBreakTrigger = $this->h-$margin; |
|
208 | + $this->pageBreakTrigger = $this->h - $margin; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | public function setDisplayMode($zoom, $layout = 'continuous') |
212 | 212 | { |
213 | 213 | //Set display mode in viewer |
214 | - if ($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) { |
|
214 | + if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) { |
|
215 | 215 | $this->zoomMode = $zoom; |
216 | 216 | } else { |
217 | - $this->error('Incorrect zoom display mode: '.$zoom); |
|
217 | + $this->error('Incorrect zoom display mode: ' . $zoom); |
|
218 | 218 | } |
219 | - if ($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') { |
|
219 | + if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') { |
|
220 | 220 | $this->layoutMode = $layout; |
221 | 221 | } else { |
222 | - $this->error('Incorrect layout display mode: '.$layout); |
|
222 | + $this->error('Incorrect layout display mode: ' . $layout); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ($isUTF8) { |
258 | 258 | $author = $this->utf8Toutf16($author); |
259 | 259 | } |
260 | - $this->author=$author; |
|
260 | + $this->author = $author; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | public function setKeywords($keywords, $isUTF8 = false) |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | public function aliasNbPages($alias = '{nb}') |
282 | 282 | { |
283 | 283 | //Define an alias for total number of pages |
284 | - $this->aliasNbPages=$alias; |
|
284 | + $this->aliasNbPages = $alias; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | public function error($msg) |
@@ -317,11 +317,11 @@ discard block |
||
317 | 317 | public function addPage($orientation = '', $format = '') |
318 | 318 | { |
319 | 319 | //Start a new page |
320 | - if ($this->state==0) { |
|
320 | + if ($this->state == 0) { |
|
321 | 321 | $this->open(); |
322 | 322 | } |
323 | 323 | $family = $this->fontFamily; |
324 | - $style = $this->fontStyle.($this->underline ? 'U' : ''); |
|
324 | + $style = $this->fontStyle . ($this->underline ? 'U' : ''); |
|
325 | 325 | $size = $this->fontSizePt; |
326 | 326 | $lw = $this->lineWidth; |
327 | 327 | $dc = $this->drawColor; |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | $this->out('2 J'); |
343 | 343 | //Set line width |
344 | 344 | $this->lineWidth = $lw; |
345 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
345 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
346 | 346 | //Set font |
347 | 347 | if ($family) { |
348 | 348 | $this->setFont($family, $style, $size); |
349 | 349 | } |
350 | 350 | //Set colors |
351 | 351 | $this->drawColor = $dc; |
352 | - if ($dc!='0 G') { |
|
352 | + if ($dc != '0 G') { |
|
353 | 353 | $this->out($dc); |
354 | 354 | } |
355 | 355 | $this->fillColor = $fc; |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | //Restore line width |
366 | 366 | if ($this->lineWidth != $lw) { |
367 | 367 | $this->lineWidth = $lw; |
368 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
368 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
369 | 369 | } |
370 | 370 | //Restore font |
371 | 371 | if ($family) { |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | public function setDrawColor($r, $g = null, $b = null) |
404 | 404 | { |
405 | 405 | //Set color for all stroking operations |
406 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
407 | - $this->drawColor = sprintf('%.3F G', $r/255); |
|
406 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
407 | + $this->drawColor = sprintf('%.3F G', $r / 255); |
|
408 | 408 | } else { |
409 | - $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r/255, $g/255, $b/255); |
|
409 | + $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255); |
|
410 | 410 | } |
411 | 411 | if ($this->page > 0) { |
412 | 412 | $this->out($this->drawColor); |
@@ -416,10 +416,10 @@ discard block |
||
416 | 416 | public function setFillColor($r, $g = null, $b = null) |
417 | 417 | { |
418 | 418 | //Set color for all filling operations |
419 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
420 | - $this->fillColor = sprintf('%.3F g', $r/255); |
|
419 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
420 | + $this->fillColor = sprintf('%.3F g', $r / 255); |
|
421 | 421 | } else { |
422 | - $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
422 | + $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
423 | 423 | } |
424 | 424 | $this->colorFlag = ($this->fillColor != $this->textColor); |
425 | 425 | if ($this->page > 0) { |
@@ -430,10 +430,10 @@ discard block |
||
430 | 430 | public function settextColor($r, $g = null, $b = null) |
431 | 431 | { |
432 | 432 | //Set color for text |
433 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
434 | - $this->textColor = sprintf('%.3F g', $r/255); |
|
433 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
434 | + $this->textColor = sprintf('%.3F g', $r / 255); |
|
435 | 435 | } else { |
436 | - $this->textColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
436 | + $this->textColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
437 | 437 | } |
438 | 438 | $this->colorFlag = ($this->fillColor != $this->textColor); |
439 | 439 | } |
@@ -441,14 +441,14 @@ discard block |
||
441 | 441 | public function getStringWidth($s) |
442 | 442 | { |
443 | 443 | //Get width of a string in the current font |
444 | - $s = (string)$s; |
|
445 | - $cw =& $this->currentFont['cw']; |
|
444 | + $s = (string) $s; |
|
445 | + $cw = & $this->currentFont['cw']; |
|
446 | 446 | $w = 0; |
447 | 447 | $l = strlen($s); |
448 | - for ($i=0; $i<$l; $i++) { |
|
448 | + for ($i = 0; $i < $l; $i++) { |
|
449 | 449 | $w += $cw[$s[$i]]; |
450 | 450 | } |
451 | - return $w*$this->fontSize/1000; |
|
451 | + return $w * $this->fontSize / 1000; |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | public function setLineWidth($width) |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | //Set line width |
457 | 457 | $this->lineWidth = $width; |
458 | 458 | if ($this->page > 0) { |
459 | - $this->out(sprintf('%.2F w', $width*$this->k)); |
|
459 | + $this->out(sprintf('%.2F w', $width * $this->k)); |
|
460 | 460 | } |
461 | 461 | } |
462 | 462 | |
@@ -466,10 +466,10 @@ discard block |
||
466 | 466 | $this->out( |
467 | 467 | sprintf( |
468 | 468 | '%.2F %.2F m %.2F %.2F l S', |
469 | - $x1*$this->k, |
|
470 | - ($this->h-$y1)*$this->k, |
|
471 | - $x2*$this->k, |
|
472 | - ($this->h-$y2)*$this->k |
|
469 | + $x1 * $this->k, |
|
470 | + ($this->h - $y1) * $this->k, |
|
471 | + $x2 * $this->k, |
|
472 | + ($this->h - $y2) * $this->k |
|
473 | 473 | ) |
474 | 474 | ); |
475 | 475 | } |
@@ -487,10 +487,10 @@ discard block |
||
487 | 487 | $this->out( |
488 | 488 | sprintf( |
489 | 489 | '%.2F %.2F %.2F %.2F re %s', |
490 | - $x*$this->k, |
|
491 | - ($this->h-$y)*$this->k, |
|
492 | - $w*$this->k, |
|
493 | - -$h*$this->k, |
|
490 | + $x * $this->k, |
|
491 | + ($this->h - $y) * $this->k, |
|
492 | + $w * $this->k, |
|
493 | + -$h * $this->k, |
|
494 | 494 | $op |
495 | 495 | ) |
496 | 496 | ); |
@@ -501,24 +501,24 @@ discard block |
||
501 | 501 | //Add a TrueType or Type1 font |
502 | 502 | $family = strtolower($family); |
503 | 503 | if ($file == '') { |
504 | - $file = str_replace(' ', '', $family).strtolower($style).'.php'; |
|
504 | + $file = str_replace(' ', '', $family) . strtolower($style) . '.php'; |
|
505 | 505 | } |
506 | - if ($family=='arial') { |
|
507 | - $family='helvetica'; |
|
506 | + if ($family == 'arial') { |
|
507 | + $family = 'helvetica'; |
|
508 | 508 | } |
509 | 509 | $style = strtoupper($style); |
510 | 510 | if ($style == 'IB') { |
511 | 511 | $style = 'BI'; |
512 | 512 | } |
513 | - $fontkey = $family.$style; |
|
513 | + $fontkey = $family . $style; |
|
514 | 514 | if (isset($this->fonts[$fontkey])) { |
515 | 515 | return; |
516 | 516 | } |
517 | - include $this->getFontPath().$file; |
|
517 | + include $this->getFontPath() . $file; |
|
518 | 518 | if (!isset($name)) { |
519 | 519 | $this->error('Could not include font definition file'); |
520 | 520 | } |
521 | - $i = count($this->fonts)+1; |
|
521 | + $i = count($this->fonts) + 1; |
|
522 | 522 | $this->fonts[$fontkey] = [ |
523 | 523 | 'i'=>$i, |
524 | 524 | 'type'=>$type, |
@@ -534,20 +534,20 @@ discard block |
||
534 | 534 | //Search existing encodings |
535 | 535 | $d = 0; |
536 | 536 | $nb = count($this->diffs); |
537 | - for ($i=1; $i<=$nb; $i++) { |
|
537 | + for ($i = 1; $i <= $nb; $i++) { |
|
538 | 538 | if ($this->diffs[$i] == $diff) { |
539 | 539 | $d = $i; |
540 | 540 | break; |
541 | 541 | } |
542 | 542 | } |
543 | 543 | if ($d == 0) { |
544 | - $d = $nb+1; |
|
544 | + $d = $nb + 1; |
|
545 | 545 | $this->diffs[$d] = $diff; |
546 | 546 | } |
547 | 547 | $this->fonts[$fontkey]['diff'] = $d; |
548 | 548 | } |
549 | 549 | if ($file) { |
550 | - if ($type=='TrueType') { |
|
550 | + if ($type == 'TrueType') { |
|
551 | 551 | $this->fontFiles[$file] = array('length1'=>$originalsize); |
552 | 552 | } else { |
553 | 553 | $this->fontFiles[$file] = array('length1'=>$size1, 'length2'=>$size2); |
@@ -582,39 +582,39 @@ discard block |
||
582 | 582 | $size = $this->fontSizePt; |
583 | 583 | } |
584 | 584 | //Test if font is already selected |
585 | - if ($this->fontFamily==$family && $this->fontStyle==$style && $this->fontSizePt==$size) { |
|
585 | + if ($this->fontFamily == $family && $this->fontStyle == $style && $this->fontSizePt == $size) { |
|
586 | 586 | return; |
587 | 587 | } |
588 | 588 | //Test if used for the first time |
589 | - $fontkey = $family.$style; |
|
589 | + $fontkey = $family . $style; |
|
590 | 590 | if (!isset($this->fonts[$fontkey])) { |
591 | 591 | //Check if one of the standard fonts |
592 | 592 | if (isset($this->coreFonts[$fontkey])) { |
593 | 593 | if (!isset($fpdf_charwidths[$fontkey])) { |
594 | 594 | //Load metric file |
595 | - $file=$family; |
|
596 | - if ($family=='times' || $family=='helvetica') { |
|
595 | + $file = $family; |
|
596 | + if ($family == 'times' || $family == 'helvetica') { |
|
597 | 597 | $file .= strtolower($style); |
598 | 598 | } |
599 | - include $this->getFontPath().$file.'.php'; |
|
599 | + include $this->getFontPath() . $file . '.php'; |
|
600 | 600 | if (!isset($fpdf_charwidths[$fontkey])) { |
601 | 601 | $this->error('Could not include font metric file'); |
602 | 602 | } |
603 | 603 | } |
604 | - $i = count($this->fonts)+1; |
|
604 | + $i = count($this->fonts) + 1; |
|
605 | 605 | $name = $this->coreFonts[$fontkey]; |
606 | 606 | $cw = $fpdf_charwidths[$fontkey]; |
607 | 607 | $this->fonts[$fontkey] = ['i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw]; |
608 | 608 | } else { |
609 | - $this->error('Undefined font: '.$family.' '.$style); |
|
609 | + $this->error('Undefined font: ' . $family . ' ' . $style); |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | //Select it |
613 | 613 | $this->fontFamily = $family; |
614 | 614 | $this->fontStyle = $style; |
615 | 615 | $this->fontSizePt = $size; |
616 | - $this->fontSize = $size/$this->k; |
|
617 | - $this->currentFont =& $this->fonts[$fontkey]; |
|
616 | + $this->fontSize = $size / $this->k; |
|
617 | + $this->currentFont = & $this->fonts[$fontkey]; |
|
618 | 618 | if ($this->page > 0) { |
619 | 619 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
620 | 620 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | return; |
628 | 628 | } |
629 | 629 | $this->fontSizePt = $size; |
630 | - $this->fontSize = $size/$this->k; |
|
630 | + $this->fontSize = $size / $this->k; |
|
631 | 631 | if ($this->page > 0) { |
632 | 632 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
633 | 633 | } |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | public function addlink() |
637 | 637 | { |
638 | 638 | //Create a new internal link |
639 | - $n = count($this->links)+1; |
|
639 | + $n = count($this->links) + 1; |
|
640 | 640 | $this->links[$n] = array(0, 0); |
641 | 641 | return $n; |
642 | 642 | } |
@@ -657,10 +657,10 @@ discard block |
||
657 | 657 | { |
658 | 658 | //Put a link on the page |
659 | 659 | $this->PageLinks[$this->page][] = [ |
660 | - $x*$this->k, |
|
661 | - $this->hPt-$y*$this->k, |
|
662 | - $w*$this->k, |
|
663 | - $h*$this->k, |
|
660 | + $x * $this->k, |
|
661 | + $this->hPt - $y * $this->k, |
|
662 | + $w * $this->k, |
|
663 | + $h * $this->k, |
|
664 | 664 | $link |
665 | 665 | ]; |
666 | 666 | } |
@@ -668,12 +668,12 @@ discard block |
||
668 | 668 | public function text($x, $y, $txt) |
669 | 669 | { |
670 | 670 | //Output a string |
671 | - $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x*$this->k, ($this->h-$y)*$this->k, $this->escape($txt)); |
|
672 | - if ($this->underline && $txt!='') { |
|
673 | - $s .= ' '.$this->doUnderLine($x, $y, $txt); |
|
671 | + $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->escape($txt)); |
|
672 | + if ($this->underline && $txt != '') { |
|
673 | + $s .= ' ' . $this->doUnderLine($x, $y, $txt); |
|
674 | 674 | } |
675 | 675 | if ($this->colorFlag) { |
676 | - $s = 'q '.$this->textColor.' '.$s.' Q'; |
|
676 | + $s = 'q ' . $this->textColor . ' ' . $s . ' Q'; |
|
677 | 677 | } |
678 | 678 | $this->out($s); |
679 | 679 | } |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | { |
689 | 689 | //Output a cell |
690 | 690 | $k = $this->k; |
691 | - if ($this->y+$h > $this->PageBreakTrigger |
|
691 | + if ($this->y + $h > $this->PageBreakTrigger |
|
692 | 692 | && !$this->InHeader |
693 | 693 | && !$this->InFooter |
694 | 694 | && $this->acceptPageBreak() |
@@ -704,77 +704,77 @@ discard block |
||
704 | 704 | $this->x = $x; |
705 | 705 | if ($ws > 0) { |
706 | 706 | $this->ws = $ws; |
707 | - $this->out(sprintf('%.3F Tw', $ws*$k)); |
|
707 | + $this->out(sprintf('%.3F Tw', $ws * $k)); |
|
708 | 708 | } |
709 | 709 | } |
710 | 710 | if ($w == 0) { |
711 | - $w = $this->w-$this->rMargin-$this->x; |
|
711 | + $w = $this->w - $this->rMargin - $this->x; |
|
712 | 712 | } |
713 | - $s=''; |
|
714 | - if ($fill || $border==1) { |
|
713 | + $s = ''; |
|
714 | + if ($fill || $border == 1) { |
|
715 | 715 | if ($fill) { |
716 | - $op=($border==1) ? 'B' : 'f'; |
|
716 | + $op = ($border == 1) ? 'B' : 'f'; |
|
717 | 717 | } else { |
718 | - $op='S'; |
|
718 | + $op = 'S'; |
|
719 | 719 | } |
720 | - $s=sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x*$k, ($this->h-$this->y)*$k, $w*$k, -$h*$k, $op); |
|
720 | + $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op); |
|
721 | 721 | } |
722 | 722 | if (is_string($border)) { |
723 | 723 | $x = $this->x; |
724 | 724 | $y = $this->y; |
725 | 725 | if (strpos($border, 'L') !== false) { |
726 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, $x*$k, ($this->h-($y+$h))*$k); |
|
726 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k); |
|
727 | 727 | } |
728 | 728 | if (strpos($border, 'T') !== false) { |
729 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, ($x+$w)*$k, ($this->h-$y)*$k); |
|
729 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k); |
|
730 | 730 | } |
731 | 731 | if (strpos($border, 'R') !== false) { |
732 | 732 | $s .= sprintf( |
733 | 733 | '%.2F %.2F m %.2F %.2F l S ', |
734 | - ($x+$w)*$k, |
|
735 | - ($this->h-$y)*$k, |
|
736 | - ($x+$w)*$k, |
|
737 | - ($this->h-($y+$h))*$k |
|
734 | + ($x + $w) * $k, |
|
735 | + ($this->h - $y) * $k, |
|
736 | + ($x + $w) * $k, |
|
737 | + ($this->h - ($y + $h)) * $k |
|
738 | 738 | ); |
739 | 739 | } |
740 | 740 | if (strpos($border, 'B') !== false) { |
741 | 741 | $s .= sprintf( |
742 | 742 | '%.2F %.2F m %.2F %.2F l S ', |
743 | - $x*$k, |
|
744 | - ($this->h-($y+$h))*$k, |
|
745 | - ($x+$w)*$k, |
|
746 | - ($this->h-($y+$h))*$k |
|
743 | + $x * $k, |
|
744 | + ($this->h - ($y + $h)) * $k, |
|
745 | + ($x + $w) * $k, |
|
746 | + ($this->h - ($y + $h)) * $k |
|
747 | 747 | ); |
748 | 748 | } |
749 | 749 | } |
750 | 750 | if ($txt !== '') { |
751 | 751 | if ($align == 'R') { |
752 | - $dx = $w-$this->cMargin-$this->getStringWidth($txt); |
|
752 | + $dx = $w - $this->cMargin - $this->getStringWidth($txt); |
|
753 | 753 | } elseif ($align == 'C') { |
754 | - $dx = ($w-$this->getStringWidth($txt))/2; |
|
754 | + $dx = ($w - $this->getStringWidth($txt)) / 2; |
|
755 | 755 | } else { |
756 | 756 | $dx = $this->cMargin; |
757 | 757 | } |
758 | 758 | if ($this->colorFlag) { |
759 | - $s .= 'q '.$this->textColor.' '; |
|
759 | + $s .= 'q ' . $this->textColor . ' '; |
|
760 | 760 | } |
761 | 761 | $txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt))); |
762 | 762 | $s .= sprintf( |
763 | 763 | 'BT %.2F %.2F Td (%s) Tj ET', |
764 | - ($this->x+$dx)*$k, |
|
765 | - ($this->h-($this->y+.5*$h+.3*$this->fontSize))*$k, |
|
764 | + ($this->x + $dx) * $k, |
|
765 | + ($this->h - ($this->y + .5 * $h + .3 * $this->fontSize)) * $k, |
|
766 | 766 | $txt2 |
767 | 767 | ); |
768 | 768 | if ($this->underline) { |
769 | - $s .= ' '.$this->doUnderLine($this->x+$dx, $this->y+.5*$h+.3*$this->fontSize, $txt); |
|
769 | + $s .= ' ' . $this->doUnderLine($this->x + $dx, $this->y + .5 * $h + .3 * $this->fontSize, $txt); |
|
770 | 770 | } |
771 | 771 | if ($this->colorFlag) { |
772 | - $s.=' Q'; |
|
772 | + $s .= ' Q'; |
|
773 | 773 | } |
774 | 774 | if ($link) { |
775 | 775 | $this->link( |
776 | - $this->x+$dx, |
|
777 | - $this->y+.5*$h-.5*$this->fontSize, |
|
776 | + $this->x + $dx, |
|
777 | + $this->y + .5 * $h - .5 * $this->fontSize, |
|
778 | 778 | $this->getStringWidth($txt), |
779 | 779 | $this->fontSize, |
780 | 780 | $link |
@@ -799,14 +799,14 @@ discard block |
||
799 | 799 | public function multicell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) |
800 | 800 | { |
801 | 801 | //Output text with automatic or explicit line breaks |
802 | - $cw =& $this->currentFont['cw']; |
|
802 | + $cw = & $this->currentFont['cw']; |
|
803 | 803 | if ($w == 0) { |
804 | - $w = $this->w-$this->rMargin-$this->x; |
|
804 | + $w = $this->w - $this->rMargin - $this->x; |
|
805 | 805 | } |
806 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
806 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
807 | 807 | $s = str_replace("\r", '', $txt); |
808 | 808 | $nb = strlen($s); |
809 | - if ($nb>0 && $s[$nb-1] == "\n") { |
|
809 | + if ($nb > 0 && $s[$nb - 1] == "\n") { |
|
810 | 810 | $nb--; |
811 | 811 | } |
812 | 812 | $b = 0; |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | if (strpos($border, 'R') !== false) { |
824 | 824 | $b2 .= 'R'; |
825 | 825 | } |
826 | - $b=(strpos($border, 'T') !== false) ? $b2.'T' : $b2; |
|
826 | + $b = (strpos($border, 'T') !== false) ? $b2 . 'T' : $b2; |
|
827 | 827 | } |
828 | 828 | } |
829 | 829 | $sep = -1; |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $l = 0; |
833 | 833 | $ns = 0; |
834 | 834 | $nl = 1; |
835 | - while ($i<$nb) { |
|
835 | + while ($i < $nb) { |
|
836 | 836 | //Get next character |
837 | 837 | $c = $s[$i]; |
838 | 838 | if ($c == "\n") { |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | $this->ws = 0; |
842 | 842 | $this->out('0 Tw'); |
843 | 843 | } |
844 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
844 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
845 | 845 | $i++; |
846 | 846 | $sep = -1; |
847 | 847 | $j = $i; |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | $ns = 0; |
850 | 850 | $nl++; |
851 | 851 | if ($border && $nl == 2) { |
852 | - $b=$b2; |
|
852 | + $b = $b2; |
|
853 | 853 | } |
854 | 854 | continue; |
855 | 855 | } |
@@ -869,14 +869,14 @@ discard block |
||
869 | 869 | $this->ws = 0; |
870 | 870 | $this->out('0 Tw'); |
871 | 871 | } |
872 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
872 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
873 | 873 | } else { |
874 | - if ($align=='J') { |
|
875 | - $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->fontSize/($ns-1) : 0; |
|
876 | - $this->out(sprintf('%.3F Tw', $this->ws*$this->k)); |
|
874 | + if ($align == 'J') { |
|
875 | + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->fontSize / ($ns - 1) : 0; |
|
876 | + $this->out(sprintf('%.3F Tw', $this->ws * $this->k)); |
|
877 | 877 | } |
878 | - $this->cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill); |
|
879 | - $i = $sep+1; |
|
878 | + $this->cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); |
|
879 | + $i = $sep + 1; |
|
880 | 880 | } |
881 | 881 | $sep = -1; |
882 | 882 | $j = $i; |
@@ -895,19 +895,19 @@ discard block |
||
895 | 895 | $this->ws = 0; |
896 | 896 | $this->out('0 Tw'); |
897 | 897 | } |
898 | - if ($border && strpos($border, 'B')!==false) { |
|
898 | + if ($border && strpos($border, 'B') !== false) { |
|
899 | 899 | $b .= 'B'; |
900 | 900 | } |
901 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
901 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
902 | 902 | $this->x = $this->lMargin; |
903 | 903 | } |
904 | 904 | |
905 | 905 | public function write($h, $txt, $link = '') |
906 | 906 | { |
907 | 907 | //Output text in flowing mode |
908 | - $cw =& $this->currentFont['cw']; |
|
909 | - $w = $this->w-$this->rMargin-$this->x; |
|
910 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
908 | + $cw = & $this->currentFont['cw']; |
|
909 | + $w = $this->w - $this->rMargin - $this->x; |
|
910 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
911 | 911 | $s = str_replace("\r", '', $txt); |
912 | 912 | $nb = strlen($s); |
913 | 913 | $sep = -1; |
@@ -917,18 +917,18 @@ discard block |
||
917 | 917 | $nl = 1; |
918 | 918 | while ($i < $nb) { |
919 | 919 | //Get next character |
920 | - $c=$s[$i]; |
|
921 | - if ($c=="\n") { |
|
920 | + $c = $s[$i]; |
|
921 | + if ($c == "\n") { |
|
922 | 922 | //Explicit line break |
923 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
923 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
924 | 924 | $i++; |
925 | 925 | $sep = -1; |
926 | 926 | $j = $i; |
927 | 927 | $l = 0; |
928 | 928 | if ($nl == 1) { |
929 | 929 | $this->x = $this->lMargin; |
930 | - $w = $this->w-$this->rMargin-$this->x; |
|
931 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
930 | + $w = $this->w - $this->rMargin - $this->x; |
|
931 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
932 | 932 | } |
933 | 933 | $nl++; |
934 | 934 | continue; |
@@ -944,8 +944,8 @@ discard block |
||
944 | 944 | //Move to next line |
945 | 945 | $this->x = $this->lMargin; |
946 | 946 | $this->y += $h; |
947 | - $w = $this->w-$this->rMargin-$this->x; |
|
948 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
947 | + $w = $this->w - $this->rMargin - $this->x; |
|
948 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
949 | 949 | $i++; |
950 | 950 | $nl++; |
951 | 951 | continue; |
@@ -953,18 +953,18 @@ discard block |
||
953 | 953 | if ($i == $j) { |
954 | 954 | $i++; |
955 | 955 | } |
956 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
956 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
957 | 957 | } else { |
958 | - $this->cell($w, $h, substr($s, $j, $sep-$j), 0, 2, '', 0, $link); |
|
959 | - $i = $sep+1; |
|
958 | + $this->cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); |
|
959 | + $i = $sep + 1; |
|
960 | 960 | } |
961 | 961 | $sep = -1; |
962 | 962 | $j = $i; |
963 | 963 | $l = 0; |
964 | 964 | if ($nl == 1) { |
965 | 965 | $this->x = $this->lMargin; |
966 | - $w = $this->w-$this->rMargin-$this->x; |
|
967 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
966 | + $w = $this->w - $this->rMargin - $this->x; |
|
967 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
968 | 968 | } |
969 | 969 | $nl++; |
970 | 970 | } else { |
@@ -973,7 +973,7 @@ discard block |
||
973 | 973 | } |
974 | 974 | //Last chunk |
975 | 975 | if ($i != $j) { |
976 | - $this->cell($l/1000*$this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
976 | + $this->cell($l / 1000 * $this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
977 | 977 | } |
978 | 978 | } |
979 | 979 | |
@@ -996,20 +996,20 @@ discard block |
||
996 | 996 | if ($type == '') { |
997 | 997 | $pos = strrpos($file, '.'); |
998 | 998 | if (!$pos) { |
999 | - $this->error('Image file has no extension and no type was specified: '.$file); |
|
999 | + $this->error('Image file has no extension and no type was specified: ' . $file); |
|
1000 | 1000 | } |
1001 | - $type = substr($file, $pos+1); |
|
1001 | + $type = substr($file, $pos + 1); |
|
1002 | 1002 | } |
1003 | 1003 | $type = strtolower($type); |
1004 | 1004 | if ($type == 'jpeg') { |
1005 | 1005 | $type = 'jpg'; |
1006 | 1006 | } |
1007 | - $mtd = 'parse'.strtoupper($type); |
|
1007 | + $mtd = 'parse' . strtoupper($type); |
|
1008 | 1008 | if (!method_exists($this, $mtd)) { |
1009 | - $this->error('Unsupported image type: '.$type); |
|
1009 | + $this->error('Unsupported image type: ' . $type); |
|
1010 | 1010 | } |
1011 | 1011 | $info = $this->$mtd($file); |
1012 | - $info['i'] = count($this->images)+1; |
|
1012 | + $info['i'] = count($this->images) + 1; |
|
1013 | 1013 | $this->images[$file] = $info; |
1014 | 1014 | } else { |
1015 | 1015 | $info = $this->images[$file]; |
@@ -1017,16 +1017,16 @@ discard block |
||
1017 | 1017 | //Automatic width and height calculation if needed |
1018 | 1018 | if ($w == 0 && $h == 0) { |
1019 | 1019 | //Put image at 72 dpi |
1020 | - $w = $info['w']/$this->k; |
|
1021 | - $h = $info['h']/$this->k; |
|
1020 | + $w = $info['w'] / $this->k; |
|
1021 | + $h = $info['h'] / $this->k; |
|
1022 | 1022 | } elseif ($w == 0) { |
1023 | - $w = $h*$info['w']/$info['h']; |
|
1023 | + $w = $h * $info['w'] / $info['h']; |
|
1024 | 1024 | } elseif ($h == 0) { |
1025 | - $h = $w*$info['h']/$info['w']; |
|
1025 | + $h = $w * $info['h'] / $info['w']; |
|
1026 | 1026 | } |
1027 | 1027 | //Flowing mode |
1028 | 1028 | if ($y === null) { |
1029 | - if ($this->y+$h > $this->pageBreakTrigger |
|
1029 | + if ($this->y + $h > $this->pageBreakTrigger |
|
1030 | 1030 | && !$this->inHeader |
1031 | 1031 | && !$this->inFooter |
1032 | 1032 | && $this->acceptPageBreak() |
@@ -1045,10 +1045,10 @@ discard block |
||
1045 | 1045 | $this->out( |
1046 | 1046 | sprintf( |
1047 | 1047 | 'q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', |
1048 | - $w*$this->k, |
|
1049 | - $h*$this->k, |
|
1050 | - $x*$this->k, |
|
1051 | - ($this->h-($y+$h))*$this->k, |
|
1048 | + $w * $this->k, |
|
1049 | + $h * $this->k, |
|
1050 | + $x * $this->k, |
|
1051 | + ($this->h - ($y + $h)) * $this->k, |
|
1052 | 1052 | $info['i'] |
1053 | 1053 | ) |
1054 | 1054 | ); |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | if ($x >= 0) { |
1070 | 1070 | $this->x = $x; |
1071 | 1071 | } else { |
1072 | - $this->x = $this->w+$x; |
|
1072 | + $this->x = $this->w + $x; |
|
1073 | 1073 | } |
1074 | 1074 | } |
1075 | 1075 | |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | if ($y >= 0) { |
1087 | 1087 | $this->y = $y; |
1088 | 1088 | } else { |
1089 | - $this->y = $this->h+$y; |
|
1089 | + $this->y = $this->h + $y; |
|
1090 | 1090 | } |
1091 | 1091 | } |
1092 | 1092 | |
@@ -1132,8 +1132,8 @@ discard block |
||
1132 | 1132 | if (headers_sent()) { |
1133 | 1133 | $this->error('Some data has already been output, can\'t send PDF file'); |
1134 | 1134 | } |
1135 | - header('Content-Length: '.strlen($this->buffer)); |
|
1136 | - header('Content-Disposition: inline; filename="'.$name.'"'); |
|
1135 | + header('Content-Length: ' . strlen($this->buffer)); |
|
1136 | + header('Content-Disposition: inline; filename="' . $name . '"'); |
|
1137 | 1137 | header('Cache-Control: private, max-age=0, must-revalidate'); |
1138 | 1138 | header('Pragma: public'); |
1139 | 1139 | ini_set('zlib.output_compression', '0'); |
@@ -1149,8 +1149,8 @@ discard block |
||
1149 | 1149 | if (headers_sent()) { |
1150 | 1150 | $this->error('Some data has already been output, can\'t send PDF file'); |
1151 | 1151 | } |
1152 | - header('Content-Length: '.strlen($this->buffer)); |
|
1153 | - header('Content-Disposition: attachment; filename="'.$name.'"'); |
|
1152 | + header('Content-Length: ' . strlen($this->buffer)); |
|
1153 | + header('Content-Disposition: attachment; filename="' . $name . '"'); |
|
1154 | 1154 | header('Cache-Control: private, max-age=0, must-revalidate'); |
1155 | 1155 | header('Pragma: public'); |
1156 | 1156 | ini_set('zlib.output_compression', '0'); |
@@ -1158,9 +1158,9 @@ discard block |
||
1158 | 1158 | break; |
1159 | 1159 | case 'F': |
1160 | 1160 | //Save to local file |
1161 | - $f=fopen($name, 'wb'); |
|
1161 | + $f = fopen($name, 'wb'); |
|
1162 | 1162 | if (!$f) { |
1163 | - $this->error('Unable to create output file: '.$name); |
|
1163 | + $this->error('Unable to create output file: ' . $name); |
|
1164 | 1164 | } |
1165 | 1165 | fwrite($f, $this->buffer, strlen($this->buffer)); |
1166 | 1166 | fclose($f); |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | //Return as a string |
1170 | 1170 | return $this->buffer; |
1171 | 1171 | default: |
1172 | - $this->error('Incorrect output destination: '.$dest); |
|
1172 | + $this->error('Incorrect output destination: ' . $dest); |
|
1173 | 1173 | } |
1174 | 1174 | return ''; |
1175 | 1175 | } |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | protected function dochecks() |
1178 | 1178 | { |
1179 | 1179 | //Check availability of %F |
1180 | - if (sprintf('%.1F', 1.0)!='1.0') { |
|
1180 | + if (sprintf('%.1F', 1.0) != '1.0') { |
|
1181 | 1181 | $this->error('This version of PHP is not supported'); |
1182 | 1182 | } |
1183 | 1183 | //Check mbstring overloading |
@@ -1192,18 +1192,18 @@ discard block |
||
1192 | 1192 | |
1193 | 1193 | protected function getpageformat($format) |
1194 | 1194 | { |
1195 | - $format=strtolower($format); |
|
1195 | + $format = strtolower($format); |
|
1196 | 1196 | if (!isset($this->pageFormats[$format])) { |
1197 | - $this->error('Unknown page format: '.$format); |
|
1197 | + $this->error('Unknown page format: ' . $format); |
|
1198 | 1198 | } |
1199 | - $a=$this->pageFormats[$format]; |
|
1200 | - return array($a[0]/$this->k, $a[1]/$this->k); |
|
1199 | + $a = $this->pageFormats[$format]; |
|
1200 | + return array($a[0] / $this->k, $a[1] / $this->k); |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | protected function getFontPath() |
1204 | 1204 | { |
1205 | - if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) { |
|
1206 | - define('FPDF_FONTPATH', dirname(__FILE__).'/font/'); |
|
1205 | + if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__) . '/font')) { |
|
1206 | + define('FPDF_FONTPATH', dirname(__FILE__) . '/font/'); |
|
1207 | 1207 | } |
1208 | 1208 | return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; |
1209 | 1209 | } |
@@ -1226,12 +1226,12 @@ discard block |
||
1226 | 1226 | $format = $this->defPageFormat; |
1227 | 1227 | } else { |
1228 | 1228 | if (is_string($format)) { |
1229 | - $format=$this->getpageformat($format); |
|
1229 | + $format = $this->getpageformat($format); |
|
1230 | 1230 | } |
1231 | 1231 | } |
1232 | 1232 | if ($orientation != $this->curOrientation |
1233 | - || $format[0]!=$this->curPageFormat[0] |
|
1234 | - || $format[1]!=$this->curPageFormat[1] |
|
1233 | + || $format[0] != $this->curPageFormat[0] |
|
1234 | + || $format[1] != $this->curPageFormat[1] |
|
1235 | 1235 | ) { |
1236 | 1236 | //New size |
1237 | 1237 | if ($orientation == 'P') { |
@@ -1241,9 +1241,9 @@ discard block |
||
1241 | 1241 | $this->w = $format[1]; |
1242 | 1242 | $this->h = $format[0]; |
1243 | 1243 | } |
1244 | - $this->wPt = $this->w*$this->k; |
|
1245 | - $this->hPt = $this->h*$this->k; |
|
1246 | - $this->pageBreakTrigger = $this->h-$this->bMargin; |
|
1244 | + $this->wPt = $this->w * $this->k; |
|
1245 | + $this->hPt = $this->h * $this->k; |
|
1246 | + $this->pageBreakTrigger = $this->h - $this->bMargin; |
|
1247 | 1247 | $this->curOrientation = $orientation; |
1248 | 1248 | $this->curPageFormat = $format; |
1249 | 1249 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | protected function textString($s) |
1274 | 1274 | { |
1275 | 1275 | //Format a text string |
1276 | - return '('.$this->escape($s).')'; |
|
1276 | + return '(' . $this->escape($s) . ')'; |
|
1277 | 1277 | } |
1278 | 1278 | |
1279 | 1279 | protected function utf8Toutf16($s) |
@@ -1288,16 +1288,16 @@ discard block |
||
1288 | 1288 | //3-byte character |
1289 | 1289 | $c2 = ord($s[$i++]); |
1290 | 1290 | $c3 = ord($s[$i++]); |
1291 | - $res .= chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); |
|
1292 | - $res .= chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); |
|
1291 | + $res .= chr((($c1 & 0x0F) << 4) + (($c2 & 0x3C) >> 2)); |
|
1292 | + $res .= chr((($c2 & 0x03) << 6) + ($c3 & 0x3F)); |
|
1293 | 1293 | } elseif ($c1 >= 192) { |
1294 | 1294 | //2-byte character |
1295 | 1295 | $c2 = ord($s[$i++]); |
1296 | - $res .= chr(($c1 & 0x1C)>>2); |
|
1297 | - $res .= chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); |
|
1296 | + $res .= chr(($c1 & 0x1C) >> 2); |
|
1297 | + $res .= chr((($c1 & 0x03) << 6) + ($c2 & 0x3F)); |
|
1298 | 1298 | } else { |
1299 | 1299 | //Single-byte character |
1300 | - $res .= "\0".chr($c1); |
|
1300 | + $res .= "\0" . chr($c1); |
|
1301 | 1301 | } |
1302 | 1302 | } |
1303 | 1303 | return $res; |
@@ -1308,13 +1308,13 @@ discard block |
||
1308 | 1308 | //Underline text |
1309 | 1309 | $up = $this->currentFont['up']; |
1310 | 1310 | $ut = $this->currentFont['ut']; |
1311 | - $w = $this->getStringWidth($txt)+$this->ws*substr_count($txt, ' '); |
|
1311 | + $w = $this->getStringWidth($txt) + $this->ws * substr_count($txt, ' '); |
|
1312 | 1312 | return sprintf( |
1313 | 1313 | '%.2F %.2F %.2F %.2F re f', |
1314 | - $x*$this->k, |
|
1315 | - ($this->h-($y-$up/1000*$this->fontSize))*$this->k, |
|
1316 | - $w*$this->k, |
|
1317 | - -$ut/1000*$this->fontSizePt |
|
1314 | + $x * $this->k, |
|
1315 | + ($this->h - ($y - $up / 1000 * $this->fontSize)) * $this->k, |
|
1316 | + $w * $this->k, |
|
1317 | + -$ut / 1000 * $this->fontSizePt |
|
1318 | 1318 | ); |
1319 | 1319 | } |
1320 | 1320 | |
@@ -1323,17 +1323,17 @@ discard block |
||
1323 | 1323 | //Extract info from a JPEG file |
1324 | 1324 | $a = getImageSize($file); |
1325 | 1325 | if (!$a) { |
1326 | - $this->error('Missing or incorrect image file: '.$file); |
|
1326 | + $this->error('Missing or incorrect image file: ' . $file); |
|
1327 | 1327 | } |
1328 | - if ($a[2]!=2) { |
|
1329 | - $this->error('Not a JPEG file: '.$file); |
|
1328 | + if ($a[2] != 2) { |
|
1329 | + $this->error('Not a JPEG file: ' . $file); |
|
1330 | 1330 | } |
1331 | 1331 | if (!isset($a['channels']) || $a['channels'] == 3) { |
1332 | 1332 | $colspace = 'DeviceRGB'; |
1333 | 1333 | } elseif ($a['channels'] == 4) { |
1334 | 1334 | $colspace = 'DeviceCMYK'; |
1335 | 1335 | } else { |
1336 | - $colspace='DeviceGray'; |
|
1336 | + $colspace = 'DeviceGray'; |
|
1337 | 1337 | } |
1338 | 1338 | $bpc = isset($a['bits']) ? $a['bits'] : 8; |
1339 | 1339 | //Read whole file |
@@ -1351,22 +1351,22 @@ discard block |
||
1351 | 1351 | //Extract info from a PNG file |
1352 | 1352 | $f = fopen($file, 'rb'); |
1353 | 1353 | if (!$f) { |
1354 | - $this->error('Can\'t open image file: '.$file); |
|
1354 | + $this->error('Can\'t open image file: ' . $file); |
|
1355 | 1355 | } |
1356 | 1356 | //Check signature |
1357 | - if ($this->readstream($f, 8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { |
|
1358 | - $this->error('Not a PNG file: '.$file); |
|
1357 | + if ($this->readstream($f, 8) != chr(137) . 'PNG' . chr(13) . chr(10) . chr(26) . chr(10)) { |
|
1358 | + $this->error('Not a PNG file: ' . $file); |
|
1359 | 1359 | } |
1360 | 1360 | //Read header chunk |
1361 | 1361 | $this->readstream($f, 4); |
1362 | - if ($this->readstream($f, 4)!='IHDR') { |
|
1363 | - $this->error('Incorrect PNG file: '.$file); |
|
1362 | + if ($this->readstream($f, 4) != 'IHDR') { |
|
1363 | + $this->error('Incorrect PNG file: ' . $file); |
|
1364 | 1364 | } |
1365 | 1365 | $w = $this->readint($f); |
1366 | 1366 | $h = $this->readint($f); |
1367 | 1367 | $bpc = ord($this->readstream($f, 1)); |
1368 | - if ($bpc>8) { |
|
1369 | - $this->error('16-bit depth not supported: '.$file); |
|
1368 | + if ($bpc > 8) { |
|
1369 | + $this->error('16-bit depth not supported: ' . $file); |
|
1370 | 1370 | } |
1371 | 1371 | $ct = ord($this->readstream($f, 1)); |
1372 | 1372 | if ($ct == 0) { |
@@ -1376,20 +1376,20 @@ discard block |
||
1376 | 1376 | } elseif ($ct == 3) { |
1377 | 1377 | $colspace = 'Indexed'; |
1378 | 1378 | } else { |
1379 | - $this->error('Alpha channel not supported: '.$file); |
|
1379 | + $this->error('Alpha channel not supported: ' . $file); |
|
1380 | 1380 | } |
1381 | 1381 | if (ord($this->readstream($f, 1)) != 0) { |
1382 | - $this->error('Unknown compression method: '.$file); |
|
1382 | + $this->error('Unknown compression method: ' . $file); |
|
1383 | 1383 | } |
1384 | 1384 | if (ord($this->readstream($f, 1)) != 0) { |
1385 | - $this->error('Unknown filter method: '.$file); |
|
1385 | + $this->error('Unknown filter method: ' . $file); |
|
1386 | 1386 | } |
1387 | 1387 | if (ord($this->readstream($f, 1)) != 0) { |
1388 | - $this->error('Interlacing not supported: '.$file); |
|
1388 | + $this->error('Interlacing not supported: ' . $file); |
|
1389 | 1389 | } |
1390 | 1390 | $this->readstream($f, 4); |
1391 | 1391 | $parms = '/DecodeParms <</Predictor 15 /Colors ' |
1392 | - . ($ct==2 ? 3 : 1) |
|
1392 | + . ($ct == 2 ? 3 : 1) |
|
1393 | 1393 | . ' /BitsPerComponent ' |
1394 | 1394 | . $bpc |
1395 | 1395 | . ' /Columns ' |
@@ -1427,11 +1427,11 @@ discard block |
||
1427 | 1427 | } elseif ($type == 'IEND') { |
1428 | 1428 | break; |
1429 | 1429 | } else { |
1430 | - $this->readstream($f, $n+4); |
|
1430 | + $this->readstream($f, $n + 4); |
|
1431 | 1431 | } |
1432 | 1432 | } while ($n); |
1433 | 1433 | if ($colspace == 'Indexed' && empty($pal)) { |
1434 | - $this->error('Missing palette in '.$file); |
|
1434 | + $this->error('Missing palette in ' . $file); |
|
1435 | 1435 | } |
1436 | 1436 | fclose($f); |
1437 | 1437 | return [ |
@@ -1450,9 +1450,9 @@ discard block |
||
1450 | 1450 | protected function readstream($f, $n) |
1451 | 1451 | { |
1452 | 1452 | //Read n bytes from stream |
1453 | - $res=''; |
|
1453 | + $res = ''; |
|
1454 | 1454 | while ($n > 0 && !feof($f)) { |
1455 | - $s=fread($f, $n); |
|
1455 | + $s = fread($f, $n); |
|
1456 | 1456 | if ($s === false) { |
1457 | 1457 | $this->error('Error while reading stream'); |
1458 | 1458 | } |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | } |
1484 | 1484 | $im = imagecreatefromgif($file); |
1485 | 1485 | if (!$im) { |
1486 | - $this->error('Missing or incorrect image file: '.$file); |
|
1486 | + $this->error('Missing or incorrect image file: ' . $file); |
|
1487 | 1487 | } |
1488 | 1488 | imageinterlace($im, 0); |
1489 | 1489 | $tmp = tempnam('.', 'gif'); |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | $this->error('Error while saving to temporary file'); |
1495 | 1495 | } |
1496 | 1496 | imagedestroy($im); |
1497 | - $info=$this->parsePNG($tmp); |
|
1497 | + $info = $this->parsePNG($tmp); |
|
1498 | 1498 | unlink($tmp); |
1499 | 1499 | return $info; |
1500 | 1500 | } |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | //Begin a new object |
1505 | 1505 | $this->n++; |
1506 | 1506 | $this->offsets[$this->n] = strlen($this->buffer); |
1507 | - $this->out($this->n.' 0 obj'); |
|
1507 | + $this->out($this->n . ' 0 obj'); |
|
1508 | 1508 | } |
1509 | 1509 | |
1510 | 1510 | protected function putStream($s) |
@@ -1518,9 +1518,9 @@ discard block |
||
1518 | 1518 | { |
1519 | 1519 | //Add a line to the document |
1520 | 1520 | if ($this->state == 2) { |
1521 | - $this->pages[$this->page].=$s."\n"; |
|
1521 | + $this->pages[$this->page] .= $s . "\n"; |
|
1522 | 1522 | } else { |
1523 | - $this->buffer .= $s."\n"; |
|
1523 | + $this->buffer .= $s . "\n"; |
|
1524 | 1524 | } |
1525 | 1525 | } |
1526 | 1526 | |
@@ -1529,19 +1529,19 @@ discard block |
||
1529 | 1529 | $nb = $this->page; |
1530 | 1530 | if (!empty($this->aliasNbPages)) { |
1531 | 1531 | //Replace number of pages |
1532 | - for ($n=1; $n<=$nb; $n++) { |
|
1532 | + for ($n = 1; $n <= $nb; $n++) { |
|
1533 | 1533 | $this->pages[$n] = str_replace($this->aliasNbPages, $nb, $this->pages[$n]); |
1534 | 1534 | } |
1535 | 1535 | } |
1536 | 1536 | if ($this->defOrientation == 'P') { |
1537 | - $wPt = $this->defPageFormat[0]*$this->k; |
|
1538 | - $hPt = $this->defPageFormat[1]*$this->k; |
|
1537 | + $wPt = $this->defPageFormat[0] * $this->k; |
|
1538 | + $hPt = $this->defPageFormat[1] * $this->k; |
|
1539 | 1539 | } else { |
1540 | - $wPt = $this->defPageFormat[1]*$this->k; |
|
1541 | - $hPt = $this->defPageFormat[0]*$this->k; |
|
1540 | + $wPt = $this->defPageFormat[1] * $this->k; |
|
1541 | + $hPt = $this->defPageFormat[0] * $this->k; |
|
1542 | 1542 | } |
1543 | 1543 | $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; |
1544 | - for ($n=1; $n<=$nb; $n++) { |
|
1544 | + for ($n = 1; $n <= $nb; $n++) { |
|
1545 | 1545 | //Page |
1546 | 1546 | $this->newObj(); |
1547 | 1547 | $this->out('<</Type /Page'); |
@@ -1554,37 +1554,37 @@ discard block |
||
1554 | 1554 | //Links |
1555 | 1555 | $annots = '/Annots ['; |
1556 | 1556 | foreach ($this->PageLinks[$n] as $pl) { |
1557 | - $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0]+$pl[2], $pl[1]-$pl[3]); |
|
1558 | - $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] '; |
|
1557 | + $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]); |
|
1558 | + $annots .= '<</Type /Annot /Subtype /Link /Rect [' . $rect . '] /Border [0 0 0] '; |
|
1559 | 1559 | if (is_string($pl[4])) { |
1560 | - $annots .= '/A <</S /URI /URI '.$this->textString($pl[4]).'>>>>'; |
|
1560 | + $annots .= '/A <</S /URI /URI ' . $this->textString($pl[4]) . '>>>>'; |
|
1561 | 1561 | } else { |
1562 | 1562 | $l = $this->links[$pl[4]]; |
1563 | 1563 | $h = isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt; |
1564 | - $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1+2*$l[0], $h-$l[1]*$this->k); |
|
1564 | + $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1 + 2 * $l[0], $h - $l[1] * $this->k); |
|
1565 | 1565 | } |
1566 | 1566 | } |
1567 | - $this->out($annots.']'); |
|
1567 | + $this->out($annots . ']'); |
|
1568 | 1568 | } |
1569 | - $this->out('/Contents '.($this->n+1).' 0 R>>'); |
|
1569 | + $this->out('/Contents ' . ($this->n + 1) . ' 0 R>>'); |
|
1570 | 1570 | $this->out('endobj'); |
1571 | 1571 | //Page content |
1572 | - $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
1572 | + $p = ($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
1573 | 1573 | $this->newObj(); |
1574 | - $this->out('<<'.$filter.'/Length '.strlen($p).'>>'); |
|
1574 | + $this->out('<<' . $filter . '/Length ' . strlen($p) . '>>'); |
|
1575 | 1575 | $this->putStream($p); |
1576 | 1576 | $this->out('endobj'); |
1577 | 1577 | } |
1578 | 1578 | //Pages root |
1579 | - $this->offsets[1]=strlen($this->buffer); |
|
1579 | + $this->offsets[1] = strlen($this->buffer); |
|
1580 | 1580 | $this->out('1 0 obj'); |
1581 | 1581 | $this->out('<</Type /Pages'); |
1582 | 1582 | $kids = '/Kids ['; |
1583 | - for ($i=0; $i<$nb; $i++) { |
|
1584 | - $kids .= (3+2*$i).' 0 R '; |
|
1583 | + for ($i = 0; $i < $nb; $i++) { |
|
1584 | + $kids .= (3 + 2 * $i) . ' 0 R '; |
|
1585 | 1585 | } |
1586 | - $this->out($kids.']'); |
|
1587 | - $this->out('/Count '.$nb); |
|
1586 | + $this->out($kids . ']'); |
|
1587 | + $this->out('/Count ' . $nb); |
|
1588 | 1588 | $this->out(sprintf('/MediaBox [0 0 %.2F %.2F]', $wPt, $hPt)); |
1589 | 1589 | $this->out('>>'); |
1590 | 1590 | $this->out('endobj'); |
@@ -1596,41 +1596,41 @@ discard block |
||
1596 | 1596 | foreach ($this->diffs as $diff) { |
1597 | 1597 | //Encodings |
1598 | 1598 | $this->newObj(); |
1599 | - $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); |
|
1599 | + $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>'); |
|
1600 | 1600 | $this->out('endobj'); |
1601 | 1601 | } |
1602 | 1602 | foreach ($this->fontFiles as $file => $info) { |
1603 | 1603 | //Font file embedding |
1604 | 1604 | $this->newObj(); |
1605 | - $this->fontFiles[$file]['n']=$this->n; |
|
1606 | - $font=''; |
|
1607 | - $f = fopen($this->getFontPath().$file, 'rb', 1); |
|
1605 | + $this->fontFiles[$file]['n'] = $this->n; |
|
1606 | + $font = ''; |
|
1607 | + $f = fopen($this->getFontPath() . $file, 'rb', 1); |
|
1608 | 1608 | if (!$f) { |
1609 | 1609 | $this->error('Font file not found'); |
1610 | 1610 | } |
1611 | 1611 | while (!feof($f)) { |
1612 | - $font.=fread($f, 8192); |
|
1612 | + $font .= fread($f, 8192); |
|
1613 | 1613 | } |
1614 | 1614 | fclose($f); |
1615 | - $compressed = (substr($file, -2)=='.z'); |
|
1615 | + $compressed = (substr($file, -2) == '.z'); |
|
1616 | 1616 | if (!$compressed && isset($info['length2'])) { |
1617 | - $header = (ord($font[0])==128); |
|
1617 | + $header = (ord($font[0]) == 128); |
|
1618 | 1618 | if ($header) { |
1619 | 1619 | //Strip first binary header |
1620 | 1620 | $font = substr($font, 6); |
1621 | 1621 | } |
1622 | 1622 | if ($header && ord($font[$info['length1']]) == 128) { |
1623 | 1623 | //Strip second binary header |
1624 | - $font = substr($font, 0, $info['length1']).substr($font, $info['length1']+6); |
|
1624 | + $font = substr($font, 0, $info['length1']) . substr($font, $info['length1'] + 6); |
|
1625 | 1625 | } |
1626 | 1626 | } |
1627 | - $this->out('<</Length '.strlen($font)); |
|
1627 | + $this->out('<</Length ' . strlen($font)); |
|
1628 | 1628 | if ($compressed) { |
1629 | 1629 | $this->out('/Filter /FlateDecode'); |
1630 | 1630 | } |
1631 | - $this->out('/Length1 '.$info['length1']); |
|
1631 | + $this->out('/Length1 ' . $info['length1']); |
|
1632 | 1632 | if (isset($info['length2'])) { |
1633 | - $this->out('/Length2 '.$info['length2'].' /Length3 0'); |
|
1633 | + $this->out('/Length2 ' . $info['length2'] . ' /Length3 0'); |
|
1634 | 1634 | } |
1635 | 1635 | $this->out('>>'); |
1636 | 1636 | $this->putStream($font); |
@@ -1638,32 +1638,32 @@ discard block |
||
1638 | 1638 | } |
1639 | 1639 | foreach ($this->fonts as $k => $font) { |
1640 | 1640 | //Font objects |
1641 | - $this->fonts[$k]['n']=$this->n+1; |
|
1641 | + $this->fonts[$k]['n'] = $this->n + 1; |
|
1642 | 1642 | $type = $font['type']; |
1643 | 1643 | $name = $font['name']; |
1644 | 1644 | if ($type == 'core') { |
1645 | 1645 | //Standard font |
1646 | 1646 | $this->newObj(); |
1647 | 1647 | $this->out('<</Type /Font'); |
1648 | - $this->out('/BaseFont /'.$name); |
|
1648 | + $this->out('/BaseFont /' . $name); |
|
1649 | 1649 | $this->out('/Subtype /Type1'); |
1650 | 1650 | if ($name != 'Symbol' && $name != 'ZapfDingbats') { |
1651 | 1651 | $this->out('/Encoding /WinAnsiEncoding'); |
1652 | 1652 | } |
1653 | 1653 | $this->out('>>'); |
1654 | 1654 | $this->out('endobj'); |
1655 | - } elseif ($type=='Type1' || $type=='TrueType') { |
|
1655 | + } elseif ($type == 'Type1' || $type == 'TrueType') { |
|
1656 | 1656 | //Additional Type1 or TrueType font |
1657 | 1657 | $this->newObj(); |
1658 | 1658 | $this->out('<</Type /Font'); |
1659 | - $this->out('/BaseFont /'.$name); |
|
1660 | - $this->out('/Subtype /'.$type); |
|
1659 | + $this->out('/BaseFont /' . $name); |
|
1660 | + $this->out('/Subtype /' . $type); |
|
1661 | 1661 | $this->out('/FirstChar 32 /LastChar 255'); |
1662 | - $this->out('/Widths '.($this->n+1).' 0 R'); |
|
1663 | - $this->out('/FontDescriptor '.($this->n+2).' 0 R'); |
|
1662 | + $this->out('/Widths ' . ($this->n + 1) . ' 0 R'); |
|
1663 | + $this->out('/FontDescriptor ' . ($this->n + 2) . ' 0 R'); |
|
1664 | 1664 | if ($font['enc']) { |
1665 | 1665 | if (isset($font['diff'])) { |
1666 | - $this->out('/Encoding '.($nf+$font['diff']).' 0 R'); |
|
1666 | + $this->out('/Encoding ' . ($nf + $font['diff']) . ' 0 R'); |
|
1667 | 1667 | } else { |
1668 | 1668 | $this->out('/Encoding /WinAnsiEncoding'); |
1669 | 1669 | } |
@@ -1672,30 +1672,30 @@ discard block |
||
1672 | 1672 | $this->out('endobj'); |
1673 | 1673 | //Widths |
1674 | 1674 | $this->newObj(); |
1675 | - $cw =& $font['cw']; |
|
1675 | + $cw = & $font['cw']; |
|
1676 | 1676 | $s = '['; |
1677 | - for ($i=32; $i<=255; $i++) { |
|
1678 | - $s .= $cw[chr($i)].' '; |
|
1677 | + for ($i = 32; $i <= 255; $i++) { |
|
1678 | + $s .= $cw[chr($i)] . ' '; |
|
1679 | 1679 | } |
1680 | - $this->out($s.']'); |
|
1680 | + $this->out($s . ']'); |
|
1681 | 1681 | $this->out('endobj'); |
1682 | 1682 | //Descriptor |
1683 | 1683 | $this->newObj(); |
1684 | - $s='<</Type /FontDescriptor /FontName /'.$name; |
|
1684 | + $s = '<</Type /FontDescriptor /FontName /' . $name; |
|
1685 | 1685 | foreach ($font['desc'] as $k => $v) { |
1686 | - $s .= ' /'.$k.' '.$v; |
|
1686 | + $s .= ' /' . $k . ' ' . $v; |
|
1687 | 1687 | } |
1688 | - $file=$font['file']; |
|
1688 | + $file = $font['file']; |
|
1689 | 1689 | if ($file) { |
1690 | - $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->fontFiles[$file]['n'].' 0 R'; |
|
1690 | + $s .= ' /FontFile' . ($type == 'Type1' ? '' : '2') . ' ' . $this->fontFiles[$file]['n'] . ' 0 R'; |
|
1691 | 1691 | } |
1692 | - $this->out($s.'>>'); |
|
1692 | + $this->out($s . '>>'); |
|
1693 | 1693 | $this->out('endobj'); |
1694 | 1694 | } else { |
1695 | 1695 | //Allow for additional types |
1696 | - $mtd='_put'.strtolower($type); |
|
1696 | + $mtd = '_put' . strtolower($type); |
|
1697 | 1697 | if (!method_exists($this, $mtd)) { |
1698 | - $this->error('Unsupported font type: '.$type); |
|
1698 | + $this->error('Unsupported font type: ' . $type); |
|
1699 | 1699 | } |
1700 | 1700 | $this->$mtd($font); |
1701 | 1701 | } |
@@ -1706,44 +1706,44 @@ discard block |
||
1706 | 1706 | { |
1707 | 1707 | $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; |
1708 | 1708 | reset($this->images); |
1709 | - while (list($file,$info) = each($this->images)) { |
|
1709 | + while (list($file, $info) = each($this->images)) { |
|
1710 | 1710 | $this->newObj(); |
1711 | 1711 | $this->images[$file]['n'] = $this->n; |
1712 | 1712 | $this->out('<</Type /XObject'); |
1713 | 1713 | $this->out('/Subtype /Image'); |
1714 | - $this->out('/Width '.$info['w']); |
|
1715 | - $this->out('/Height '.$info['h']); |
|
1716 | - if ($info['cs']=='Indexed') { |
|
1717 | - $this->out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); |
|
1714 | + $this->out('/Width ' . $info['w']); |
|
1715 | + $this->out('/Height ' . $info['h']); |
|
1716 | + if ($info['cs'] == 'Indexed') { |
|
1717 | + $this->out('/ColorSpace [/Indexed /DeviceRGB ' . (strlen($info['pal']) / 3 - 1) . ' ' . ($this->n + 1) . ' 0 R]'); |
|
1718 | 1718 | } else { |
1719 | - $this->out('/ColorSpace /'.$info['cs']); |
|
1720 | - if ($info['cs']=='DeviceCMYK') { |
|
1719 | + $this->out('/ColorSpace /' . $info['cs']); |
|
1720 | + if ($info['cs'] == 'DeviceCMYK') { |
|
1721 | 1721 | $this->out('/Decode [1 0 1 0 1 0 1 0]'); |
1722 | 1722 | } |
1723 | 1723 | } |
1724 | - $this->out('/BitsPerComponent '.$info['bpc']); |
|
1724 | + $this->out('/BitsPerComponent ' . $info['bpc']); |
|
1725 | 1725 | if (isset($info['f'])) { |
1726 | - $this->out('/Filter /'.$info['f']); |
|
1726 | + $this->out('/Filter /' . $info['f']); |
|
1727 | 1727 | } |
1728 | 1728 | if (isset($info['parms'])) { |
1729 | 1729 | $this->out($info['parms']); |
1730 | 1730 | } |
1731 | 1731 | if (isset($info['trns']) && is_array($info['trns'])) { |
1732 | 1732 | $trns = ''; |
1733 | - for ($i=0; $i<count($info['trns']); $i++) { |
|
1734 | - $trns.=$info['trns'][$i].' '.$info['trns'][$i].' '; |
|
1733 | + for ($i = 0; $i < count($info['trns']); $i++) { |
|
1734 | + $trns .= $info['trns'][$i] . ' ' . $info['trns'][$i] . ' '; |
|
1735 | 1735 | } |
1736 | - $this->out('/Mask ['.$trns.']'); |
|
1736 | + $this->out('/Mask [' . $trns . ']'); |
|
1737 | 1737 | } |
1738 | - $this->out('/Length '.strlen($info['data']).'>>'); |
|
1738 | + $this->out('/Length ' . strlen($info['data']) . '>>'); |
|
1739 | 1739 | $this->putStream($info['data']); |
1740 | 1740 | unset($this->images[$file]['data']); |
1741 | 1741 | $this->out('endobj'); |
1742 | 1742 | //Palette |
1743 | 1743 | if ($info['cs'] == 'Indexed') { |
1744 | 1744 | $this->newObj(); |
1745 | - $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
1746 | - $this->out('<<'.$filter.'/Length '.strlen($pal).'>>'); |
|
1745 | + $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
1746 | + $this->out('<<' . $filter . '/Length ' . strlen($pal) . '>>'); |
|
1747 | 1747 | $this->putStream($pal); |
1748 | 1748 | $this->out('endobj'); |
1749 | 1749 | } |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | protected function putXobjectDict() |
1754 | 1754 | { |
1755 | 1755 | foreach ($this->images as $image) { |
1756 | - $this->out('/I'.$image['i'].' '.$image['n'].' 0 R'); |
|
1756 | + $this->out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
1757 | 1757 | } |
1758 | 1758 | } |
1759 | 1759 | |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | $this->out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
1763 | 1763 | $this->out('/Font <<'); |
1764 | 1764 | foreach ($this->fonts as $font) { |
1765 | - $this->out('/F'.$font['i'].' '.$font['n'].' 0 R'); |
|
1765 | + $this->out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
1766 | 1766 | } |
1767 | 1767 | $this->out('>>'); |
1768 | 1768 | $this->out('/XObject <<'); |
@@ -1785,57 +1785,57 @@ discard block |
||
1785 | 1785 | |
1786 | 1786 | protected function putInfo() |
1787 | 1787 | { |
1788 | - $this->out('/Producer '.$this->textString('FPDF '. self::FPDF_VERSION)); |
|
1788 | + $this->out('/Producer ' . $this->textString('FPDF ' . self::FPDF_VERSION)); |
|
1789 | 1789 | if (!empty($this->title)) { |
1790 | - $this->out('/Title '.$this->textString($this->title)); |
|
1790 | + $this->out('/Title ' . $this->textString($this->title)); |
|
1791 | 1791 | } |
1792 | 1792 | if (!empty($this->subject)) { |
1793 | - $this->out('/Subject '.$this->textString($this->subject)); |
|
1793 | + $this->out('/Subject ' . $this->textString($this->subject)); |
|
1794 | 1794 | } |
1795 | 1795 | if (!empty($this->author)) { |
1796 | - $this->out('/Author '.$this->textString($this->author)); |
|
1796 | + $this->out('/Author ' . $this->textString($this->author)); |
|
1797 | 1797 | } |
1798 | 1798 | if (!empty($this->keywords)) { |
1799 | - $this->out('/Keywords '.$this->textString($this->keywords)); |
|
1799 | + $this->out('/Keywords ' . $this->textString($this->keywords)); |
|
1800 | 1800 | } |
1801 | 1801 | if (!empty($this->creator)) { |
1802 | - $this->out('/Creator '.$this->textString($this->creator)); |
|
1802 | + $this->out('/Creator ' . $this->textString($this->creator)); |
|
1803 | 1803 | } |
1804 | - $this->out('/CreationDate '.$this->textString('D:'.@date('YmdHis'))); |
|
1804 | + $this->out('/CreationDate ' . $this->textString('D:' . @date('YmdHis'))); |
|
1805 | 1805 | } |
1806 | 1806 | |
1807 | 1807 | protected function putCatalog() |
1808 | 1808 | { |
1809 | 1809 | $this->out('/Type /Catalog'); |
1810 | 1810 | $this->out('/Pages 1 0 R'); |
1811 | - if ($this->zoomMode=='fullpage') { |
|
1811 | + if ($this->zoomMode == 'fullpage') { |
|
1812 | 1812 | $this->out('/OpenAction [3 0 R /Fit]'); |
1813 | - } elseif ($this->zoomMode=='fullwidth') { |
|
1813 | + } elseif ($this->zoomMode == 'fullwidth') { |
|
1814 | 1814 | $this->out('/OpenAction [3 0 R /FitH null]'); |
1815 | - } elseif ($this->zoomMode=='real') { |
|
1815 | + } elseif ($this->zoomMode == 'real') { |
|
1816 | 1816 | $this->out('/OpenAction [3 0 R /XYZ null null 1]'); |
1817 | 1817 | } elseif (!is_string($this->zoomMode)) { |
1818 | - $this->out('/OpenAction [3 0 R /XYZ null null '.($this->zoomMode/100).']'); |
|
1818 | + $this->out('/OpenAction [3 0 R /XYZ null null ' . ($this->zoomMode / 100) . ']'); |
|
1819 | 1819 | } |
1820 | - if ($this->layoutMode=='single') { |
|
1820 | + if ($this->layoutMode == 'single') { |
|
1821 | 1821 | $this->out('/PageLayout /SinglePage'); |
1822 | - } elseif ($this->layoutMode=='continuous') { |
|
1822 | + } elseif ($this->layoutMode == 'continuous') { |
|
1823 | 1823 | $this->out('/PageLayout /OneColumn'); |
1824 | - } elseif ($this->layoutMode=='two') { |
|
1824 | + } elseif ($this->layoutMode == 'two') { |
|
1825 | 1825 | $this->out('/PageLayout /TwoColumnLeft'); |
1826 | 1826 | } |
1827 | 1827 | } |
1828 | 1828 | |
1829 | 1829 | protected function putHeader() |
1830 | 1830 | { |
1831 | - $this->out('%PDF-'.$this->pdfVersion); |
|
1831 | + $this->out('%PDF-' . $this->pdfVersion); |
|
1832 | 1832 | } |
1833 | 1833 | |
1834 | 1834 | protected function putTrailer() |
1835 | 1835 | { |
1836 | - $this->out('/Size '.($this->n+1)); |
|
1837 | - $this->out('/Root '.$this->n.' 0 R'); |
|
1838 | - $this->out('/Info '.($this->n-1).' 0 R'); |
|
1836 | + $this->out('/Size ' . ($this->n + 1)); |
|
1837 | + $this->out('/Root ' . $this->n . ' 0 R'); |
|
1838 | + $this->out('/Info ' . ($this->n - 1) . ' 0 R'); |
|
1839 | 1839 | } |
1840 | 1840 | |
1841 | 1841 | protected function endDoc() |
@@ -1856,11 +1856,11 @@ discard block |
||
1856 | 1856 | $this->out('>>'); |
1857 | 1857 | $this->out('endobj'); |
1858 | 1858 | //Cross-ref |
1859 | - $o=strlen($this->buffer); |
|
1859 | + $o = strlen($this->buffer); |
|
1860 | 1860 | $this->out('xref'); |
1861 | - $this->out('0 '.($this->n+1)); |
|
1861 | + $this->out('0 ' . ($this->n + 1)); |
|
1862 | 1862 | $this->out('0000000000 65535 f '); |
1863 | - for ($i=1; $i<=$this->n; $i++) { |
|
1863 | + for ($i = 1; $i <= $this->n; $i++) { |
|
1864 | 1864 | $this->out(sprintf('%010d 00000 n ', $this->offsets[$i])); |
1865 | 1865 | } |
1866 | 1866 | //Trailer |
@@ -1871,6 +1871,6 @@ discard block |
||
1871 | 1871 | $this->out('startxref'); |
1872 | 1872 | $this->out($o); |
1873 | 1873 | $this->out('%%EOF'); |
1874 | - $this->state=3; |
|
1874 | + $this->state = 3; |
|
1875 | 1875 | } |
1876 | 1876 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | -for ($i=0; $i<=255; $i++) { |
|
3 | - $fpdf_charwidths['courier'][chr($i)]=600; |
|
2 | +for ($i = 0; $i <= 255; $i++) { |
|
3 | + $fpdf_charwidths['courier'][chr($i)] = 600; |
|
4 | 4 | } |
5 | -$fpdf_charwidths['courierB']=$fpdf_charwidths['courier']; |
|
6 | -$fpdf_charwidths['courierI']=$fpdf_charwidths['courier']; |
|
7 | -$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier']; |
|
5 | +$fpdf_charwidths['courierB'] = $fpdf_charwidths['courier']; |
|
6 | +$fpdf_charwidths['courierI'] = $fpdf_charwidths['courier']; |
|
7 | +$fpdf_charwidths['courierBI'] = $fpdf_charwidths['courier']; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | if (substr($xmlString, 0, 1) != '<') { |
36 | 36 | throw new InvalidArgumentException($msg); |
37 | 37 | } |
38 | - if (! $this->loadXML($xmlString, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG)) { |
|
38 | + if (!$this->loadXML($xmlString, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG)) { |
|
39 | 39 | throw new InvalidArgumentException($msg); |
40 | 40 | } |
41 | 41 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (empty($node)) { |
77 | 77 | return ''; |
78 | 78 | } |
79 | - $texto = ! empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? |
|
79 | + $texto = !empty($node->getElementsByTagName($name)->item(0)->nodeValue) ? |
|
80 | 80 | $node->getElementsByTagName($name)->item(0)->nodeValue : ''; |
81 | 81 | return html_entity_decode($texto, ENT_QUOTES, 'UTF-8'); |
82 | 82 | } |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | public function getChave($nodeName = 'infNFe') |
106 | 106 | { |
107 | 107 | $node = $this->getElementsByTagName($nodeName)->item(0); |
108 | - if (! empty($node)) { |
|
108 | + if (!empty($node)) { |
|
109 | 109 | $chaveId = $node->getAttribute("Id"); |
110 | - $chave = preg_replace('/[^0-9]/', '', $chaveId); |
|
110 | + $chave = preg_replace('/[^0-9]/', '', $chaveId); |
|
111 | 111 | return $chave; |
112 | 112 | } |
113 | 113 | return ''; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | public function addArrayChild(&$parent, $arr) |
198 | 198 | { |
199 | 199 | $num = 0; |
200 | - if (! empty($arr) && ! empty($parent)) { |
|
200 | + if (!empty($arr) && !empty($parent)) { |
|
201 | 201 | foreach ($arr as $node) { |
202 | 202 | $this->appChild($parent, $node, ''); |
203 | 203 | $num++; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
98 | 98 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
99 | 99 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
100 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
100 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
101 | 101 | * @param string $preVisualizar 0-Não 1-Sim |
102 | 102 | */ |
103 | 103 | public function __construct( |
@@ -491,8 +491,8 @@ discard block |
||
491 | 491 | * zCabecalho |
492 | 492 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
493 | 493 | * |
494 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
495 | - * @param number $y Posição vertical inicial, canto superior |
|
494 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
495 | + * @param integer $y Posição vertical inicial, canto superior |
|
496 | 496 | * @param number $pag Número da Página |
497 | 497 | * @param number $totPag Total de páginas |
498 | 498 | * @return number Posição vertical final |
@@ -1091,8 +1091,7 @@ discard block |
||
1091 | 1091 | * rodapeDACTE |
1092 | 1092 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
1093 | 1093 | * |
1094 | - * @param number $xInic Posição horizontal canto esquerdo |
|
1095 | - * @param number $yFinal Posição vertical final para impressão |
|
1094 | + * @param integer $x |
|
1096 | 1095 | */ |
1097 | 1096 | protected function zRodape($x, $y) |
1098 | 1097 | { |
@@ -1115,8 +1114,8 @@ discard block |
||
1115 | 1114 | * zTomador |
1116 | 1115 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1117 | 1116 | * |
1118 | - * @param number $x Posição horizontal canto esquerdo |
|
1119 | - * @param number $y Posição vertical canto superior |
|
1117 | + * @param integer $x Posição horizontal canto esquerdo |
|
1118 | + * @param integer $y Posição vertical canto superior |
|
1120 | 1119 | * @return number Posição vertical final |
1121 | 1120 | */ |
1122 | 1121 | protected function zTomador($x = 0, $y = 0) |
@@ -1204,8 +1203,8 @@ discard block |
||
1204 | 1203 | * zCompValorServ |
1205 | 1204 | * Monta o campo com os componentes da prestação de serviços. |
1206 | 1205 | * |
1207 | - * @param number $x Posição horizontal canto esquerdo |
|
1208 | - * @param number $y Posição vertical canto superior |
|
1206 | + * @param integer $x Posição horizontal canto esquerdo |
|
1207 | + * @param integer $y Posição vertical canto superior |
|
1209 | 1208 | * @return number Posição vertical final |
1210 | 1209 | */ |
1211 | 1210 | protected function zCompValorServ($x = 0, $y = 0) |
@@ -1304,8 +1303,8 @@ discard block |
||
1304 | 1303 | * zImpostos |
1305 | 1304 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1306 | 1305 | * |
1307 | - * @param number $x Posição horizontal canto esquerdo |
|
1308 | - * @param number $y Posição vertical canto superior |
|
1306 | + * @param integer $x Posição horizontal canto esquerdo |
|
1307 | + * @param integer $y Posição vertical canto superior |
|
1309 | 1308 | * @return number Posição vertical final |
1310 | 1309 | */ |
1311 | 1310 | protected function zImpostos($x = 0, $y = 0) |
@@ -1467,8 +1466,8 @@ discard block |
||
1467 | 1466 | * zInfPrestacaoServico |
1468 | 1467 | * Monta o campo com das informações da prestação do serviço |
1469 | 1468 | * |
1470 | - * @param number $x Posição horizontal canto esquerdo |
|
1471 | - * @param number $y Posição vertical canto superior |
|
1469 | + * @param integer $x Posição horizontal canto esquerdo |
|
1470 | + * @param integer $y Posição vertical canto superior |
|
1472 | 1471 | * @return number Posição vertical final |
1473 | 1472 | */ |
1474 | 1473 | protected function zInfPrestacaoServico($x = 0, $y = 0) |
@@ -1548,8 +1547,8 @@ discard block |
||
1548 | 1547 | * zDocCompl |
1549 | 1548 | * Monta o campo com os dados do remetente na DACTE. |
1550 | 1549 | * |
1551 | - * @param number $x Posição horizontal canto esquerdo |
|
1552 | - * @param number $y Posição vertical canto superior |
|
1550 | + * @param integer $x Posição horizontal canto esquerdo |
|
1551 | + * @param integer $y Posição vertical canto superior |
|
1553 | 1552 | * @return number Posição vertical final |
1554 | 1553 | */ |
1555 | 1554 | protected function zDocCompl($x = 0, $y = 0) |
@@ -1611,8 +1610,8 @@ discard block |
||
1611 | 1610 | * zObs |
1612 | 1611 | * Monta o campo com os dados do remetente na DACTE. |
1613 | 1612 | * |
1614 | - * @param number $x Posição horizontal canto esquerdo |
|
1615 | - * @param number $y Posição vertical canto superior |
|
1613 | + * @param integer $x Posição horizontal canto esquerdo |
|
1614 | + * @param integer $y Posição vertical canto superior |
|
1616 | 1615 | * @return number Posição vertical final |
1617 | 1616 | */ |
1618 | 1617 | protected function zObs($x = 0, $y = 0) |
@@ -1654,8 +1653,8 @@ discard block |
||
1654 | 1653 | * zSeguro |
1655 | 1654 | * Monta o campo com os dados de seguro do CT-e OS. |
1656 | 1655 | * |
1657 | - * @param number $x Posição horizontal canto esquerdo |
|
1658 | - * @param number $y Posição vertical canto superior |
|
1656 | + * @param integer $x Posição horizontal canto esquerdo |
|
1657 | + * @param integer $y Posição vertical canto superior |
|
1659 | 1658 | * @return number Posição vertical final |
1660 | 1659 | */ |
1661 | 1660 | protected function zSeguro($x = 0, $y = 0) |
@@ -1715,8 +1714,8 @@ discard block |
||
1715 | 1714 | * zModalRod |
1716 | 1715 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1717 | 1716 | * |
1718 | - * @param number $x Posição horizontal canto esquerdo |
|
1719 | - * @param number $y Posição vertical canto superior |
|
1717 | + * @param integer $x Posição horizontal canto esquerdo |
|
1718 | + * @param integer $y Posição vertical canto superior |
|
1720 | 1719 | * @return number Posição vertical final |
1721 | 1720 | */ |
1722 | 1721 | protected function zModalRod($x = 0, $y = 0) |
@@ -1803,8 +1802,8 @@ discard block |
||
1803 | 1802 | * zModalAquaviario |
1804 | 1803 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1805 | 1804 | * |
1806 | - * @param number $x Posição horizontal canto esquerdo |
|
1807 | - * @param number $y Posição vertical canto superior |
|
1805 | + * @param integer $x Posição horizontal canto esquerdo |
|
1806 | + * @param integer $y Posição vertical canto superior |
|
1808 | 1807 | * @return number Posição vertical final |
1809 | 1808 | */ |
1810 | 1809 | protected function zModalAquaviario($x = 0, $y = 0) |
@@ -1973,8 +1972,8 @@ discard block |
||
1973 | 1972 | * zModalFerr |
1974 | 1973 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
1975 | 1974 | * |
1976 | - * @param number $x Posição horizontal canto esquerdo |
|
1977 | - * @param number $y Posição vertical canto superior |
|
1975 | + * @param integer $x Posição horizontal canto esquerdo |
|
1976 | + * @param integer $y Posição vertical canto superior |
|
1978 | 1977 | * @return number Posição vertical final |
1979 | 1978 | */ |
1980 | 1979 | protected function zModalFerr($x = 0, $y = 0) |
@@ -2251,8 +2250,8 @@ discard block |
||
2251 | 2250 | * zCanhoto |
2252 | 2251 | * Monta o campo com os dados do remetente na DACTE. |
2253 | 2252 | * |
2254 | - * @param number $x Posição horizontal canto esquerdo |
|
2255 | - * @param number $y Posição vertical canto superior |
|
2253 | + * @param integer $x Posição horizontal canto esquerdo |
|
2254 | + * @param integer $y Posição vertical canto superior |
|
2256 | 2255 | * @return number Posição vertical final |
2257 | 2256 | */ |
2258 | 2257 | protected function zCanhoto($x = 0, $y = 0) |
@@ -2336,9 +2335,10 @@ discard block |
||
2336 | 2335 | * zDadosAdic |
2337 | 2336 | * Coloca o grupo de dados adicionais da DACTE. |
2338 | 2337 | * |
2339 | - * @param number $x Posição horizontal canto esquerdo |
|
2340 | - * @param number $y Posição vertical canto superior |
|
2341 | - * @param number $h altura do campo |
|
2338 | + * @param integer $x Posição horizontal canto esquerdo |
|
2339 | + * @param double $y Posição vertical canto superior |
|
2340 | + * @param integer $h altura do campo |
|
2341 | + * @param integer $pag |
|
2342 | 2342 | * @return number Posição vertical final |
2343 | 2343 | */ |
2344 | 2344 | protected function zDadosAdic($x, $y, $pag, $h) |
@@ -2419,11 +2419,11 @@ discard block |
||
2419 | 2419 | * zhDashedLine |
2420 | 2420 | * Desenha uma linha horizontal tracejada com o FPDF |
2421 | 2421 | * |
2422 | - * @param number $x Posição horizontal inicial, em mm |
|
2423 | - * @param number $y Posição vertical inicial, em mm |
|
2422 | + * @param integer $x Posição horizontal inicial, em mm |
|
2423 | + * @param integer $y Posição vertical inicial, em mm |
|
2424 | 2424 | * @param number $w Comprimento da linha, em mm |
2425 | - * @param number $h Espessura da linha, em mm |
|
2426 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
2425 | + * @param double $h Espessura da linha, em mm |
|
2426 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
2427 | 2427 | * @return none |
2428 | 2428 | */ |
2429 | 2429 | protected function zhDashedLine($x, $y, $w, $h, $n) |
@@ -2582,7 +2582,7 @@ discard block |
||
2582 | 2582 | * Fornece a imformação multiplicação de peso contida na CTe |
2583 | 2583 | * |
2584 | 2584 | * @param interger $U Informação de peso extraida da CTe |
2585 | - * @return interger |
|
2585 | + * @return integer |
|
2586 | 2586 | */ |
2587 | 2587 | protected function zMultiUniPeso($U = '') |
2588 | 2588 | { |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $y += 19; |
376 | 376 | $x = $xInic; |
377 | 377 | $r = $this->zSeguro($x, $y); |
378 | - $y = $y-12; |
|
378 | + $y = $y - 12; |
|
379 | 379 | |
380 | 380 | |
381 | 381 | switch ($this->modal) { |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | 'font' => $this->fontePadrao, |
581 | 581 | 'size' => 7, |
582 | 582 | 'style' => ''); |
583 | - $fone = $this->pSimpleGetValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
583 | + $fone = $this->pSimpleGetValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
584 | 584 | $lgr = $this->pSimpleGetValue($this->enderEmit, "xLgr"); |
585 | 585 | $nro = $this->pSimpleGetValue($this->enderEmit, "nro"); |
586 | 586 | $cpl = $this->pSimpleGetValue($this->enderEmit, "xCpl"); |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | $this->pdf->SetTextColor(0, 0, 0); |
969 | 969 | } |
970 | 970 | //indicar sem valor |
971 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
971 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
972 | 972 | $x = 10; |
973 | 973 | if ($this->orientacao == 'P') { |
974 | 974 | $y = round($this->hPrint / 2, 0); |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
992 | 992 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
993 | 993 | $this->pdf->SetTextColor(0, 0, 0); |
994 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
994 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
995 | 995 | $h = 5; |
996 | 996 | $w = $maxW - (2 * 10); |
997 | 997 | $x = 55; |
@@ -1009,14 +1009,14 @@ discard block |
||
1009 | 1009 | 'size' => 41, |
1010 | 1010 | 'style' => 'B'); |
1011 | 1011 | $texto = "Sem Validade Jurídica"; |
1012 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1012 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1013 | 1013 | $this->pdf->SetTextColor(90, 90, 90); |
1014 | 1014 | $texto = "SEM VALOR FISCAL"; |
1015 | 1015 | $aFont = array( |
1016 | 1016 | 'font' => $this->fontePadrao, |
1017 | 1017 | 'size' => 48, |
1018 | 1018 | 'style' => 'B'); |
1019 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1019 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
1020 | 1020 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
1021 | 1021 | } else { |
1022 | 1022 | $x = 10; |
@@ -1102,13 +1102,13 @@ discard block |
||
1102 | 1102 | 'font' => $this->fontePadrao, |
1103 | 1103 | 'size' => 6, |
1104 | 1104 | 'style' => ''); |
1105 | - $this->pTextBox($x-1, $y+2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1106 | - $texto = $this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
1105 | + $this->pTextBox($x - 1, $y + 2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
1106 | + $texto = $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
1107 | 1107 | $aFont = array( |
1108 | 1108 | 'font' => $this->fontePadrao, |
1109 | 1109 | 'size' => 6, |
1110 | 1110 | 'style' => ''); |
1111 | - $this->pTextBox($x-50, $y+2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1111 | + $this->pTextBox($x - 50, $y + 2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
1112 | 1112 | } //fim zRodape |
1113 | 1113 | |
1114 | 1114 | /** |
@@ -1195,7 +1195,7 @@ discard block |
||
1195 | 1195 | $texto = 'FONE'; |
1196 | 1196 | $aFont = $this->formatPadrao; |
1197 | 1197 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1198 | - $texto = $this->pSimpleGetValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
1198 | + $texto = $this->pSimpleGetValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
1199 | 1199 | $aFont = $this->formatNegrito; |
1200 | 1200 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1201 | 1201 | } //fim da função tomadorDACTE |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | $aFont = $this->formatPadrao; |
1336 | 1336 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1337 | 1337 | |
1338 | - $wCol02=0.18; |
|
1338 | + $wCol02 = 0.18; |
|
1339 | 1339 | $x += $w * $wCol02; |
1340 | 1340 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1341 | 1341 | $texto = 'ALÍQ ICMS'; |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | $x += $w * $wCol02; |
1413 | 1413 | |
1414 | 1414 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
1415 | - number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
1415 | + number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
1416 | 1416 | $aFont = $this->formatNegrito; |
1417 | 1417 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1418 | 1418 | |
@@ -1640,14 +1640,14 @@ discard block |
||
1640 | 1640 | $texto .= $xObs; |
1641 | 1641 | } |
1642 | 1642 | $textoObs = explode("Motorista:", $texto); |
1643 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
1643 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
1644 | 1644 | $texto .= $this->pSimpleGetValue($this->imp, "infAdFisco", "\r\n"); |
1645 | 1645 | $aFont = array( |
1646 | 1646 | 'font' => $this->fontePadrao, |
1647 | 1647 | 'size' => 7.5, |
1648 | 1648 | 'style' => ''); |
1649 | 1649 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
1650 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
1650 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
1651 | 1651 | } //fim da função obsDACTE |
1652 | 1652 | |
1653 | 1653 | /** |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | $aFont = $this->formatPadrao; |
1686 | 1686 | $this->pTextBox($x, $y, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1687 | 1687 | |
1688 | - $wCol02=0.33; |
|
1688 | + $wCol02 = 0.33; |
|
1689 | 1689 | $x += $w * $wCol02; |
1690 | 1690 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1691 | 1691 | $texto = 'NÚMERO DA APÓLICE'; |
@@ -1745,7 +1745,7 @@ discard block |
||
1745 | 1745 | $aFont = $this->formatPadrao; |
1746 | 1746 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1747 | 1747 | |
1748 | - $wCol02=0.18; |
|
1748 | + $wCol02 = 0.18; |
|
1749 | 1749 | $x += $w * $wCol02; |
1750 | 1750 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
1751 | 1751 | $texto = 'PLACA DO VEÍCULO'; |
@@ -1787,8 +1787,7 @@ discard block |
||
1787 | 1787 | $x += $w * $wCol02; |
1788 | 1788 | |
1789 | 1789 | $texto = !empty($this->pSimpleGetValue($this->veic->item(0), "CPF")) ? |
1790 | - $this->pSimpleGetValue($this->veic->item(0), "CPF") : |
|
1791 | - (!empty($this->pSimpleGetValue($this->veic->item(0), "CNPJ")) ? |
|
1790 | + $this->pSimpleGetValue($this->veic->item(0), "CPF") : (!empty($this->pSimpleGetValue($this->veic->item(0), "CNPJ")) ? |
|
1792 | 1791 | $this->pSimpleGetValue($this->veic->item(0), "CNPJ") : ''); |
1793 | 1792 | $aFont = $this->formatNegrito; |
1794 | 1793 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2257,7 +2256,7 @@ discard block |
||
2257 | 2256 | */ |
2258 | 2257 | protected function zCanhoto($x = 0, $y = 0) |
2259 | 2258 | { |
2260 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
2259 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
2261 | 2260 | $y = $y + 2; |
2262 | 2261 | $oldX = $x; |
2263 | 2262 | $oldY = $y; |
@@ -2296,7 +2295,7 @@ discard block |
||
2296 | 2295 | |
2297 | 2296 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
2298 | 2297 | |
2299 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
2298 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
2300 | 2299 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
2301 | 2300 | $aFont = array( |
2302 | 2301 | 'font' => $this->fontePadrao, |
@@ -2306,14 +2305,14 @@ discard block |
||
2306 | 2305 | $x = $oldX; |
2307 | 2306 | $y = $y + 5; |
2308 | 2307 | |
2309 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
2308 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
2310 | 2309 | |
2311 | 2310 | $texto = 'RG'; |
2312 | 2311 | $aFont = array( |
2313 | 2312 | 'font' => $this->fontePadrao, |
2314 | 2313 | 'size' => 6, |
2315 | 2314 | 'style' => ''); |
2316 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2315 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
2317 | 2316 | $x += $w * 0.85; |
2318 | 2317 | |
2319 | 2318 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |