Commit 819f95ac0be40b4f7640532a206ea9f9da8fa9a0
1 parent
e7b149e9
Exists in
master
and in
6 other branches
Inclusão de header para permitir download do arquivo CSV exportado na opção RELA…
…TÓRIO existente na ferramenta tabela
Showing
1 changed file
with
8 additions
and
6 deletions
Show diff stats
ferramentas/tabela/relatorio.php
@@ -151,12 +151,15 @@ $fechou = $layer->close(); | @@ -151,12 +151,15 @@ $fechou = $layer->close(); | ||
151 | restauraCon($map_file,$postgis_mapa); | 151 | restauraCon($map_file,$postgis_mapa); |
152 | 152 | ||
153 | if(isset($_GET["tiporel"]) && $_GET["tiporel"] == "csv"){ | 153 | if(isset($_GET["tiporel"]) && $_GET["tiporel"] == "csv"){ |
154 | - echo "<pre>"; | 154 | + ob_end_clean(); |
155 | + header("Content-type: text/csv"); | ||
155 | echo implode(";",explode(",",$nomesrel)); | 156 | echo implode(";",explode(",",$nomesrel)); |
156 | - if($arearel == "true") | ||
157 | - {echo ";área em ha \n";} | ||
158 | - else | ||
159 | - {echo "\n";} | 157 | + if($arearel == "true"){ |
158 | + echo ";área em ha \n"; | ||
159 | + } | ||
160 | + else{ | ||
161 | + echo "\n"; | ||
162 | + } | ||
160 | foreach ($registros as $linhas){ | 163 | foreach ($registros as $linhas){ |
161 | echo converte(implode(";",$linhas))."\n"; | 164 | echo converte(implode(";",$linhas))."\n"; |
162 | } | 165 | } |
@@ -177,7 +180,6 @@ body,td | @@ -177,7 +180,6 @@ body,td | ||
177 | 180 | ||
178 | </style> | 181 | </style> |
179 | <body> | 182 | <body> |
180 | -<img src='../../imagens/i3geo1.jpg' /><br> | ||
181 | <?php | 183 | <?php |
182 | echo "<span style=font-size:18px; >Relatório do tema: <b>".converte($layer->getmetadata("TEMA"))."</b><br></span>"; | 184 | echo "<span style=font-size:18px; >Relatório do tema: <b>".converte($layer->getmetadata("TEMA"))."</b><br></span>"; |
183 | $ocorrencias = count($registros); | 185 | $ocorrencias = count($registros); |