D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Faceamento
/
Filename :
VieFacGeraExcel.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\ModFacAtualizaLer(); $arr = $Lanc->lerLanc($Dados); var_dump($arr); $num_linhas = 40; $cont_linha = 99999; $cont_reg = 0; $total_dia = 0; $comp_nome = $arr[0]['comp_nome']; $data_sel = $arr[0]['data_i']; $curva_sel = $arr[0]['curva_sel']; $dtxls = date("dmYHi"); $arquivo = "FACEAMENTO_"."$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 align='center'><b>Filial</td>"; $html .="<td align='center'><b>Centro Estoque</td>"; $html .="<td align='center'><b>Cod Produto</td>"; $html .="<td align='center'><b>Descricao</td>"; $html .="<td align='center'><b>Qtde</td>"; $html .="<td align='center'><b>Data Validade</td>"; $html .="</tr>"; foreach ($arr as $lcto) { extract($lcto); $html .="<tr>"; $html .="<td align='right'> $filial_id</td>"; $html .="<td align='right'> $filial_id</td>"; $html .="<td align='right'> $produto_id</td>"; $html .="<td align='left'> $nome_produto</td>"; $html .="<td align='right'> $qtde_faceamento</td>"; $html .="<td align='left'> $validade</td>"; $html .="</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>