Commit 7a6af063ed092f1ab48007450eb298f42245e4ba
1 parent
81fff392
Exists in
master
and in
7 other branches
--no commit message
Showing
10 changed files
with
230 additions
and
66 deletions
Show diff stats
classesjs/compactajs.php
| ... | ... | @@ -76,6 +76,7 @@ packer("classe_analise.js","compactados/classe_analise_compacto.js","Normal"); |
| 76 | 76 | packer("classe_php.js","compactados/classe_php_compacto.js","Normal"); |
| 77 | 77 | packer("classe_interface.js","compactados/classe_interface_compacto.js","Normal"); |
| 78 | 78 | packer("classe_i3geo.js","compactados/classe_i3geo_compacto.js","Normal"); |
| 79 | +packer("../ferramentas/funcoes.js","../ferramentas/funcoes_compacto.js","Normal"); | |
| 79 | 80 | // |
| 80 | 81 | //gera um único js para a inicialização do I3Geo |
| 81 | 82 | // | ... | ... |
classesphp/classe_mapa.php
| ... | ... | @@ -1345,5 +1345,39 @@ $arq - Nome do arquivo. |
| 1345 | 1345 | $dbh = null; |
| 1346 | 1346 | $dbhw = null; |
| 1347 | 1347 | } |
| 1348 | + function insereJOIN($string,$layername) | |
| 1349 | + { | |
| 1350 | + //le o map file | |
| 1351 | + $abre = fopen($this->arquivo, "r"); | |
| 1352 | + while (!feof($abre)) | |
| 1353 | + { | |
| 1354 | + $buffer = fgets($abre); | |
| 1355 | + $maparray[] = $buffer; | |
| 1356 | + } | |
| 1357 | + fclose($abre); | |
| 1358 | + $novoarray = array(); | |
| 1359 | + $conta = 0; | |
| 1360 | + $pega = "nao"; | |
| 1361 | + //procura a string "querymap" | |
| 1362 | + foreach ($maparray as $e) | |
| 1363 | + { | |
| 1364 | + $testa = explode("NAME",$e); | |
| 1365 | + if (count($testa) > 1) | |
| 1366 | + {$pega = "sim";} | |
| 1367 | + $testa = explode('"'.$layername.'"',$e); | |
| 1368 | + if ((count($testa) > 1) && ($pega == "sim")) | |
| 1369 | + { | |
| 1370 | + $novoarray[] = $string; | |
| 1371 | + $pega = "nao"; | |
| 1372 | + } | |
| 1373 | + $novoarray[] = $e; | |
| 1374 | + } | |
| 1375 | + //salva o mapfile | |
| 1376 | + $abre = fopen($this->arquivo, "wt"); | |
| 1377 | + foreach($novoarray as $linha) | |
| 1378 | + {$escreve = fwrite ($abre,$linha);} | |
| 1379 | + $fecha = fclose ($abre); | |
| 1380 | + } | |
| 1381 | + | |
| 1348 | 1382 | } |
| 1349 | 1383 | ?> |
| 1350 | 1384 | \ No newline at end of file | ... | ... |
ferramentas/funcoes.js
| ... | ... | @@ -183,16 +183,19 @@ function combocor(id,def,s) |
| 183 | 183 | // |
| 184 | 184 | //monta combo com os itens de um unico tema |
| 185 | 185 | // |
| 186 | -function comboitens(id,tema,funcao,onde) | |
| 186 | +function comboitens(id,tema,funcao,onde,nome) | |
| 187 | 187 | { |
| 188 | - if (arguments.length == 4) | |
| 188 | + if (arguments.length > 3) | |
| 189 | 189 | $i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando itens...</span>"; |
| 190 | + if (arguments.length != 5) | |
| 191 | + {nome = "";} | |
| 192 | + | |
| 190 | 193 | var monta = function(retorno) |
| 191 | 194 | { |
| 192 | 195 | if (retorno.data != undefined) |
| 193 | 196 | { |
| 194 | 197 | var ins = new Array(); |
| 195 | - ins.push("<select id="+id+" >"); | |
| 198 | + ins.push("<select id='"+id+"' name='"+nome+"'>"); | |
| 196 | 199 | ins.push("<option value='' >---</option>"); |
| 197 | 200 | for (i=0;i<retorno.data.valores.length; i++) |
| 198 | 201 | { |
| ... | ... | @@ -446,17 +449,19 @@ function comboTemasSel(id,funcao,onde) |
| 446 | 449 | //monta combo com os temas que estão ligados |
| 447 | 450 | //retorna um combo com id=temasLigados |
| 448 | 451 | // |
| 449 | -function comboTemasLigados(id,funcao,onde) | |
| 452 | +function comboTemasLigados(id,funcao,onde,nome) | |
| 450 | 453 | { |
| 451 | - if (arguments.length == 3) | |
| 454 | + if (arguments.length > 2) | |
| 452 | 455 | $i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando temas...</span>"; |
| 456 | + if (arguments.length == 3) | |
| 457 | + {nome = "";} | |
| 453 | 458 | var monta = function(retorno) |
| 454 | 459 | { |
| 455 | 460 | if (retorno.data != undefined) |
| 456 | 461 | { |
| 457 | 462 | if (retorno.data.length > 0) |
| 458 | 463 | { |
| 459 | - comboTemas = "<select id="+id+" >"; | |
| 464 | + comboTemas = "<select id='"+id+"' name='"+nome+"'>"; | |
| 460 | 465 | comboTemas += "<option value=''>----</option>"; |
| 461 | 466 | for (i=0;i<retorno.data.length;i++) |
| 462 | 467 | {comboTemas += "<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | ... | ... |
ferramentas/funcoes_compacto.js
| ... | ... | @@ -20,7 +20,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 20 | 20 | ndiv.innerHTML=texto+"</tr></table>"; document.getElementById("resultado").appendChild(ndiv);} |
| 21 | 21 | var ids=new Array("t0","t1","t2","t3","t4","t5","t6","t7"); for(i=0;i<ids.length;i++){ if(document.getElementById(ids[i])){document.getElementById(ids[i]).style.display="none";}} |
| 22 | 22 | document.getElementById(idatual).style.display="block";}function simnao(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE selected>sim</option>"; combo+="<option value=FALSE >não</option>"; combo+="</select>"; return(combo);}function naosim(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE >sim</option>"; combo+="<option value=FALSE selected >não</option>"; combo+="</select>"; return(combo);}function combocor(id,def,s){ var combo="<select name="+id+" id="+id+" >"; if(def==0){s='selected';} |
| 23 | - combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde){ if(arguments.length==4) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id="+id+" >"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 23 | + combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde,nome){ if(arguments.length > 3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; if(arguments.length !=5){nome="";} | |
| 24 | + var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id='"+id+"' name='"+nome+"'>"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 24 | 25 | ins.push("</select>"); var ins=ins.join(''); var temp={dados:ins,tipo:"dados"};} |
| 25 | 26 | else{ var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 26 | 27 | eval("funcao(temp)");} |
| ... | ... | @@ -56,7 +57,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 56 | 57 | else{var temp={dados:'<div class=alerta >Nenhum tema possui seleção. Utilize a opção de seleção ou a tabela de um tema para escolher algum elemento de algum tema.</div>',tipo:"mensagem"};}} |
| 57 | 58 | else{var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 58 | 59 | eval("funcao(temp)");} |
| 59 | - var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde){ if(arguments.length==3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id="+id+" >"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 60 | + var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde,nome){ if(arguments.length > 2) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; if(arguments.length==3){nome="";} | |
| 61 | + var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id='"+id+"' name='"+nome+"'>"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 60 | 62 | comboTemas+="</select>"; var temp={dados:comboTemas,tipo:"dados"};} |
| 61 | 63 | else{var temp={dados:'<div class=alerta >Nenhum tema está ligado.</div>',tipo:"mensagem"};}} |
| 62 | 64 | else{var temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"};} | ... | ... |
ferramentas/i3geo_tudo_compacto.js
| ... | ... | @@ -21,7 +21,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 21 | 21 | ndiv.innerHTML=texto+"</tr></table>"; document.getElementById("resultado").appendChild(ndiv);} |
| 22 | 22 | var ids=new Array("t0","t1","t2","t3","t4","t5","t6","t7"); for(i=0;i<ids.length;i++){ if(document.getElementById(ids[i])){document.getElementById(ids[i]).style.display="none";}} |
| 23 | 23 | document.getElementById(idatual).style.display="block";}function simnao(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE selected>sim</option>"; combo+="<option value=FALSE >não</option>"; combo+="</select>"; return(combo);}function naosim(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE >sim</option>"; combo+="<option value=FALSE selected >não</option>"; combo+="</select>"; return(combo);}function combocor(id,def,s){ var combo="<select name="+id+" id="+id+" >"; if(def==0){s='selected';} |
| 24 | - combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde){ if(arguments.length==4) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id="+id+" >"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 24 | + combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde,nome){ if(arguments.length > 3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; if(arguments.length !=5){nome="";} | |
| 25 | + var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id='"+id+"' name='"+nome+"'>"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 25 | 26 | ins.push("</select>"); var ins=ins.join(''); var temp={dados:ins,tipo:"dados"};} |
| 26 | 27 | else{ var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 27 | 28 | eval("funcao(temp)");} |
| ... | ... | @@ -57,7 +58,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 57 | 58 | else{var temp={dados:'<div class=alerta >Nenhum tema possui seleção. Utilize a opção de seleção ou a tabela de um tema para escolher algum elemento de algum tema.</div>',tipo:"mensagem"};}} |
| 58 | 59 | else{var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 59 | 60 | eval("funcao(temp)");} |
| 60 | - var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde){ if(arguments.length==3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id="+id+" >"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 61 | + var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde,nome){ if(arguments.length > 2) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; if(arguments.length==3){nome="";} | |
| 62 | + var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id='"+id+"' name='"+nome+"'>"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 61 | 63 | comboTemas+="</select>"; var temp={dados:comboTemas,tipo:"dados"};} |
| 62 | 64 | else{var temp={dados:'<div class=alerta >Nenhum tema está ligado.</div>',tipo:"mensagem"};}} |
| 63 | 65 | else{var temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"};} | ... | ... |
ferramentas/i3geo_tudo_compacto.js.php
| ... | ... | @@ -21,7 +21,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 21 | 21 | ndiv.innerHTML=texto+"</tr></table>"; document.getElementById("resultado").appendChild(ndiv);} |
| 22 | 22 | var ids=new Array("t0","t1","t2","t3","t4","t5","t6","t7"); for(i=0;i<ids.length;i++){ if(document.getElementById(ids[i])){document.getElementById(ids[i]).style.display="none";}} |
| 23 | 23 | document.getElementById(idatual).style.display="block";}function simnao(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE selected>sim</option>"; combo+="<option value=FALSE >não</option>"; combo+="</select>"; return(combo);}function naosim(id){ var combo="<select name="+id+" id="+id+" >"; combo+="<option value=TRUE >sim</option>"; combo+="<option value=FALSE selected >não</option>"; combo+="</select>"; return(combo);}function combocor(id,def,s){ var combo="<select name="+id+" id="+id+" >"; if(def==0){s='selected';} |
| 24 | - combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde){ if(arguments.length==4) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id="+id+" >"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 24 | + combo+='<option value="0" '+s+' >branco</option>'; s=""; combo+='<option value="2">vermelho</option>'; combo+='<option value="7">amarelo</option>'; if(def==1){s='selected'}; combo+='<option value="1" '+s+' >preto</option>'; combo+='<option value="rgb(1,1,0.8)">bege</option>'; combo+='<option value="3">verde</option>'; combo+='<option value="8">cinza</option>'; combo+='<option value="4">azul</option>'; combo+='<option value="5">ciano</option>'; combo+='<option value="6">magenta</option>'; combo+="</select>"; return(combo);} function comboitens(id,tema,funcao,onde,nome){ if(arguments.length > 3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando itens...</span>"; if(arguments.length !=5){nome="";} | |
| 25 | + var monta=function(retorno){ if(retorno.data !=undefined){ var ins=new Array(); ins.push("<select id='"+id+"' name='"+nome+"'>"); ins.push("<option value='' >---</option>"); for(i=0;i<retorno.data.valores.length;i++){ if(retorno.data.valores[i].tema==tema){ins.push("<option value='"+retorno.data.valores[i].item+"' >"+retorno.data.valores[i].item+"</option>");}} | |
| 25 | 26 | ins.push("</select>"); var ins=ins.join(''); var temp={dados:ins,tipo:"dados"};} |
| 26 | 27 | else{ var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 27 | 28 | eval("funcao(temp)");} |
| ... | ... | @@ -57,7 +58,8 @@ document.body.style.backgroundColor="#F0F0F0";function aguarde(tipo){ if(tipo==" |
| 57 | 58 | else{var temp={dados:'<div class=alerta >Nenhum tema possui seleção. Utilize a opção de seleção ou a tabela de um tema para escolher algum elemento de algum tema.</div>',tipo:"mensagem"};}} |
| 58 | 59 | else{var temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"};} |
| 59 | 60 | eval("funcao(temp)");} |
| 60 | - var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde){ if(arguments.length==3) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id="+id+" >"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 61 | + var cp=new cpaint(); cp.set_response_type("JSON"); cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listatemascomsel","listaTemasComSel",monta);} function comboTemasLigados(id,funcao,onde,nome){ if(arguments.length > 2) $i(onde).innerHTML="<span style=color:red;font-size:10px;>buscando temas...</span>"; if(arguments.length==3){nome="";} | |
| 62 | + var monta=function(retorno){ if(retorno.data !=undefined){ if(retorno.data.length > 0){ comboTemas="<select id='"+id+"' name='"+nome+"'>"; comboTemas+="<option value=''>----</option>"; for(i=0;i<retorno.data.length;i++){comboTemas+="<option value="+retorno.data[i].tema+" >"+retorno.data[i].nome+"</option>";} | |
| 61 | 63 | comboTemas+="</select>"; var temp={dados:comboTemas,tipo:"dados"};} |
| 62 | 64 | else{var temp={dados:'<div class=alerta >Nenhum tema está ligado.</div>',tipo:"mensagem"};}} |
| 63 | 65 | else{var temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"};} | ... | ... |
ferramentas/uploaddbf/index.js
| ... | ... | @@ -21,6 +21,24 @@ Free Software Foundation, Inc., no endereço |
| 21 | 21 | */ |
| 22 | 22 | parametrosURL() |
| 23 | 23 | mensagemAjuda("men1",$i("men1").innerHTML) |
| 24 | +if($i("temas")){ | |
| 25 | + aguarde("block") | |
| 26 | + comboTemasLigados("tema",function(retorno) | |
| 27 | + { | |
| 28 | + $i("temas").innerHTML = retorno.dados | |
| 29 | + aguarde("none") | |
| 30 | + $i("tema").onchange = function() | |
| 31 | + { | |
| 32 | + $i("itens").innerHTML = ""; | |
| 33 | + comboitens("item",$i("tema").value,function(retorno) | |
| 34 | + { | |
| 35 | + $i("itens").innerHTML = retorno.dados | |
| 36 | + },"itens","item") | |
| 37 | + if ($i("temas").value == "") | |
| 38 | + alert("Selecione um tema"); | |
| 39 | + } | |
| 40 | + },"temas","tema") | |
| 41 | +} | |
| 24 | 42 | //document.getElementById("g_sid").value = g_sid |
| 25 | 43 | YAHOO.example.init = function () |
| 26 | 44 | { |
| ... | ... | @@ -34,11 +52,14 @@ function submete() |
| 34 | 52 | { |
| 35 | 53 | $i("f").submit() |
| 36 | 54 | } |
| 37 | -radioepsg | |
| 38 | -( | |
| 39 | - function(retorno) | |
| 40 | - { | |
| 55 | +if($i("listaepsg")) | |
| 56 | +{ | |
| 57 | + radioepsg | |
| 58 | + ( | |
| 59 | + function(retorno) | |
| 60 | + { | |
| 41 | 61 | $i("listaepsg").innerHTML = retorno.dados |
| 42 | - }, | |
| 43 | - "listaepsg" | |
| 44 | -) | |
| 45 | 62 | \ No newline at end of file |
| 63 | + }, | |
| 64 | + "listaepsg" | |
| 65 | + ) | |
| 66 | +} | |
| 46 | 67 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas.css"> | |
| 5 | +<link rel="stylesheet" type="text/css" href="../../pacotes/yui231/build/tabview/assets/skins/sam/tabview.css"> | |
| 6 | +<style type="text/css">.yuibutton button{padding-left:2em;background:url(../../imagens/tic.png) 5% 50% no-repeat;}</style> | |
| 7 | +<title></title> | |
| 8 | +</head> | |
| 9 | +<body style="overflow:auto"> | |
| 10 | +<div style="top:5px;left:10px;display:block;position:absolute"> | |
| 11 | +<form id=f action="upload.php" method="post" ENCTYPE="multipart/form-data"> | |
| 12 | + <pre style="font-size:14px"> | |
| 13 | +dbf: <input class=digitar type="file" size=20 name="filedbf"> | |
| 14 | +</pre> | |
| 15 | +Coluna DBF: <input class=digitar type="input" size=20 name="colunadbf"><br> | |
| 16 | + | |
| 17 | +<div id=opc1 style=top:0px;left:0px;text-align:left;width:90%; > | |
| 18 | + <br> | |
| 19 | + Tema: | |
| 20 | + <div id="temas" > | |
| 21 | + </div> | |
| 22 | + <br>Coluna do tema: | |
| 23 | + <div id="itens" > | |
| 24 | + </div> | |
| 25 | +</div> | |
| 26 | + | |
| 27 | + | |
| 28 | +<div onclick='submete()' style='top:10px;left:0px'> | |
| 29 | + <input id=botao1 type="button" value="Carregar" size=12 name="submit" /> | |
| 30 | + <input type="hidden" name="MAX_FILE_SIZE" value="10000" /> | |
| 31 | +</div> | |
| 32 | +</form> | |
| 33 | +</div> | |
| 34 | +<div id=men1 style=left:0px;width:100%;top:220px; > | |
| 35 | +</div> | |
| 36 | + | |
| 37 | +<script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> | |
| 38 | +<script language="JavaScript" type="text/javascript" src="index.js"></script> | |
| 39 | +</body> | |
| 40 | +</html> | |
| 0 | 41 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas.css"> | |
| 5 | +<link rel="stylesheet" type="text/css" href="../../pacotes/yui231/build/tabview/assets/skins/sam/tabview.css"> | |
| 6 | +<style type="text/css">.yuibutton button{padding-left:2em;background:url(../../imagens/tic.png) 5% 50% no-repeat;}</style> | |
| 7 | +<title></title> | |
| 8 | +</head> | |
| 9 | +<body style="overflow:auto"> | |
| 10 | +<div style="top:5px;left:10px;display:block;position:absolute"> | |
| 11 | +<form id=f action="upload.php" method="post" ENCTYPE="multipart/form-data"> | |
| 12 | + <pre style="font-size:14px"> | |
| 13 | +dbf: <input class=digitar type="file" size=20 name="filedbf"> | |
| 14 | +</pre> | |
| 15 | +nome coluna x: <input class=digitar type="input" size=20 name="nomex"><br> | |
| 16 | +nome coluna y: <input class=digitar type="input" size=20 name="nomey"><br><br> | |
| 17 | +Projeção: | |
| 18 | +<div id=listaepsg style='left:0px;overflow:auto;height:60px'></div> | |
| 19 | +<div onclick='submete()' style='top:10px;left:0px'> | |
| 20 | + <input id=botao1 type="button" value="Carregar" size=12 name="submit" /> | |
| 21 | + <input type="hidden" name="MAX_FILE_SIZE" value="10000" /> | |
| 22 | +</div> | |
| 23 | +</form> | |
| 24 | +</div> | |
| 25 | +<div id=men1 style=left:0px;width:100%;top:220px; > | |
| 26 | +Utilize essa opção para acrescentar um tema baseado nas coordenadas x e y presentes em uma tabela DBF. | |
| 27 | +Os valores de x e y devem utilizar "." como separador de decimal. Se as coordenadas estiverem na projeção | |
| 28 | +geográfica, os valores deverão estar em décimos de grau, com sinal negativo para pontos ao | |
| 29 | +sul do equador e oeste do meridiano 0.<br> | |
| 30 | +O arquivo DBF será armazenado no servidor onde o i3geo está instalado e permanecerá lá até que | |
| 31 | +os arquivos temporários sejam apagados. Não utilize essa opção se existir alguma restrição ao uso do arquivo e se | |
| 32 | +a política de acesso aos dados, definidas pela entidade que hospeda o i3geo, não for compatível | |
| 33 | +com essas restrições | |
| 34 | +</div> | |
| 35 | + | |
| 36 | +<script src="../i3geo_tudo_compacto.js.php" type="text/javascript"></script> | |
| 37 | +<script language="JavaScript" type="text/javascript" src="index.js"></script> | |
| 38 | +</body> | |
| 39 | +</html> | |
| 0 | 40 | \ No newline at end of file | ... | ... |
ferramentas/uploaddbf/upload.php
| ... | ... | @@ -54,59 +54,77 @@ if (isset($_FILES['filedbf']['name'])) |
| 54 | 54 | if($status != 1) |
| 55 | 55 | {echo "Ocorreu um erro no envio do arquivo";exit;} |
| 56 | 56 | $nome = str_replace(".dbf","",$dirmap."/".$_FILES['filedbf']['name']); |
| 57 | - $nomex = strtoupper($nomex); | |
| 58 | - $nomey = strtoupper($nomey); | |
| 59 | 57 | if($status == 1) |
| 60 | 58 | { |
| 61 | - echo "<p>Arquivo enviado. Criando shape file...</p>"; | |
| 62 | - require_once("../../pacotes/phpxbase/api_conversion.php"); | |
| 63 | - $dbf = xbase_open($dirmap."/".$_FILES['filedbf']['name']); | |
| 64 | - $records = xbase_numrecords($dbf); | |
| 65 | - $record = array(); | |
| 66 | - $novoshpf = ms_newShapefileObj($nome, MS_SHP_POINT); | |
| 67 | - $novoshpf->free(); | |
| 68 | - $shapefileObj = ms_newShapefileObj($nome,-2); | |
| 69 | - for($x = 1; $x <= $records; $x++) | |
| 59 | + if(!isset($tema)) //o dbf deverá ser transformado em uma camada no mapa | |
| 70 | 60 | { |
| 71 | - $record = xbase_get_record_with_names($dbf, $x); | |
| 72 | - $poPoint = ms_newpointobj(); | |
| 73 | - $poPoint->setXY($record[$nomex],$record[$nomey]); | |
| 74 | - $shapefileObj->addpoint($poPoint); | |
| 61 | + $nomex = strtoupper($nomex); | |
| 62 | + $nomey = strtoupper($nomey); | |
| 63 | + echo "<p>Arquivo enviado. Criando shape file...</p>"; | |
| 64 | + require_once("../../pacotes/phpxbase/api_conversion.php"); | |
| 65 | + $dbf = xbase_open($dirmap."/".$_FILES['filedbf']['name']); | |
| 66 | + $records = xbase_numrecords($dbf); | |
| 67 | + $record = array(); | |
| 68 | + $novoshpf = ms_newShapefileObj($nome, MS_SHP_POINT); | |
| 69 | + $novoshpf->free(); | |
| 70 | + $shapefileObj = ms_newShapefileObj($nome,-2); | |
| 71 | + for($x = 1; $x <= $records; $x++) | |
| 72 | + { | |
| 73 | + $record = xbase_get_record_with_names($dbf, $x); | |
| 74 | + $poPoint = ms_newpointobj(); | |
| 75 | + $poPoint->setXY($record[$nomex],$record[$nomey]); | |
| 76 | + $shapefileObj->addpoint($poPoint); | |
| 77 | + } | |
| 78 | + $shapefileObj->free(); | |
| 79 | + $mapt = ms_newMapObj($temasaplic."/novotema.map"); | |
| 80 | + $novolayer = $mapt->getLayerByName("novotema"); | |
| 81 | + $novolayer->set("data",$nome.".shp"); | |
| 82 | + $novolayer->set("name",basename($nome)); | |
| 83 | + $novolayer->setmetadata("TEMA",basename($nome)); | |
| 84 | + $novolayer->setmetadata("DOWNLOAD","SIM"); | |
| 85 | + $novolayer->set("type",MS_LAYER_POINT); | |
| 86 | + $novolayer->setfilter(""); | |
| 87 | + $classe = $novolayer->getclass(0); | |
| 88 | + $estilo = $classe->getstyle(0); | |
| 89 | + $estilo->set("symbolname","ponto"); | |
| 90 | + $estilo->set("size",6); | |
| 91 | + // le os itens | |
| 92 | + $novolayer->set("status",MS_DEFAULT); | |
| 93 | + $abriu = $novolayer->open(); | |
| 94 | + $items = $novolayer->getItems(); | |
| 95 | + $fechou = $novolayer->close(); | |
| 96 | + if ($items != "") | |
| 97 | + { | |
| 98 | + $its = implode(",",$items); | |
| 99 | + $novolayer->setmetadata("ITENS",$its); | |
| 100 | + $novolayer->setmetadata("ITENSDESC",$its); | |
| 101 | + $novolayer->set("template","none.htm"); | |
| 102 | + } | |
| 103 | + if($epsg != "") | |
| 104 | + {$novolayer->setProjection("init=epsg:".$epsg);} | |
| 105 | + $adiciona = ms_newLayerObj($mapa, $novolayer); | |
| 106 | + $salvo = $mapa->save($map_file); | |
| 107 | + echo "Tema criado!!!"; | |
| 108 | + echo "<script>window.parent.remapaf()</script>"; | |
| 75 | 109 | } |
| 76 | - $shapefileObj->free(); | |
| 77 | - $mapt = ms_newMapObj($temasaplic."/novotema.map"); | |
| 78 | - $novolayer = $mapt->getLayerByName("novotema"); | |
| 79 | - $novolayer->set("data",$nome.".shp"); | |
| 80 | - $novolayer->set("name",basename($nome)); | |
| 81 | - $novolayer->setmetadata("TEMA",basename($nome)); | |
| 82 | - $novolayer->setmetadata("DOWNLOAD","SIM"); | |
| 83 | - $novolayer->set("type",MS_LAYER_POINT); | |
| 84 | - $novolayer->setfilter(""); | |
| 85 | - $classe = $novolayer->getclass(0); | |
| 86 | - $estilo = $classe->getstyle(0); | |
| 87 | - $estilo->set("symbolname","ponto"); | |
| 88 | - $estilo->set("size",6); | |
| 89 | - // le os itens | |
| 90 | - $novolayer->set("status",MS_DEFAULT); | |
| 91 | - $abriu = $novolayer->open(); | |
| 92 | - $items = $novolayer->getItems(); | |
| 93 | - $fechou = $novolayer->close(); | |
| 94 | - if ($items != "") | |
| 110 | + else //join com um tema | |
| 95 | 111 | { |
| 96 | - $its = implode(",",$items); | |
| 97 | - $novolayer->setmetadata("ITENS",$its); | |
| 98 | - $novolayer->setmetadata("ITENSDESC",$its); | |
| 99 | - $novolayer->set("template","none.htm"); | |
| 112 | + //$layer = $mapa->getlayerbyname($tema); | |
| 113 | + $dbf = $dirmap."/".$_FILES['filedbf']['name']; | |
| 114 | + $string = 'JOIN '."\n".' NAME "'.$_FILES['filedbf']['name'].'"'."\n"; | |
| 115 | + $string .= 'TABLE "'.$dbf.'"'."\n"; | |
| 116 | + $string .= 'FROM "'.$item.'"'."\n"; | |
| 117 | + $string .= 'TO "'.$colunadbf.'"'."\n"; | |
| 118 | + $string .= 'TYPE ONE-TO-ONE'."\n"." END"."\n"; | |
| 119 | + $string .= 'TEMPLATE "none.htm"'."\n"; | |
| 120 | + | |
| 121 | + //$layer->updatefromstring($string); | |
| 122 | + //$salvo = $mapa->save($map_file); | |
| 123 | + include_once("../../classesphp/classe_mapa.php"); | |
| 124 | + $m = new Mapa($map_file,$locaplic); | |
| 125 | + $m->insereJOIN($string,$tema); | |
| 126 | + echo "Junção concluida!!!"; | |
| 100 | 127 | } |
| 101 | - //echo $epsg; | |
| 102 | - | |
| 103 | - if($epsg != "") | |
| 104 | - {$novolayer->setProjection("init=epsg:".$epsg);} | |
| 105 | - $adiciona = ms_newLayerObj($mapa, $novolayer); | |
| 106 | - $salvo = $mapa->save($map_file); | |
| 107 | - //grava os templates de cada tema | |
| 108 | - echo "Tema criado!!!"; | |
| 109 | - echo "<script>window.parent.remapaf()</script>"; | |
| 110 | 128 | } |
| 111 | 129 | else |
| 112 | 130 | { | ... | ... |