D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Trade
/
Filename :
VieTradeRebateComprasExcel.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\ModTradeRebateComprasProdLer(); $arr = $Lanc->lerLanc($Dados); $num_linhas = 40; $cont_linha = 99999; $cont_reg = 0; $forn_nome = $arr[0]['fornecedor_nome']; $forn_id = $arr[0]['fornecedor_id']; $mes_ano = $arr[0]['mesano']; $dtxls = date("dmYHi"); $arquivo = "COMPRAS FORNECEDOR_"."$forn_id"."_"."$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>"; $html .="<td colspan='8' align='center'><font color='blue'>Fornecedor:<b> $forn_id - $forn_nome</b></td>"; $html .="</tr>"; $html .= "<tr>"; $html .="<td colspan='8' align='center'><font color='blue'>Mes/Ano:<b>$mes_ano</b> </td>"; $html .="</tr>"; $html .="<tr>"; $html .="<td align='center'><b>Seção</td>"; $html .="<td align='center'><b>Cod Prod</td>"; $html .="<td align='center'><b>Descrição</td>"; $html .="<td align='center'><b>Qtde</td>"; $html .="<td align='center'><b>Valor Bruto</td>"; $html .="<td align='center'><b>Valor ST</td>"; $html .="<td align='center'><b>Valor Liquido</td>"; $html .="<td align='center'><b>Exclui do Calculo</td>"; $html .="</tr>"; foreach ($arr as $lcto) { extract($lcto); $html .="<tr>"; $html .="<td align='left'> $secao_nome</td>"; $html .="<td align='right'> $produto_id</td>"; $html .="<td align='left'> $produto_nome</td>"; $html .="<td align='right'> $qtde</td>"; $html .="<td align='right'> $valor_bruto</td>"; $html .="<td align='right'> $valor_st</td>"; $html .="<td align='right'> $valor_liquido</td>"; $html .="<td align='center'> $calculo_rebate</td>"; $html .="</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>