D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
PontaGondola
/
Ruptura
/
Filename :
VieRupTopExcel.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\ModRupTopLer(); $arr = $Lanc->lerLanc($Dados); $num_linhas = 40; $cont_linha = 99999; $cont_reg = 0; $total_dia = 0; $marca_nome = $arr[0]['comp_nome']; $data_sel = $arr[0]['data_sel']; $top = $arr[0]['top']; $dtxls = date("dmYHi"); $arquivo = "TOP Faltas_"."$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='7' align='center'><b><font color='red'>TOP</font><font color='blue'> $top</font><font color='red'> de Produtos em Falta: $data_sel</font></td>"; $html .="</tr>"; $html .="<tr>"; $html .="<td align='center'><b>Comprador</td>"; $html .="<td align='center'><b>Cod Prod</td>"; $html .="<td align='center'><b>Descrição</td>"; $html .="<td align='center'><b>Qtde Filiais</td>"; $html .="<td align='center'><b>PBM</td>"; $html .="<td align='center'><b>Dias em Falta</td>"; $html .="<td align='center'><b>Falta/dia</td>"; $html .="</tr>"; foreach ($arr as $lcto) { extract($lcto); $ven_dia = number_format($valor_venda,2,',','.'); $html .="<tr>"; $html .="<td align='left'> $comp_nome</td>"; $html .="<td align='right'> $produto_id</td>"; $html .="<td align='left'> $prod_nome</td>"; $html .="<td align='center'> $qtde_filiais</td>"; if($pbm == 'S') { $html .="<td align='center'><font color='red'><b>$pbm</font></b></td>"; }else{ $html .="<td align='center'> $pbm</td>"; } $html .="<td align='right'> $recorr_media</td>"; $html .="<td align='right'> $ven_dia</td>"; $html .="</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>