Path: C:\
<?php
$media=sprintf("%01.2f", $_GET['media']);
$minima=sprintf("%01.2f", $_GET['minima']);
$maxima=sprintf("%01.2f", $_GET['maxima']);
$Umedia=sprintf("%01.2f", $_GET['Umedia']);
$Uminima=sprintf("%01.2f", $_GET['Uminima']);
$Umaxima=sprintf("%01.2f", $_GET['Umaxima']);
$rt[1]='Giovana Albernaz Trevisan';
$rt[2]='Rodolfo Max Welendorf';
$crf[1]='CRF35063';
$crf[2]='CRF89988';
require('fpdf.php');
class PDF extends FPDF
{
function LoadData($file)
{
$lines = file($file);
$data = array();
foreach($lines as $line)
$data[] = explode(';',trim($line));
return $data;
}
function FancyTable($data,$med,$min,$max,$rt1,$crf1,$Umed,$Umin,$Umax)
{
$this->SetFillColor(255,255,255);
$this->SetDrawColor(0);
$this->SetLineWidth(.2);
$this->SetTextColor(0);
$this->SetFont('Arial','B',13);
$this->Cell(40,24,'',1,0,'C',true);
$this->Cell(115,24,utf8_decode('RELATÓRIO TÉRMICO'),1,0,'C',true);
$this->SetFont('Arial','B',8);
$this->Cell(40,4,utf8_decode('Código:'),'TLR',0,'L',true);
$this->Ln(4);
$this->SetFont('Arial','','8');
$this->Cell(155);
$this->Cell(40,4,'FO.02.10.RT','LRB',0,'C',true);
$this->Ln(4);
$this->SetFont('Arial','B','8');
$this->Cell(155);
$this->Cell(40,4,utf8_decode('Revisão:'),'LR',0,'L',true);
$this->Ln(4);
$this->SetFont('Arial','','8');
$this->Cell(155);
$this->Cell(40,4,'00','LRB',0,'C',true);
$this->Ln(4);
$this->SetFont('Arial','B','8');
$this->Cell(155);
$this->Cell(40,4,utf8_decode('Válido até:'),'LR',0,'L',true);
$this->Ln(4);
$this->SetFont('Arial','','8');
$this->Cell(155);
$this->Cell(40,4,'05/09/25','LRB',0,'C',true);
$this->Image('logo.png',13,17,36);
$this->Ln(9);
$this->SetFillColor(164,164,164);
$this->SetTextColor(0);
$this->SetDrawColor(0);
$this->SetDrawColor(0);
$this->SetLineWidth(.2);
$this->SetFont('Arial','B','10');
$this->Cell(30,7,'ORDEM DE','TLR',0,'C',true);
$this->Cell(46,7,'PLACAS',1,0,'C',true);
$this->Cell(119,14,'MOTORISTA',1,0,'C',true);
$this->Ln(7);
$this->Cell(30,7,'COLETA','BLR',0,'C',true);
$this->Cell(23,7,utf8_decode('VEÍCULO'),'TLR',0,'C',true);
$this->Cell(23,7,'CARRETA','TLR',0,'C',true);
$this->Ln();
$this->SetFillColor(224,235,255);
$this->SetTextColor(0);
$this->SetFont('Arial','B','20');
$fill = false;
$this->Cell(30,14,$data[4][0],1,0,'C',$fill);
$this->SetFont('Arial','B','10');
$this->Cell(23,14,$data[0][0],1,0,'C',$fill);
$this->Cell(23,14,$data[0][1],1,0,'C',$fill);
$this->Cell(119,14,utf8_decode($data[0][2]),1,0,'C',$fill);
$this->Ln();
$fill = !$fill;
$this->Cell(195,0,'','T');
$this->Ln(2);
$this->SetFillColor(255,255,255);
$this->SetTextColor(0);
$this->SetDrawColor(0);
$this->SetLineWidth(.8);
$this->SetFont('Arial','B','10');
$this->Cell(53,7,utf8_decode('INÍCIO:'),'R',0,'R',true);
$this->Cell(23,7,$data[1][0],1,0,'C',true);
$this->Cell(96,7,'FIM:','LR',0,'R',true);
$this->Cell(23,7,$data[1][1],1,0,'C',true);
$this->Ln(9);
$this->Cell(53,7,'HORA DO CARREGAMENTO:','R',0,'R',true);
$this->Cell(23,7,$data[2][0],1,0,'C',true);
$this->Cell(96,7,'HORA DO DESCARREGAMENTO:','LR',0,'R',true);
$this->Cell(23,7,$data[2][1],1,0,'C',true);
$this->Ln(9);
$this->Cell(53,7,utf8_decode('TEMPERATURA MÍNIMA:'),'R',0,'R',true);
$this->Cell(23,7,$data[3][0],1,0,'C',true);
$this->Cell(96,7,utf8_decode('TEMPERATURA MÁXIMA:'),'LR',0,'R',true);
$this->Cell(23,7,$data[3][1],1,0,'C',true);
$this->Ln(2);
$this->SetLineWidth(.2);
$this->SetDrawColor(0);
$this->SetFont('Arial','',10);
$this->Ln(7);
$this->Cell(195,93,'',1,0,'L',true);
$this->Image('grafico.png',14,97,190);
$this->Image('grafico2.png',11,148,190);
$this->Ln(94);
$this->Cell(30,5,utf8_decode('Umidade Mínima:'),'R',0,'R',true);
$this->Cell(20,5,$Umin.utf8_decode(' %'),1,0,'C',true);
$this->Cell(105);
$this->Cell(20,5,utf8_decode('Temperatura Mínima:'),'R',0,'R',true);
$this->Cell(20,5,$min.utf8_decode(' ºC'),1,0,'C',true);
$this->Ln(6);
$this->Cell(30,5,utf8_decode('Umidade Máxima:'),'R',0,'R',true);
$this->Cell(20,5,$Umax.utf8_decode(' %'),1,0,'C',true);
$this->Cell(105);
$this->Cell(20,5,utf8_decode('Temperatura Máxima:'),'R',0,'R',true);
$this->Cell(20,5,$max.utf8_decode(' ºC'),1,0,'C',true);
$this->Ln(6);
$this->Cell(30,5,utf8_decode('Média:'),'R',0,'R',true);
$this->Cell(20,5,$Umed.utf8_decode(' %'),1,0,'C',true);
$this->Cell(105);
$this->Cell(20,5,utf8_decode('Média:'),'R',0,'R',true);
$this->Cell(20,5,$med.utf8_decode(' ºC'),1,0,'C',true);
$this->Ln(12);
$this->Cell(50);
$this->Cell(95,7,'','B',0,'C',true);
$this->Ln(7);
$this->Cell(50);
$this->SetFont('Arial','B',10);
$this->Cell(95,7,$rt1,'T',0,'C',true);
$this->Ln(5);
$this->Cell(50);
$this->SetFont('Arial','',10);
$this->Cell(95,7,'Coord. Qualidade/RT - '.$crf1,'',0,'C',true);
$this->Ln(15);
$this->Cell(50);
$this->Cell(95,7,'','B',0,'C',true);
$this->Ln(5);
$this->Cell(50);
$this->SetFont('Arial','B',10);
$this->Cell(95,7,'Amanda Matos','T',0,'C',true);
$this->Ln(5);
$this->Cell(50);
$this->SetFont('Arial','',10);
$this->Cell(95,7,'Garantia da Qualidade','',0,'C',true);
$this->Ln(15);
$this->SetFillColor(164,164,164);
$this->SetTextColor(0);
$this->SetDrawColor(0);
$this->SetLineWidth(.2);
$this->Cell(65,5,utf8_decode('ELABORADO POR:'),1,0,'C',true);
$this->Cell(65,5,utf8_decode('VALIDADO POR:'),1,0,'C',true);
$this->Cell(65,5,utf8_decode('APROVADO POR:'),1,0,'C',true);
$this->Ln(5);
$this->Cell(65,5,utf8_decode('Aline Almeida'),1,0,'C',false);
$this->Cell(65,5,utf8_decode('Giovana Trevisan'),1,0,'C',false);
$this->Cell(65,5,utf8_decode('Daniel Lopes'),1,0,'C',false);
}
}
$pdf = new PDF();
$data = $pdf->LoadData('quali3.txt');
$pdf->SetFont('Arial','','12');
$pdf->AddPage();
$pdf->FancyTable($data,$media,$minima,$maxima,$rt[$data[3][2]],$crf[$data[3][2]],$Umedia,$Uminima,$Umaxima);
$pdf->Output();
?>