D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
ProgramaSaude
/
Filename :
ViePsaudeRelAutorizaExcel.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; //$gre_filial_id = $Dados['gre_filial_id']; $Lanc = new \App\gre\Models\ModPsaudeRelAutorizaLer(); $arr = $Lanc->lerLanc($Dados); $tipo_nome = $arr[0]['tipo_nome']; $mesano = $arr[0]['mesano']; //var_dump($arr); //die; $num_linhas = 40; $cont_linha = 99999; $cont_reg = 0; $total_dia = 0; date_default_timezone_set ("America/Sao_Paulo"); $data_sel = date("d/m/Y"); $curva_sel = $arr[0]['curva_sel']; $dtxls = date("dmYHi"); $arquivo = "UTILIZAÇÃO DO PROGRAMA $tipo_nome - "."$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_id'] == 1){ $html .="<td colspan='8'"; }else{ $html .="<td colspan='7'"; } $html .=" align='center'><b><font color='blue'>UTILIZAÇÃO PROGRAMA EM $mesano</td>"; $html .="</tr>"; $html .= "<tr>"; If($arr[0]['tipo_id'] == 1){ $html .="<td colspan='8'"; }else{ $html .="<td colspan='7'"; } $html .=" align='center'><b><font color='blue'>Tipo: $tipo_nome </td>"; $html .="</tr>"; $html .= "<tr>"; if($arr[0]['tipo_id'] == 1){ $html .="<td align='center'><b>Empresa</td>"; } $html .="<td align='center'><b>Programa</td>"; $html .="<td align='center'><b>Usuário</td>"; $html .="<td align='center'><b>Tipo</td>"; $html .="<td align='center'><b>Data</td>"; $html .="<td align='center'><b>Cod.Prod</td>"; $html .="<td align='center'><b>Produto</td>"; $html .="<td align='center'><b>Filial</td>"; $html .="</tr>"; foreach ($arr as $lcto) { extract($lcto); $html .="<tr>"; if($tipo_id == 1){ $html .="<td align='left'> $empr_nome</td>"; } $html .="<td align='left'> $prog_nome</td>"; $html .="<td align='left'> $mov_nome</td>"; $html .="<td align='left'> $titu_nome</td>"; $html .="<td align='center'> $mov_data</td>"; $html .="<td align='center'> $prod_id</td>"; $html .="<td align='left'> $prod_nome</td>"; $html .="<td align='left'> $mov_loja</td>"; $html .="</tr>"; } $html .= "</table>"; $html .= "<br>"; echo $html; exit; ?> </html>