D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Views
/
MovimentoCpCr
/
Filename :
imprimeVencimentoCpCr.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); //$filial_nome = $Dados['filial_nome']; $tipo = $Dados['tipo']; $datai = $Dados['datai']; $datai = date("d/m/Y", strtotime($datai)); $dataf = $Dados['dataf']; $dataf = date("d/m/Y", strtotime($dataf)); $gre_empr_princ_id = $Dados['gre_empr_princ_id']; $gre_filial_id = $Dados['gre_filial_id']; $Lanc = new \App\gre\Models\GreLerVencimentoCpCr(); $arr = $Lanc->lerLanc($Dados); $num_linhas = 40; $cont_linha = 9999; $total = 0; $total_item = 0; $sub_total = 0; $temVenc = 0; $impr_span = 0; $vencido_original = 0; $vencido_juros =0; $vencido_multa = 0; $vencido_total = 0; //var_dump($arr); $venc_ant = ""; //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'].'/idoso/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) { $venc_ant = $vencimento; } $pdf->AddPage('P','A4'); $pdf->SetFont('Arial','B',11 ); $pdf->SetX(35); $pdf->Image(URLADM . 'assets/imagens/logo_login/'.$_SESSION['id_user'].'/logo_header.png',35,13,20,0,'PNG'); $pdf->Cell(130,11, ' RELATORIO POR VENCIMENTO - ' . utf8_decode($tipo_nome) ,'1',1,'C'); $pdf->SetX(35); $pdf->SetFont('arial','BI',11); $pdf->Cell(25,7,' Unidade: ','1',0,'L'); $pdf->SetFont('arial','',11); $pdf->Cell(60,7, ' '.utf8_decode($filial_nome) ,'1',0,'L'); $pdf->Cell(45,7,utf8_decode($data_imp.' hs'),1,1,'R'); $pdf->SetX(35); $pdf->SetFont('arial','B',11); $pdf->Cell(130,7, 'Vencimento de ' . $datai . utf8_decode(' à ') .$dataf,'1',1,'C'); $pdf->SetX(35); $pdf->SetFont('arial','B',11); $pdf->Cell(80,7, utf8_decode('Conta'),'1',0,'C'); $pdf->Cell(25,7, 'Vencimento','1',0,'C'); $pdf->Cell(25,7, 'Valor','1',1,'C'); $cont_linha = 0; } $pdf->SetX(35); $pdf->SetFont('arial','',11); $total_item = $valor_original + $valor_juros + $valor_multa; if($vencimento <> $venc_ant){ $pdf->SetX(35); $pdf->SetFont('arial','BI',11); $pdf->Cell(105,7, ' ' . 'Total do Dia: ','1',0,'L'); $pdf->Cell(25,7, number_format($sub_total, 2, ',', '.') .' ' ,'1',1,'R'); $venc_ant = $vencimento; $sub_total = 0; } $pdf->SetX(35); $pdf->SetFont('arial','',11); $pdf->Cell(80,7, ' ' . $conta_nome,'1',0,'L'); $pdf->Cell(25,7, $vencimento,'1',0,'C'); $pdf->Cell(25,7, number_format($total_item, 2, ',', '.') .' ' ,'1',1,'R'); $sub_total = $sub_total + $total_item; } $cont_linha = $cont_linha + 1; $total = $total + $total_item; $pdf->SetX(35); $pdf->SetFont('arial','BI',11); $pdf->Cell(105,7, ' ' . 'Total do Dia: ','1',0,'L'); $pdf->Cell(25,7, number_format($sub_total, 2, ',', '.') .' ' ,'1',1,'R'); $pdf->SetX(35); $pdf->SetFont('arial','B',11); $pdf->Cell(105,7, utf8_decode('Total do Período.. '),'1',0,'R'); $pdf->Cell(25,7, number_format($total, 2, ',', '.').' ','1',1,'R'); //$pdf->Ln(8); $pdf->Output(); //ob_end_flush(); ?>