D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Cotacao
/
Filename :
Ant_VieCtRespondePrecoExcel.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\Cotacao\ModCtRespondePrecoLer(); $arr = $Lanc->listarResponde($Dados); $repres_nome = $arr[0]['repres_nome']; $repres_id = $arr[0]['repres_id']; $data_cotacao = $arr[0]['data_cotacao_m']; $data_cotacaoi = $arr[0]['data_cotacao_i']; $data_fechai = $arr[0]['data_fecha_i']; $cabec = "COTACAO_". $arr[0]['data_cotacao']. '_'.$repres_id ; $dtxls = date("His"); $num_linhas = 40; $cont_linha = 99999; $cont_reg = 0; $total_dia = 0; //var_dump($arr); //die; $dtxls = date("dmYHi"); $arquivo = "ROSARIO_COTACAO_"."$repres_id"."_DE_$data_cotacao.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"); // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet //header ("Content-type: application/x-msexcel"); header ("Content-type: vnd.openxmlformats-officedocument.spreadsheetml.sheet"); 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' colspan='7'><font color='blue'><b>ROSÁRIO - Cotação de: $data_cotacaoi FECHA EM:</font><font color='red'> $data_fechai </b> </font></td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>#ID</b></td>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>Codigo Interno</td>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>EAN do PRODUTO</td>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>Descrição do Produto</td>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>Preço Cotado</td>"; $html .= "<td class='table-info' align='center'><b><font color='blue'>Fator Embalagem</td>"; $html .= "<td class='table-info' align='center' ><b><font color='blue'>Estoque</td>"; $html .= "</tr>"; foreach ($arr as $lactos) { extract($lactos); $html .= "<tr>"; $html .= "<td>$id</td>"; $html .= "<td align='center'>$prod_cod</td>"; $html .= "<td align='center'>$ean</td>"; $html .= "<td align='center'>$prod_nome</td>"; $html .= "<td align='center'></td>"; $html .= "<td align='center'></td>"; $html .= "<td align='right'></td>"; $html .= "</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>