D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Controllers
/
Filename :
ViePsaudeCobAutorizaExcel.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; $Lanc = new \App\gre\Models\ModPsaudeCobAutorizaListar(); $arr = $Lanc->listarPsaudeCob($Dados); $tipo_cli_nome_sel = $arr[0]['tipo_cli_nome_sel']; date_default_timezone_set ("America/Sao_Paulo"); $data_sel = date("d/m/Y"); $dtxls = date("dmYHi"); $arquivo = "RELATÓRIO DE COBRANÇA $tipo_cli_nome_sel - "."$dtxls.xls"; header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); header ("Content-type: application/x-msexcel"); header ("Content-Disposition: attachment; filename=\"{$arquivo}\"" ); header ("Content-Description: PHP Generated Data" ); ?> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> </head> <?php $html = ""; $html .= "<table border='1'>"; $html .= "<tr>"; if($arr[0]['tipo_cli'] <> 2){ $html .="<td colspan='8'"; }else{ $html .="<td colspan='7'"; } $html .=" align='center'><b><font color='blue'> RELATÓRIO DE COBRANÇA</td>"; $html .="</tr>"; $html .= "<tr>"; If($arr[0]['tipo_cli'] <> 2){ $html .="<td colspan='8'"; }else{ $html .="<td colspan='7'"; } $html .=" align='center'><b><font color='blue'>Tipo: $tipo_cli_nome_sel</td>"; $html .="</tr>"; $html .= "<tr>"; $html .="<td align='center'><b>Tipo</td>"; if($arr[0]['tipo_cli'] <> 2){ $html .="<td align='center'><b>Empresa</td>"; } $html .="<td align='center'><b>CPF</td>"; $html .="<td align='center'><b>Cliente Pagador</td>"; $html .="<td align='center'><b>Programa</td>"; $html .="<td align='center'><b>Data Inclusão</td>"; $html .="<td align='center'><b>Dia Vencimento</td>"; $html .="<td align='center'><b>Valor</td>"; $html .="</tr>"; foreach ($arr as $lcto) { extract($lcto); $lpreco_venda = 'R$ '. number_format($preco_venda, 2, ',', '.'); $html .="<tr>"; $html .="<td align='left'> $tipo_cli_nome</td>"; if($tipo_cli <> 2){ $html .="<td align='left'> $empr_nome</td>"; } if($nome_pagador == ""){ $html .="<td align='center'>$cpfi</td>"; $html .="<td align='left'>$titu_nome</td>"; }else{ $html .="<td align='center'>$cpf_pagador</td>"; $html .="<td align='left'>$nome_pagador</td>"; } $html .="<td align='left'>$prog_nome</td>"; $html .="<td align='left'>$data_inclusao</td>"; $html .="<td align='left'>$dia_vencimento</td>"; $html .="<td align='left'>$lpreco_venda</td>"; $html .="</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>