Commit 09f64b1a7543a39cc0222214c99eec8342bf12be
1 parent
f11347ff
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
19 additions
and
13 deletions
Show diff stats
admin/js/estat_editor.js
| ... | ... | @@ -88,7 +88,7 @@ i3GEOadmin.editor = { |
| 88 | 88 | "<select id='i3GEOadmintabela' onchange='i3GEOadmin.editor.coluna.lista()'>"; |
| 89 | 89 | temp += core_comboObjeto(dados,"tabela","tabela"); |
| 90 | 90 | temp += "</select>" + |
| 91 | - "<p><input type=button value='Relatório' id='i3GEOadmintabelaMostrar' />" + | |
| 91 | + "<p><input type=button value='Mostrar dados' id='i3GEOadmintabelaMostrar' />" + | |
| 92 | 92 | "<input type=button value='CSV' id='i3GEOadmintabelaCsv'/>" + |
| 93 | 93 | "<input type=button value='Criar uma nova tabela' id='i3GEOadmintabelaCriar' />" + |
| 94 | 94 | "<input type=button value='Alterar nome atual' id='i3GEOadmintabelaAlterarNome' />" + |
| ... | ... | @@ -234,7 +234,9 @@ i3GEOadmin.editor = { |
| 234 | 234 | alert("Escolha a tabela"); |
| 235 | 235 | return; |
| 236 | 236 | } |
| 237 | - var callback = { | |
| 237 | + | |
| 238 | + var nreg = window.prompt("Numero maximo de registros"), | |
| 239 | + callback = { | |
| 238 | 240 | success:function(o){ |
| 239 | 241 | try { |
| 240 | 242 | core_carregando("desativa"); |
| ... | ... | @@ -269,7 +271,7 @@ i3GEOadmin.editor = { |
| 269 | 271 | }, |
| 270 | 272 | nomeEsquema = $i("i3GEOadminesquema").value; |
| 271 | 273 | core_carregando("obtendo dados..."); |
| 272 | - core_makeRequest("../php/metaestat.php?funcao=obtemDadosTabelaDB&geo=nao&formato=json&nome_tabela="+$i("i3GEOadmintabela").value+"&nome_esquema="+nomeEsquema+"&codigo_estat_conexao="+$i("i3GEOadmincodigo_estat_conexao").value,callback); | |
| 274 | + core_makeRequest("../php/metaestat.php?funcao=obtemDadosTabelaDB&nreg="+nreg+"&geo=nao&formato=json&nome_tabela="+$i("i3GEOadmintabela").value+"&nome_esquema="+nomeEsquema+"&codigo_estat_conexao="+$i("i3GEOadmincodigo_estat_conexao").value,callback); | |
| 273 | 275 | }, |
| 274 | 276 | csv: function(){ |
| 275 | 277 | if($i("i3GEOadmintabela").value == ""){ | ... | ... |
admin/php/classe_metaestat.php
| ... | ... | @@ -1635,7 +1635,7 @@ class Metaestat{ |
| 1635 | 1635 | function descreveColunasTabela($codigo_estat_conexao,$nome_esquema,$nome_tabela){ |
| 1636 | 1636 | return $this->execSQLDB($codigo_estat_conexao,"SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a.atttypmod AS lengthvar,a.attnotnull AS notnull,p.nspname as esquema FROM pg_class c,pg_attribute a,pg_type t,pg_namespace p WHERE c.relname = '$nome_tabela' and p.nspname = '$nome_esquema' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid and c.relnamespace = p.oid ORDER BY a.attname"); |
| 1637 | 1637 | } |
| 1638 | - function obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo="nao"){ | |
| 1638 | + function obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo="nao",$nreg=""){ | |
| 1639 | 1639 | $desccolunas = $this->descreveColunasTabela($codigo_estat_conexao, $nome_esquema, $nome_tabela); |
| 1640 | 1640 | $colunas = array(); |
| 1641 | 1641 | $colsql = array(); |
| ... | ... | @@ -1649,7 +1649,11 @@ class Metaestat{ |
| 1649 | 1649 | $colsql[] = "ST_AsText(".$d["field"].") as ".$d["field"]; |
| 1650 | 1650 | } |
| 1651 | 1651 | } |
| 1652 | - $dados = $this->execSQLDB($codigo_estat_conexao,"SELECT ".implode(",",$colsql)." from ".$nome_esquema.".".$nome_tabela ); | |
| 1652 | + $sql = "SELECT ".implode(",",$colsql)." from ".$nome_esquema.".".$nome_tabela; | |
| 1653 | + if($nreg != ""){ | |
| 1654 | + $sql = "SELECT ".implode(",",$colsql)." from ".$nome_esquema.".".$nome_tabela." limit $nreg"; | |
| 1655 | + } | |
| 1656 | + $dados = $this->execSQLDB($codigo_estat_conexao,$sql ); | |
| 1653 | 1657 | $linhas = array(); |
| 1654 | 1658 | foreach($dados as $d){ |
| 1655 | 1659 | $l = array(); | ... | ... |
admin/php/metaestat.php
| ... | ... | @@ -1328,10 +1328,10 @@ switch (strtoupper($funcao)) |
| 1328 | 1328 | case "OBTEMDADOSTABELADB": |
| 1329 | 1329 | $m = new Metaestat(); |
| 1330 | 1330 | if($formato == "json"){ |
| 1331 | - retornaJSON($m->obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo)); | |
| 1331 | + retornaJSON($m->obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo,$nreg)); | |
| 1332 | 1332 | } |
| 1333 | 1333 | if($formato == "csv"){ |
| 1334 | - $dados = $m->obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo); | |
| 1334 | + $dados = $m->obtemDadosTabelaDB($codigo_estat_conexao,$nome_esquema,$nome_tabela,$geo,$nreg); | |
| 1335 | 1335 | require_once(__DIR__."/../../pacotes/parsecsv/parsecsv.lib.php"); |
| 1336 | 1336 | $csv = new parseCSV(); |
| 1337 | 1337 | //$csv->encoding('UTF-16', 'UTF-8'); | ... | ... |
ferramentas/loginusuario/index.js
| ... | ... | @@ -120,7 +120,7 @@ i3GEOF.loginusuario = { |
| 120 | 120 | '<input id=i3geosenha type=password style="width:200px;" value=""/><br>' + |
| 121 | 121 | '<p class="paragrafo" ><input id=i3GEOFloginusuario size=20 type=button value="'+$trad("x29")+'" /> <input id=i3GEOFlogoutusuario size=20 type=button value="Logout" />' + |
| 122 | 122 | '<p class="paragrafo" onclick="i3GEOF.loginusuario.recuperarSenha()" style="cursor:pointer;color:blue;">'+$trad("x32")+'</p>' + |
| 123 | - '<p class="paragrafo" onclick="i3GEOF.loginusuario.alterarSenha()" style="cursor:pointer;color:blue;">'+$trad("x52")+'</p><br><br><br>'; | |
| 123 | + '<p class="paragrafo" onclick="i3GEOF.loginusuario.alterarSenha()" style="cursor:pointer;color:blue;">'+$trad("x52")+'</p>'; | |
| 124 | 124 | return ins; |
| 125 | 125 | }, |
| 126 | 126 | /* |
| ... | ... | @@ -137,7 +137,7 @@ i3GEOF.loginusuario = { |
| 137 | 137 | }; |
| 138 | 138 | titulo = "Login "; |
| 139 | 139 | janela = i3GEO.janela.cria( |
| 140 | - "260px", | |
| 140 | + "270px", | |
| 141 | 141 | "220px", |
| 142 | 142 | "", |
| 143 | 143 | "", | ... | ... |
ferramentas/upload/upload.php
| ... | ... | @@ -33,11 +33,11 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 33 | 33 | $dirmap = dirname($map_file); |
| 34 | 34 | } |
| 35 | 35 | if(isset($dirDestino) && $dirDestino != ""){ |
| 36 | - if(!isset($editores)) | |
| 37 | - {echo "<p class='paragrafo' >Lista de editores não disponível. Não pode gravar fora do diretório temporário";paraAguarde();exit;} | |
| 38 | 36 | $dirmap = $dirDestino; |
| 39 | - if(verificaEditores($editores) == "nao") | |
| 40 | - {echo "<p class='paragrafo' >Você não é um editor cadastrado. Não pode gravar fora do diretório temporário";paraAguarde();exit;} | |
| 37 | + include_once(__DIR__."/../../admin/php/login.php"); | |
| 38 | + if(verificaOperacaoSessao("admin/php/editortexto") == false){ | |
| 39 | + echo "Vc nao pode realizar salvar os dados no servidor em uma pasta específica";exit; | |
| 40 | + } | |
| 41 | 41 | if(!file_exists($dirmap)) |
| 42 | 42 | {echo "<p class='paragrafo' >Pasta não existe no servidor";paraAguarde();exit;} |
| 43 | 43 | } | ... | ... |