Commit 8d2e6381045f71e1034662275ef9ce728cc6309a
1 parent
f8c4463f
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
38 additions
and
41 deletions
Show diff stats
admin/admin.db
No preview for this file type
ferramentas/tabela/index.js
| @@ -1332,32 +1332,30 @@ i3GEOF.tabela = | @@ -1332,32 +1332,30 @@ i3GEOF.tabela = | ||
| 1332 | * | 1332 | * |
| 1333 | * Gera o relatório no formato CSV | 1333 | * Gera o relatório no formato CSV |
| 1334 | */ | 1334 | */ |
| 1335 | - relatorioTexto : function() { | ||
| 1336 | - try { | ||
| 1337 | - $i("i3GEOtabelaarearelh").value = $i("i3GEOtabelacalculaarea").checked; | ||
| 1338 | - $i("i3GEOtabelastatrelh").value = $i("i3GEOtabelacalculaestat").checked; | ||
| 1339 | - $i("i3GEOtabelaexcluirvalorh").value = $i("i3GEOtabelaexcestat").value; | ||
| 1340 | - $i("i3GEOtabelatemarelh").value = i3GEOF.tabela.tema; | ||
| 1341 | - $i("i3GEOtabelag_sidh").value = i3GEO.configura.sid; | ||
| 1342 | - $i("i3GEOtabelaitemagruparelh").value = $i("i3GEOtabelaagrupaItem").value; | ||
| 1343 | - $i("i3GEOtabelatiporelh").value = "csv"; | ||
| 1344 | - var inputs = $i("i3GEOtabelaitensrelatorio").getElementsByTagName("input"), listai = [], listanomes = [], nome, i, temp, n = | ||
| 1345 | - inputs.length; | ||
| 1346 | - for (i = 0; i < n; i++) { | ||
| 1347 | - if (inputs[i].checked === true) { | ||
| 1348 | - listai.push(inputs[i].id + "|" + inputs[i].name); | ||
| 1349 | - nome = $i(inputs[i].id + inputs[i].name).value; | ||
| 1350 | - listanomes.push(nome); | ||
| 1351 | - } | 1335 | + relatorioTexto : function(idjanela) { |
| 1336 | + | ||
| 1337 | + $i(idjanela + "i3GEOtabelaarearelh").value = $i(idjanela + "i3GEOtabelacalculaarea").checked; | ||
| 1338 | + $i(idjanela + "i3GEOtabelastatrelh").value = $i(idjanela + "i3GEOtabelacalculaestat").checked; | ||
| 1339 | + $i(idjanela + "i3GEOtabelaexcluirvalorh").value = $i(idjanela + "i3GEOtabelaexcestat").value; | ||
| 1340 | + $i(idjanela + "i3GEOtabelatemarelh").value = i3GEOF.tabela.propJanelas[idjanela].tema; | ||
| 1341 | + $i(idjanela + "i3GEOtabelag_sidh").value = i3GEO.configura.sid; | ||
| 1342 | + $i(idjanela + "i3GEOtabelaitemagruparelh").value = $i(idjanela + "i3GEOtabelaagrupaItem").value; | ||
| 1343 | + $i(idjanela + "i3GEOtabelatiporelh").value = "csv"; | ||
| 1344 | + var inputs = $i(idjanela + "i3GEOtabelaitensrelatorio").getElementsByTagName("input"), listai = [], listanomes = [], nome, i, temp, n = | ||
| 1345 | + inputs.length; | ||
| 1346 | + for (i = 0; i < n; i++) { | ||
| 1347 | + if (inputs[i].checked === true) { | ||
| 1348 | + listai.push(inputs[i].id + "|" + inputs[i].name); | ||
| 1349 | + nome = $i(inputs[i].id + inputs[i].name).value; | ||
| 1350 | + listanomes.push(nome); | ||
| 1352 | } | 1351 | } |
| 1353 | - $i("i3GEOtabelanomesrelh").value = listanomes; | ||
| 1354 | - $i("i3GEOtabelaitensrelh").value = listai; | ||
| 1355 | - temp = $i("i3GEOtabelarelatorio").action; | ||
| 1356 | - $i("i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten; | ||
| 1357 | - $i("i3GEOtabelarelatorio").submit(); | ||
| 1358 | - $i("i3GEOtabelarelatorio").action = temp; | ||
| 1359 | - } catch (e) { | ||
| 1360 | - i3GEO.janela.tempoMsg(e); | ||
| 1361 | } | 1352 | } |
| 1353 | + $i(idjanela + "i3GEOtabelanomesrelh").value = listanomes; | ||
| 1354 | + $i(idjanela + "i3GEOtabelaitensrelh").value = listai; | ||
| 1355 | + temp = $i(idjanela + "i3GEOtabelarelatorio").action; | ||
| 1356 | + $i(idjanela + "i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten; | ||
| 1357 | + $i(idjanela + "i3GEOtabelarelatorio").submit(); | ||
| 1358 | + $i(idjanela + "i3GEOtabelarelatorio").action = temp; | ||
| 1359 | + | ||
| 1362 | } | 1360 | } |
| 1363 | }; | 1361 | }; |
| 1364 | \ No newline at end of file | 1362 | \ No newline at end of file |
ferramentas/tabela/relatorio.php
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
| 2 | + | ||
| 3 | +<html> | ||
| 4 | +<head> | ||
| 5 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | ||
| 6 | +<title>i3Geo</title> | ||
| 7 | +</head> | ||
| 1 | <?php | 8 | <?php |
| 2 | session_name("i3GeoPHP"); | 9 | session_name("i3GeoPHP"); |
| 3 | if (isset($g_sid)) | 10 | if (isset($g_sid)) |
| @@ -94,7 +101,7 @@ for ($i = 0; $i < $res_count; $i++){ | @@ -94,7 +101,7 @@ for ($i = 0; $i < $res_count; $i++){ | ||
| 94 | $v = trim($shape->values[$item]); | 101 | $v = trim($shape->values[$item]); |
| 95 | //$v = mb_convert_encoding($v,mb_detect_encoding($v),"ISO-8859-1"); | 102 | //$v = mb_convert_encoding($v,mb_detect_encoding($v),"ISO-8859-1"); |
| 96 | if (function_exists("mb_convert_encoding") && $convC == true){ | 103 | if (function_exists("mb_convert_encoding") && $convC == true){ |
| 97 | - $v = mb_convert_encoding($v,"UTF-8","ISO-8859-1"); | 104 | + //$v = mb_convert_encoding($v,"UTF-8","ISO-8859-1"); |
| 98 | } | 105 | } |
| 99 | $valitem[$item] = $v; | 106 | $valitem[$item] = $v; |
| 100 | } | 107 | } |
| @@ -123,18 +130,13 @@ if(isset($tiporel) && $tiporel == "csv"){ | @@ -123,18 +130,13 @@ if(isset($tiporel) && $tiporel == "csv"){ | ||
| 123 | {echo ";área em ha \n";} | 130 | {echo ";área em ha \n";} |
| 124 | else | 131 | else |
| 125 | {echo "\n";} | 132 | {echo "\n";} |
| 126 | - foreach ($registros as $linhas) | ||
| 127 | - {echo implode(";",$linhas)."\n";} | 133 | + foreach ($registros as $linhas){ |
| 134 | + echo converte(implode(";",$linhas))."\n"; | ||
| 135 | + } | ||
| 128 | exit; | 136 | exit; |
| 129 | } | 137 | } |
| 130 | ?> | 138 | ?> |
| 131 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
| 132 | 139 | ||
| 133 | -<html> | ||
| 134 | -<head> | ||
| 135 | -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
| 136 | -<title>i3Geo</title> | ||
| 137 | -</head> | ||
| 138 | <style> | 140 | <style> |
| 139 | body,td | 141 | body,td |
| 140 | { | 142 | { |
| @@ -175,7 +177,7 @@ if ($itemagruparel == "") | @@ -175,7 +177,7 @@ if ($itemagruparel == "") | ||
| 175 | echo "<td style='text-align:right'>".number_format($v,2,",",".")."</td>"; | 177 | echo "<td style='text-align:right'>".number_format($v,2,",",".")."</td>"; |
| 176 | } | 178 | } |
| 177 | else{ | 179 | else{ |
| 178 | - echo "<td style='text-align:left'>$v</td>"; | 180 | + echo "<td style='text-align:left'>".converte($v)."</td>"; |
| 179 | } | 181 | } |
| 180 | if ($statrel == "true"){ | 182 | if ($statrel == "true"){ |
| 181 | $v = trim($v); | 183 | $v = trim($v); |
| @@ -246,7 +248,7 @@ else | @@ -246,7 +248,7 @@ else | ||
| 246 | if(is_numeric(trim($v))) | 248 | if(is_numeric(trim($v))) |
| 247 | {echo "<td style='text-align:right'>".number_format($v,2,",",".")."</td>";} | 249 | {echo "<td style='text-align:right'>".number_format($v,2,",",".")."</td>";} |
| 248 | else | 250 | else |
| 249 | - {echo "<td style='text-align:left'>$v</td>";} | 251 | + {echo "<td style='text-align:left'>".converte($v)."</td>";} |
| 250 | if ($statrel == "true") | 252 | if ($statrel == "true") |
| 251 | { | 253 | { |
| 252 | $v = trim($v); | 254 | $v = trim($v); |
| @@ -299,12 +301,9 @@ function calculaarea($geo) | @@ -299,12 +301,9 @@ function calculaarea($geo) | ||
| 299 | } | 301 | } |
| 300 | function converte($texto) | 302 | function converte($texto) |
| 301 | { | 303 | { |
| 302 | - if (function_exists("mb_convert_encoding")) | 304 | + if (!mb_detect_encoding($texto,"UTF-8",true)) |
| 303 | { | 305 | { |
| 304 | - if (!mb_detect_encoding($texto,"UTF-8",true)) | ||
| 305 | - { | ||
| 306 | - $texto = mb_convert_encoding($texto,"UTF-8","ISO-8859-1"); | ||
| 307 | - } | 306 | + $texto = mb_convert_encoding($texto,"UTF-8","ISO-8859-1"); |
| 308 | } | 307 | } |
| 309 | return $texto; | 308 | return $texto; |
| 310 | } | 309 | } |