D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Trade
/
Filename :
VieTradeReceberImprime.php
back
Copy
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); ob_start(); $path = getcwd(); //VAR_DUMP(URLFPDF); $Dados = $_GET; //var_dump($Dados); $Lanc = new \App\gre\Models\ModTradeReceberLer(); $arr = $Lanc->lerLanc($Dados); $num_linhas = 22; $cont_linha = 9999; $total_bruto = 0; $total_desconto = 0; $total_liquido = 0; $inicio = ''; $fim = ''; //REQUIRE($_SERVER['DOCUMENT_ROOT'].'idoso/adm/app/gre/Views/include/fpdf/fpdf.php'); $data_imp = date("d/m/Y H:i:s"); //REQUIRE($_SERVER['DOCUMENT_ROOT'].URLFPDF.'app/gre/Views/include/fpdf/fpdf.php'); REQUIRE($_SERVER['DOCUMENT_ROOT'].'/rosario/adm/app/gre/Views/include/fpdf/fpdf.php'); define('FPDF_FONTPATH','font/'); $pdf = new FPDF(); $pdf->SetAutoPageBreak(0); foreach ($arr as $lcto) { extract($lcto); if ($cont_linha > $num_linhas) { if($cont_linha = 9999) { $inicio = $dataini; $fim = $datafim; $marca_sel = $sel_marca; } $pdf->AddPage('L','A4'); $pdf->SetFont('Arial','B',12 ); $pdf->SetX(10); $pdf->Image(URLADM . 'assets/imagens/logo_login/logo.png',20,11,15,0,'PNG'); $pdf->Cell(230,12,utf8_decode('TITULOS À RECEBER - TRADE ' ),1,0,'C'); $pdf->Cell(55,12,utf8_decode($data_imp.' hs'),1,1,'R'); $pdf->SetX(10); $pdf->Cell(100,10,utf8_decode('Opção da Marca: '.$opcao_marca ),1,0,'C'); $pdf->Cell(100,10,utf8_decode('Opção da Situação: '.$situ_nome ),1,0,'C'); $pdf->Cell(85,10,utf8_decode('Período: '). date("d/m/Y", strtotime($inicio)). utf8_decode(' à '). date("d/m/Y", strtotime($fim)) ,1,1,'C'); $pdf->SetX(10); $pdf->SetFont('arial','B',10); $pdf->Cell(40,7, utf8_decode('MARCA'),'1',0,'C'); $pdf->SetFont('arial','B',10); $pdf->Cell(50,7, utf8_decode('TIPO DE CONTRATO'),'1',0,'C'); $pdf->SetFont('arial','B',10); $pdf->Cell(20,7, utf8_decode('EMISSÃO'),'1',0,'C'); $pdf->SetFont('arial','B',10); $pdf->Cell(20,7, utf8_decode('VENCTO'),'1',0,'C'); $pdf->SetFont('arial','B',10); $pdf->Cell(25,7, utf8_decode('VLR.TITULO'),'1',0,'C'); $pdf->Cell(25,7, utf8_decode('DESC/ACRES'),'1',0,'C'); $pdf->Cell(25,7, utf8_decode('VLR.DA BAIXA'),'1',0,'C'); $pdf->Cell(25,7, utf8_decode('BAIXADO EM'),'1',0,'C'); $pdf->Cell(55,7, utf8_decode('OBSERVAÇÃO'),'1',1,'C'); $cont_linha = 0; } $pdf->SetX(10); $pdf->SetFont('arial','',10); $pdf->Cell(40,7, utf8_decode($marca_nome),1,0,'L'); $pdf->Cell(50,7, utf8_decode($tipo_nome),1,0,'L'); $pdf->Cell(20,7, date("d/m/y", strtotime($data_emissao)),1,0,'C'); $pdf->Cell(20,7, date("d/m/y", strtotime($data_vencimento)),1,0,'C'); $pdf->Cell(25,7, number_format($valor_liquido,2,',','.'),1,0,'R'); $pdf->Cell(25,7, number_format(($abatacres),2,',','.'),1,0,'R'); $pdf->Cell(25,7, number_format($valor_baixa,2,',','.'),1,0,'R'); if($data_baixa <> '') { $pdf->Cell(25,7, date("d/m/y", strtotime($data_baixa)),1,0,'C'); }else{ if( date("Y-m-d") > $data_vencimento) { $pdf->Cell(25,7, 'VENCIDO',1,0,'C'); }else { $pdf->Cell(25,7, '',1,0,'C'); } } $pdf->Cell(55,7, $observacao,1,1,'L'); $total_bruto += $valor_liquido; $total_liquido += $valor_baixa; $total_desconto += ($abatacres); $cont_linha = $cont_linha + 1; } $pdf->SetX(10); $pdf->SetFont('arial','B',10); $pdf->Cell(130,7, utf8_decode('Totais no período: '),'1',0,'R'); $pdf->Cell(25,7, number_format($total_bruto,2,',','.'),1,0,'R'); $pdf->Cell(25,7, number_format($total_desconto,2,',','.'),1,0,'R'); $pdf->Cell(25,7, number_format($total_liquido,2,',','.'),1,0,'R'); $pdf->Cell(80,7, '',1,1,'R'); $pdf->Output(); ?>