Commit 246213ee4dc695379342a168161bd49a6ae66fc5
1 parent
b871ac88
Exists in
master
and in
7 other branches
Separacao do codigo utilizado no upload de shp do sistema de administracao e das ferramentas
Showing
9 changed files
with
524 additions
and
186 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/subirshapefile.html
| ... | ... | @@ -16,7 +16,7 @@ body { |
| 16 | 16 | </style> |
| 17 | 17 | <script type="text/javascript" src="../js/core.js"></script> |
| 18 | 18 | <script type="text/javascript" src="../../classesjs/i3geo.js"></script> |
| 19 | -<script type="text/javascript" src="../../ferramentas/upload/index.js"></script> | |
| 19 | +<script type="text/javascript" src="../js/subirshapefile.js"></script> | |
| 20 | 20 | <script type="text/javascript" src="../../ferramentas/upload/dicionario.js"></script> |
| 21 | 21 | <script type="text/javascript" src="../dicionario/core.js"></script> |
| 22 | 22 | <link rel="stylesheet" type="text/css" href="admin.css"> | ... | ... |
admin/html/subirsimbolo_.html
| ... | ... | @@ -1,80 +0,0 @@ |
| 1 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
| 2 | -<html> | |
| 3 | -<head> | |
| 4 | -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
| 5 | -<title>Shape file</title> | |
| 6 | -<style type="text/css"> | |
| 7 | -/*margin and padding on body element | |
| 8 | - can introduce errors in determining | |
| 9 | - element position and are not recommended; | |
| 10 | - we turn them off as a foundation for YUI | |
| 11 | - CSS treatments. */ | |
| 12 | -body { | |
| 13 | - margin: 0; | |
| 14 | - padding: 0; | |
| 15 | -} | |
| 16 | -</style> | |
| 17 | -<script type="text/javascript" src="../js/core_.js"></script> | |
| 18 | -<script type="text/javascript" src="../../classesjs/i3geo.js"></script> | |
| 19 | -<script type="text/javascript" src="../../ferramentas/uploadsimbolo/index.js"></script> | |
| 20 | -<script type="text/javascript" src="../../ferramentas/uploadsimbolo/dicionario.js"></script> | |
| 21 | - | |
| 22 | -<script type="text/javascript" src="../dicionario/core.js"></script> | |
| 23 | -<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 24 | -</head> | |
| 25 | -<body class=" yui-skin-sam fundoPonto" style="background-color: white; margin-top: 20px;"> | |
| 26 | - <center> | |
| 27 | - <div class="mascaraPrincipal" id="divGeral"> | |
| 28 | - <div id="formulario" style="display: none"> | |
| 29 | - <div id="conteudo" style="width: 500px"></div> | |
| 30 | - </div> | |
| 31 | - </div> | |
| 32 | - <br> <br> <br> <br> <br> <br> <br> | |
| 33 | - <br> <br> <br> <br> <br> <br> <br> | |
| 34 | - <br> <br> <br> <br> <br> <br> <br> | |
| 35 | - </center> | |
| 36 | - <script> | |
| 37 | -/* | |
| 38 | -Title: Subir simbolo | |
| 39 | - | |
| 40 | -Envia um arquivo de imagem para o servidor | |
| 41 | - | |
| 42 | -Licenca: | |
| 43 | - | |
| 44 | -GPL2 | |
| 45 | - | |
| 46 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 47 | - | |
| 48 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 49 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 50 | - | |
| 51 | -Este programa é software livre; você pode redistribuí-lo | |
| 52 | -e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 53 | -GNU conforme publicada pela Free Software Foundation; | |
| 54 | - | |
| 55 | -Este programa é distribuído na expectativa de que seja útil, | |
| 56 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 57 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 58 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 59 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 60 | -GNU junto com este programa; se não, escreva para a | |
| 61 | -Free Software Foundation, Inc., no endereço | |
| 62 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 63 | - | |
| 64 | -Arquivo: | |
| 65 | - | |
| 66 | -i3geo/admin/html/subirsimbolo.html | |
| 67 | -*/ | |
| 68 | -i3GEO.configura = { | |
| 69 | - locaplic : "../.." | |
| 70 | -}; | |
| 71 | -i3GEO.parametros.editor = "sim"; | |
| 72 | -i3GEO.configura.sid = ""; | |
| 73 | -cabecalhoGeral("cabecalhoPrincipal",""); | |
| 74 | -temp = function(){ | |
| 75 | - document.getElementById("formulario").style.display = "block"; | |
| 76 | - i3GEOF.uploadsimbolo.inicia("conteudo"); | |
| 77 | -}; | |
| 78 | -i3GEO.login.verificaOperacao("admin/html/subirshapefile",i3GEO.configura.locaplic,temp,"sessao",i3GEO.login.dialogo.abreLogin); | |
| 79 | -</script> | |
| 80 | -</body> |
| ... | ... | @@ -0,0 +1,203 @@ |
| 1 | +//Esse programa e um clone de i3geo/ferramentas/upload/index.js | |
| 2 | +// | |
| 3 | + | |
| 4 | +/* | |
| 5 | + | |
| 6 | + | |
| 7 | +Title: Upload de arquivo shapefile | |
| 8 | + | |
| 9 | +Envia para o servidor um arquivo shapefile local e insere como uma camada no mapa. | |
| 10 | + | |
| 11 | +Veja: | |
| 12 | + | |
| 13 | +<i3GEO.arvoreDeTemas.dialogo.upload> | |
| 14 | + | |
| 15 | +Arquivo: i3geo/ferramentas/upload/index.js.php | |
| 16 | + | |
| 17 | +About: Licença | |
| 18 | + | |
| 19 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 20 | + | |
| 21 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 22 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 23 | + | |
| 24 | +Este programa é software livre; você pode redistribuí-lo | |
| 25 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 26 | +GNU conforme publicada pela Free Software Foundation; | |
| 27 | + | |
| 28 | +Este programa é distribuído na expectativa de que seja útil, | |
| 29 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 30 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 31 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 32 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 33 | +GNU junto com este programa; se não, escreva para a | |
| 34 | +Free Software Foundation, Inc., no endereço | |
| 35 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 36 | +*/ | |
| 37 | +if(typeof(i3GEOF) === 'undefined'){ | |
| 38 | + var i3GEOF = {}; | |
| 39 | +} | |
| 40 | +/* | |
| 41 | +Classe: i3GEOF.upload | |
| 42 | +*/ | |
| 43 | +i3GEOF.upload = { | |
| 44 | + /* | |
| 45 | + Variavel: aguarde | |
| 46 | + | |
| 47 | + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | |
| 48 | + */ | |
| 49 | + aguarde: "", | |
| 50 | + /* | |
| 51 | + Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
| 52 | + */ | |
| 53 | + criaJanelaFlutuante: function(){ | |
| 54 | + i3GEOF.upload.iniciaDicionario(); | |
| 55 | + }, | |
| 56 | + /* | |
| 57 | + Function: iniciaDicionario | |
| 58 | + | |
| 59 | + Carrega o dicionário e chama a função que inicia a ferramenta | |
| 60 | + | |
| 61 | + O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
| 62 | + */ | |
| 63 | + iniciaDicionario: function(){ | |
| 64 | + if(typeof(i3GEOF.upload.dicionario) === 'undefined'){ | |
| 65 | + i3GEO.util.scriptTag( | |
| 66 | + i3GEO.configura.locaplic+"/ferramentas/upload/dicionario.js", | |
| 67 | + "i3GEOF.upload.iniciaJanelaFlutuante()", | |
| 68 | + "i3GEOF.upload.dicionario_script" | |
| 69 | + ); | |
| 70 | + } | |
| 71 | + else{ | |
| 72 | + i3GEOF.upload.iniciaJanelaFlutuante(); | |
| 73 | + } | |
| 74 | + }, | |
| 75 | + /* | |
| 76 | + Function: inicia | |
| 77 | + | |
| 78 | + Inicia a ferramenta. É chamado por criaJanelaFlutuante | |
| 79 | + | |
| 80 | + Parametro: | |
| 81 | + | |
| 82 | + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | |
| 83 | + */ | |
| 84 | + inicia: function(iddiv){ | |
| 85 | + try{ | |
| 86 | + $i(iddiv).innerHTML += i3GEOF.upload.html(); | |
| 87 | + var b = new YAHOO.widget.Button( | |
| 88 | + "i3GEOuploadbotao1", | |
| 89 | + {onclick:{fn: i3GEOF.upload.submete}} | |
| 90 | + ); | |
| 91 | + b.addClass("rodar"); | |
| 92 | + i3GEO.util.radioEpsg( | |
| 93 | + function(retorno){ | |
| 94 | + $i("i3GEOuploadListaepsg").innerHTML = retorno.dados; | |
| 95 | + }, | |
| 96 | + "i3GEOuploadListaepsg", | |
| 97 | + "upload", | |
| 98 | + "nao" | |
| 99 | + ); | |
| 100 | + } | |
| 101 | + catch(erro){i3GEO.janela.tempoMsg(erro);} | |
| 102 | + }, | |
| 103 | + /* | |
| 104 | + Function: html | |
| 105 | + | |
| 106 | + Gera o código html para apresentação das opções da ferramenta | |
| 107 | + | |
| 108 | + Retorno: | |
| 109 | + | |
| 110 | + String com o código html | |
| 111 | + */ | |
| 112 | + html:function(){ | |
| 113 | + var ins = '<form id=i3GEOuploadf target="i3GEOuploadiframe" action="'+i3GEO.configura.locaplic+'/admin/php/subirshapefile.php" method="post" ENCTYPE="multipart/form-data">' + | |
| 114 | + '<fieldset class=subbloco >' + | |
| 115 | + '<p class="paragrafo" >shp: <br><input type="file" size=22 name="i3GEOuploadshp" style="top:0px;left:0px;cursor:pointer;"></p>' + | |
| 116 | + '<p class="paragrafo" >shx: <br><input type="file" size=22 name="i3GEOuploadshx" style="top:0px;left:0px;cursor:pointer;"></p>' + | |
| 117 | + '<p class="paragrafo" >dbf: <br><input type="file" size=22 name="i3GEOuploaddbf" style="top:0px;left:0px;cursor:pointer;"></p>' + | |
| 118 | + '<p class="paragrafo" >prj (opcional): <br><input type="file" size=22 name="i3GEOuploadprj" style="top:0px;left:0px;cursor:pointer;"></p>' + | |
| 119 | + '</fieldset>'; | |
| 120 | + if(i3GEO.parametros.editor === "sim"){ | |
| 121 | + ins += '<fieldset class=subbloco >' + | |
| 122 | + '<p class="paragrafo" >'+$trad('pastaArmazenamento',i3GEOF.upload.dicionario)+':</p>' + | |
| 123 | + '<div class="i3geoForm i3geoFormIconeEdita" ><input type="text" name="dirDestino" id="dirDestino" /></div>' + | |
| 124 | + " <img onclick='i3GEO.util.navegadorDir(\"dirDestino\",false,false,false,true);' src='"+i3GEO.configura.locaplic+"/imagens/ic_zoom.png' style='cursor:pointer;position :relative;top:2px'/></p>" + | |
| 125 | + '<p class="paragrafo" ><input type=checkbox name=i3GEOuploadCriaMapfile id=i3GEOuploadCriaMapfile /> '+$trad('criaMapfile',i3GEOF.upload.dicionario) + | |
| 126 | + '</fieldset>'; | |
| 127 | + } | |
| 128 | + ins += '<fieldset class=subbloco >' + | |
| 129 | + '<p class="paragrafo" >'+$trad('tipoGeom',i3GEOF.upload.dicionario)+': </p>' + | |
| 130 | + ' <div class=styled-select >' + | |
| 131 | + ' <select id=tipo name=tipo >' + | |
| 132 | + ' <option value="">'+$trad('naoConhecido',i3GEOF.upload.dicionario)+'</option>' + | |
| 133 | + ' <option value="1">'+$trad('pontual',i3GEOF.upload.dicionario)+'</option>' + | |
| 134 | + ' <option value="5">'+$trad('poligonal',i3GEOF.upload.dicionario)+'</option>' + | |
| 135 | + ' <option value="3">'+$trad('linear',i3GEOF.upload.dicionario)+'</option>' + | |
| 136 | + ' </select>' + | |
| 137 | + '</div>' + | |
| 138 | + '<br><p class=paragrafo >'+$trad('projecao',i3GEOF.upload.dicionario)+':</p>' + | |
| 139 | + '<div id=i3GEOuploadListaepsg width="98%" style="text-align:left;border:1px solid gray;left:0px;overflow:auto;height:60px"></div>' + | |
| 140 | + '</fieldset>' + | |
| 141 | + '<fieldset class=subbloco >' + | |
| 142 | + '<p class="paragrafo" ><input id=i3GEOuploadbotao1 type="button" value="'+$trad('envia',i3GEOF.upload.dicionario)+'" size=12 name="submit">' + | |
| 143 | + '<input type=hidden name=g_sid value="'+i3GEO.configura.sid+'" >' + | |
| 144 | + '<input type="hidden" name="MAX_FILE_SIZE" value="1000000">' + | |
| 145 | + '</form>' + | |
| 146 | + | |
| 147 | + "<p class='paragrafo' style=color:red >"+$trad('ajudaCaracter',i3GEOF.upload.dicionario)+"</p>" + | |
| 148 | + '<iframe name=i3GEOuploadiframe style="text-align:left;border:1px solid gray;" width="98%" height="60px"></iframe>' + | |
| 149 | + '</fieldset>'; | |
| 150 | + return ins; | |
| 151 | + }, | |
| 152 | + /* | |
| 153 | + Function: iniciaJanelaFlutuante | |
| 154 | + | |
| 155 | + Cria a janela flutuante para controle da ferramenta. | |
| 156 | + */ | |
| 157 | + iniciaJanelaFlutuante: function(){ | |
| 158 | + var janela,divid,titulo,cabecalho,minimiza; | |
| 159 | + if ($i("i3GEOF.upload")) { | |
| 160 | + return; | |
| 161 | + } | |
| 162 | + cabecalho = function(){}; | |
| 163 | + minimiza = function(){ | |
| 164 | + i3GEO.janela.minimiza("i3GEOF.upload"); | |
| 165 | + }; | |
| 166 | + titulo = "<span class='i3GEOiconeFerramenta i3GEOiconeUpload'></span>" | |
| 167 | + + "<div class='i3GeoTituloJanela'>" + $trad("a2")+"<a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=4&idajuda=27' ><b> </b></a></div>"; | |
| 168 | + janela = i3GEO.janela.cria( | |
| 169 | + "400px", | |
| 170 | + "480px", | |
| 171 | + "", | |
| 172 | + "", | |
| 173 | + "", | |
| 174 | + titulo, | |
| 175 | + "i3GEOF.upload", | |
| 176 | + false, | |
| 177 | + "hd", | |
| 178 | + cabecalho, | |
| 179 | + minimiza, | |
| 180 | + "", | |
| 181 | + true | |
| 182 | + ); | |
| 183 | + divid = janela[2].id; | |
| 184 | + $i("i3GEOF.upload_corpo").style.backgroundColor = "white"; | |
| 185 | + i3GEOF.upload.aguarde = $i("i3GEOF.upload_imagemCabecalho").style; | |
| 186 | + i3GEOF.upload.inicia(divid); | |
| 187 | + }, | |
| 188 | + /* | |
| 189 | + Function: submete | |
| 190 | + | |
| 191 | + Submete o arquivo ao servidor | |
| 192 | + */ | |
| 193 | + submete: function(){ | |
| 194 | + if(i3GEOF.upload.aguarde.visibility==="visible") | |
| 195 | + {return;} | |
| 196 | + i3GEOF.upload.aguarde.visibility="visible"; | |
| 197 | + $i("i3GEOuploadf").submit(); | |
| 198 | + }, | |
| 199 | + selNavegador: function(onde){ | |
| 200 | + i3GEO.util.navegadorDir(onde,false,false,false); | |
| 201 | + } | |
| 202 | +}; | |
| 203 | + | ... | ... |
admin/php/gruposusuarios.php
| ... | ... | @@ -72,6 +72,10 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
| 72 | 72 | retornaJSON("Vc nao pode realizar essa operacao.");exit; |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | + | |
| 76 | +$id_usuario = $_GET["id_usuario"]; | |
| 77 | +testaSafeNumerico([$id_usuario]); | |
| 78 | + | |
| 75 | 79 | switch (strtoupper($funcao)) |
| 76 | 80 | { |
| 77 | 81 | case "ALTERARGRUPOS": |
| ... | ... | @@ -127,9 +131,11 @@ switch (strtoupper($funcao)) |
| 127 | 131 | cpjson($retorno); |
| 128 | 132 | function alterarGrupos() |
| 129 | 133 | { |
| 130 | - global $id_grupo,$nome,$descricao; | |
| 134 | + global $id_grupo; | |
| 131 | 135 | try |
| 132 | 136 | { |
| 137 | + $nome = $_GET["nome"]; | |
| 138 | + $descricao = $_GET["descricao"]; | |
| 133 | 139 | include(dirname(__FILE__)."/conexao.php"); |
| 134 | 140 | if($convUTF){ |
| 135 | 141 | $nome = utf8_encode($nome); | ... | ... |
| ... | ... | @@ -0,0 +1,248 @@ |
| 1 | +<?php | |
| 2 | +// | |
| 3 | +//caso o usuário seja um administrador, ele pode enviar um nome de diretório onde os arquivos serão armazenados | |
| 4 | +//na variável $dirDestino | |
| 5 | +// | |
| 6 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
| 7 | +$_GET = array_merge($_GET,$_POST); | |
| 8 | +if(isset($_GET["tipo"])){ | |
| 9 | + $tipo = $_GET["tipo"]; | |
| 10 | +} | |
| 11 | +require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | |
| 12 | +include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | |
| 13 | +error_reporting(0); | |
| 14 | +session_name("i3GeoPHP"); | |
| 15 | +if(isset($_GET["g_sid"]) && $_GET["g_sid"] != ""){ | |
| 16 | + session_id($_GET["g_sid"]); | |
| 17 | + session_start(); | |
| 18 | + $map_file = $_SESSION["map_file"]; | |
| 19 | +} | |
| 20 | +if (ob_get_level() == 0) ob_start(); | |
| 21 | +?> | |
| 22 | +<html> | |
| 23 | +<head> | |
| 24 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 25 | +<link rel="stylesheet" type="text/css" href="../../css/input.css" /> | |
| 26 | +<link rel="stylesheet" type="text/css" href="../../css/geral.css" /> | |
| 27 | +<script src="../../classesjs/classe_util.js"></script> | |
| 28 | +<title></title> | |
| 29 | +</head> | |
| 30 | +<body bgcolor="white" style="background-color:white;text-align:left;"> | |
| 31 | +<p> | |
| 32 | +<?php | |
| 33 | +if (isset($_FILES['i3GEOuploadshp']['name'])) | |
| 34 | +{ | |
| 35 | + $dirDestino = $_POST["dirDestino"]; | |
| 36 | + require_once (dirname(__FILE__)."/../../ms_configura.php"); | |
| 37 | + | |
| 38 | + if(isset($logExec) && $logExec["upload"] == true){ | |
| 39 | + i3GeoLog("prog: upload filename:" . $_FILES['i3GEOuploadshp']['name'],$dir_tmp); | |
| 40 | + } | |
| 41 | + | |
| 42 | + echo "<p class='paragrafo' >Carregando o arquivo...</p>"; | |
| 43 | + ob_flush(); | |
| 44 | + flush(); | |
| 45 | + sleep(1); | |
| 46 | + if(isset($map_file) && $map_file != ""){ | |
| 47 | + $mapa = ms_newMapObj($map_file); | |
| 48 | + $dirmap = dirname($map_file); | |
| 49 | + } | |
| 50 | + if(isset($dirDestino) && $dirDestino != ""){ | |
| 51 | + $dirmap = $dirDestino; | |
| 52 | + include_once(dirname(__FILE__)."/../../admin/php/login.php"); | |
| 53 | + if(verificaOperacaoSessao("admin/php/editortexto") == false){ | |
| 54 | + echo "Vc nao pode salvar os dados no servidor em uma pasta específica";exit; | |
| 55 | + } | |
| 56 | + if(!file_exists($dirmap)) | |
| 57 | + {echo "<p class='paragrafo' >Pasta não existe no servidor";paraAguarde();exit;} | |
| 58 | + } | |
| 59 | + //verifica nomes | |
| 60 | + verificaNome($_FILES['i3GEOuploadshp']['name']); | |
| 61 | + verificaNome($_FILES['i3GEOuploadshx']['name']); | |
| 62 | + verificaNome($_FILES['i3GEOuploaddbf']['name']); | |
| 63 | + | |
| 64 | + if($_FILES['i3GEOuploadprj']['name'] != ""){ | |
| 65 | + verificaNome($_FILES['i3GEOuploadprj']['name']); | |
| 66 | + } | |
| 67 | + | |
| 68 | + //remove acentos | |
| 69 | + $nomePrefixo = str_replace(" ","_",removeAcentos(str_replace(".shp","",$_FILES['i3GEOuploadshp']['name']))); | |
| 70 | + | |
| 71 | + $nomePrefixo = str_replace(".","",$nomePrefixo); | |
| 72 | + $nomePrefixo = strip_tags($nomePrefixo); | |
| 73 | + $nomePrefixo = htmlspecialchars($nomePrefixo, ENT_QUOTES); | |
| 74 | + $nomePrefixo = $nomePrefixo . md5(uniqid(rand(), true)); | |
| 75 | + | |
| 76 | + //sobe arquivo | |
| 77 | + $Arquivo = $_FILES['i3GEOuploadshp']['tmp_name']; | |
| 78 | + if(file_exists($dirmap."/".$nomePrefixo.".shp")) | |
| 79 | + {echo "<p class='paragrafo' >Já existe um SHP com o nome ";paraAguarde();exit;} | |
| 80 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".shp"); | |
| 81 | + if($status != 1) | |
| 82 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHP. Pode ser uma limitação quanto ao tamanho do arquivo ou permissão de escrita na pasta indicada.";paraAguarde();exit;} | |
| 83 | + | |
| 84 | + $Arquivo = $_FILES['i3GEOuploadshx']['tmp_name']; | |
| 85 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".shx"); | |
| 86 | + if($status != 1) | |
| 87 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHX";paraAguarde();exit;} | |
| 88 | + | |
| 89 | + $Arquivo = $_FILES['i3GEOuploaddbf']['tmp_name']; | |
| 90 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".dbf"); | |
| 91 | + if($status != 1) | |
| 92 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo DBF";paraAguarde();exit;} | |
| 93 | + | |
| 94 | + if($_FILES['i3GEOuploadprj']['name'] != ""){ | |
| 95 | + $Arquivo = $_FILES['i3GEOuploadprj']['tmp_name']; | |
| 96 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".prj"); | |
| 97 | + if($status != 1){ | |
| 98 | + echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo PRJ";paraAguarde();exit; | |
| 99 | + } | |
| 100 | + } | |
| 101 | + | |
| 102 | + if(!file_exists($dirmap."/".$nomePrefixo.".shp")) | |
| 103 | + {echo "<p class='paragrafo' >Ocorreu algum problema no envio do arquivo ";paraAguarde();exit;} | |
| 104 | + | |
| 105 | + | |
| 106 | + $checkphp = fileContemString($dirmap."/".$nomePrefixo.".prj","<?"); | |
| 107 | + if($checkphp == true){ | |
| 108 | + echo "Arquivo prj invalido"; | |
| 109 | + unlink($dirmap."/".$nomePrefixo.".shp"); | |
| 110 | + unlink($dirmap."/".$nomePrefixo.".dbf"); | |
| 111 | + unlink($dirmap."/".$nomePrefixo.".shx"); | |
| 112 | + unlink($dirmap."/".$nomePrefixo.".prj"); | |
| 113 | + exit; | |
| 114 | + } | |
| 115 | + $checkphp = fileContemString($dirmap."/".$nomePrefixo.".shx","<?"); | |
| 116 | + if($checkphp == true){ | |
| 117 | + echo "Arquivo shx invalido"; | |
| 118 | + unlink($dirmap."/".$nomePrefixo.".shp"); | |
| 119 | + unlink($dirmap."/".$nomePrefixo.".dbf"); | |
| 120 | + unlink($dirmap."/".$nomePrefixo.".shx"); | |
| 121 | + unlink($dirmap."/".$nomePrefixo.".prj"); | |
| 122 | + exit; | |
| 123 | + } | |
| 124 | + $checkphp = fileContemString($dirmap."/".$nomePrefixo.".dbf","<?"); | |
| 125 | + if($checkphp == true){ | |
| 126 | + echo "Arquivo dbf invalido"; | |
| 127 | + unlink($dirmap."/".$nomePrefixo.".shp"); | |
| 128 | + unlink($dirmap."/".$nomePrefixo.".dbf"); | |
| 129 | + unlink($dirmap."/".$nomePrefixo.".shx"); | |
| 130 | + unlink($dirmap."/".$nomePrefixo.".prj"); | |
| 131 | + exit; | |
| 132 | + } | |
| 133 | +echo $dirmap."/".$nomePrefixo; | |
| 134 | + echo "<p class='paragrafo' >Arquivo enviado.</p>"; | |
| 135 | + echo "<p class='paragrafo'></p>"; | |
| 136 | + //nesse caso o formulario de upload esta sendo executado de dentro de um mapa interativo, por isso o mapfile ja existe | |
| 137 | + if(isset($map_file)){ | |
| 138 | + echo "<p class='paragrafo' >Adicionando tema...</p>"; | |
| 139 | + ob_flush(); | |
| 140 | + flush(); | |
| 141 | + sleep(1); | |
| 142 | + $novolayer = ms_newLayerObj($mapa); | |
| 143 | + $novolayer->set("data",$dirmap."/".$nomePrefixo.".shp"); | |
| 144 | + $novolayer->set("name",$_FILES['i3GEOuploadshp']['name']); | |
| 145 | + $novolayer->setmetadata("TEMA",$_FILES['i3GEOuploadshp']['name']); | |
| 146 | + $novolayer->setmetadata("DOWNLOAD","SIM"); | |
| 147 | + $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | |
| 148 | + if(!isset($tipo) || $tipo == "") | |
| 149 | + {$tipo = $sfileObj->type;} | |
| 150 | + if ($tipo == 1){$novolayer->set("type",MS_LAYER_POINT);} // ponto | |
| 151 | + if ($tipo == 3){$novolayer->set("type",MS_LAYER_LINE);} | |
| 152 | + if ($tipo == 5){$novolayer->set("type",MS_LAYER_POLYGON);} | |
| 153 | + $novolayer->setmetadata("TEMALOCAL","SIM"); | |
| 154 | + $novolayer->setmetadata("CLASSE","SIM"); | |
| 155 | + $novolayer->setmetadata("TEXTO","NAO"); | |
| 156 | + //if (($tipo != 3) and ($tipo != 8 )){$novolayer->set("type",0);} | |
| 157 | + $novolayer->setfilter(""); | |
| 158 | + $classe = ms_newClassObj($novolayer); | |
| 159 | + $classe->set("name",""); | |
| 160 | + $estilo = ms_newStyleObj($classe); | |
| 161 | + if ($tipo == 1) | |
| 162 | + { | |
| 163 | + $estilo->set("symbolname","ponto"); | |
| 164 | + $estilo->set("size",6); | |
| 165 | + } | |
| 166 | + $estilo->color->setrgb(200,50,0); | |
| 167 | + $estilo->outlinecolor->setrgb(0,0,0); | |
| 168 | + // le os itens | |
| 169 | + $novolayer->set("status",MS_DEFAULT); | |
| 170 | + $abriu = $novolayer->open(); | |
| 171 | + $items = $novolayer->getItems(); | |
| 172 | + $fechou = $novolayer->close(); | |
| 173 | + if ($items != "") | |
| 174 | + { | |
| 175 | + $its = implode(",",$items); | |
| 176 | + $novolayer->setmetadata("ITENS",$its); | |
| 177 | + $novolayer->setmetadata("ITENSDESC",$its); | |
| 178 | + $novolayer->set("template","none.htm"); | |
| 179 | + } | |
| 180 | + if(isset($_GET["uploadEPSG"]) && $_GET["uploadEPSG"] != ""){ | |
| 181 | + $novolayer->setProjection("init=epsg:".$_GET["uploadEPSG"]); | |
| 182 | + } | |
| 183 | + if(file_exists($dirmap."/".$nomePrefixo.".prj")){ | |
| 184 | + $novolayer->setProjection("AUTO"); | |
| 185 | + } | |
| 186 | + //$adiciona = ms_newLayerObj($mapa, $novolayer); | |
| 187 | + $salvo = $mapa->save($map_file); | |
| 188 | + //grava os templates de cada tema | |
| 189 | + echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa."; | |
| 190 | + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; | |
| 191 | + } | |
| 192 | + elseif($i3GEOuploadCriaMapfile == "on"){ | |
| 193 | + //verifica se o usuario marcou a opcao de cria mapfile | |
| 194 | + //nesse caso o aplicativo de upload esta sendo executado de dentro do sistema de administracao, e o mapfile devera | |
| 195 | + //ser criado e registrado no sistema | |
| 196 | + $nome = $nomePrefixo; | |
| 197 | + $codigo = $nomePrefixo; | |
| 198 | + $it = $nomePrefixo; | |
| 199 | + $en = $nomePrefixo; | |
| 200 | + $es = $nomePrefixo; | |
| 201 | + $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | |
| 202 | + if(!isset($tipo) || $tipo == ""){ | |
| 203 | + $tipo = $sfileObj->type; | |
| 204 | + } | |
| 205 | + if ($tipo == 1){ | |
| 206 | + $tipoLayer = "point"; | |
| 207 | + } | |
| 208 | + if ($tipo == 3){ | |
| 209 | + $tipoLayer = "line"; | |
| 210 | + } | |
| 211 | + if ($tipo == 5){ | |
| 212 | + $tipoLayer = "polygon"; | |
| 213 | + } | |
| 214 | + $funcao = "CRIARNOVOMAP"; | |
| 215 | + $output = "retorno"; | |
| 216 | + $data = $dirmap."/".$nomePrefixo.".shp"; | |
| 217 | + include_once($locaplic."/admin/php/editormapfile.php"); | |
| 218 | + echo "<b><p class='paragrafo' >Criado!!!<br>"; | |
| 219 | + echo "Para editar clique: <a href='../../admin/html/editormapfile.html' target=_blank >editar</a>"; | |
| 220 | + echo "<script>window.scrollTo(0,10000);i3GEO.util.insereCookie('I3GEOletraAdmin','".$nomePrefixo."');</script>"; | |
| 221 | + } | |
| 222 | +} | |
| 223 | +else | |
| 224 | +{ | |
| 225 | + echo "<p class='paragrafo' >Erro ao enviar o arquivo. Talvez o tamanho do arquivo seja maior do que o permitido.</p>"; | |
| 226 | +} | |
| 227 | +restauraCon($map_file,$postgis_mapa); | |
| 228 | +paraAguarde(); | |
| 229 | +function paraAguarde(){ | |
| 230 | + echo "<script>try{window.scrollTo(0,10000);window.parent.i3GEOF.upload.aguarde.visibility='hidden';}catch(e){};</script>"; | |
| 231 | +} | |
| 232 | +function verificaNome($nome){ | |
| 233 | + if(strlen(basename($nome)) > 200){ | |
| 234 | + exit; | |
| 235 | + } | |
| 236 | + $nome = strtolower($nome); | |
| 237 | + $lista = explode(".",$nome); | |
| 238 | + $extensao = $lista[count($lista) - 1]; | |
| 239 | + if(($extensao != "dbf") && ($extensao != "shx") && ($extensao != "shp") && ($extensao != "prj")) | |
| 240 | + { | |
| 241 | + echo "Nome de arquivo inválido. $nome"; | |
| 242 | + paraAguarde(); | |
| 243 | + exit; | |
| 244 | + } | |
| 245 | +} | |
| 246 | +?> | |
| 247 | +</body> | |
| 248 | +</html> | ... | ... |
classesphp/mapa_controle.php
| ... | ... | @@ -122,7 +122,7 @@ $interfaceTemp = $interface; |
| 122 | 122 | //TEMA2SLD e usado por datadownload.htm |
| 123 | 123 | //PEGAMAPAS e utilizado em varias funcoes |
| 124 | 124 | // |
| 125 | -if ($funcao != "pegaTodosTemas" && $funcao != "download3" && $funcao != "listainterfaces" && $funcao != "pegalistadetemas" && $funcao != "pegalistadeSubgrupos" && $funcao != "procurartemasestrela" && $funcao != "pegalistadegrupos" && $funcao != "pegalistademenus" && $funcao != "criaMapa" && strtoupper($funcao) != "TEMA2SLD" && strtoupper($funcao) != "PEGAMAPAS"){ | |
| 125 | +if ($funcao != "listaEpsg" && $funcao != "pegaTodosTemas" && $funcao != "download3" && $funcao != "listainterfaces" && $funcao != "pegalistadetemas" && $funcao != "pegalistadeSubgrupos" && $funcao != "procurartemasestrela" && $funcao != "pegalistadegrupos" && $funcao != "pegalistademenus" && $funcao != "criaMapa" && strtoupper($funcao) != "TEMA2SLD" && strtoupper($funcao) != "PEGAMAPAS"){ | |
| 126 | 126 | session_name("i3GeoPHP"); |
| 127 | 127 | if (isset($g_sid) && $g_sid != ""){ |
| 128 | 128 | session_id($g_sid); | ... | ... |
ferramentas/upload/index.js
| ... | ... | @@ -112,14 +112,6 @@ i3GEOF.upload = { |
| 112 | 112 | '<p class="paragrafo" >dbf: <br><input type="file" size=22 name="i3GEOuploaddbf" style="top:0px;left:0px;cursor:pointer;"></p>' + |
| 113 | 113 | '<p class="paragrafo" >prj (opcional): <br><input type="file" size=22 name="i3GEOuploadprj" style="top:0px;left:0px;cursor:pointer;"></p>' + |
| 114 | 114 | '</fieldset>'; |
| 115 | - if(i3GEO.parametros.editor === "sim"){ | |
| 116 | - ins += '<fieldset class=subbloco >' + | |
| 117 | - '<p class="paragrafo" >'+$trad('pastaArmazenamento',i3GEOF.upload.dicionario)+':</p>' + | |
| 118 | - '<div class="i3geoForm i3geoFormIconeEdita" ><input type="text" name="dirDestino" id="dirDestino" /></div>' + | |
| 119 | - " <img onclick='i3GEO.util.navegadorDir(\"dirDestino\",false,false,false,true);' src='"+i3GEO.configura.locaplic+"/imagens/ic_zoom.png' style='cursor:pointer;position :relative;top:2px'/></p>" + | |
| 120 | - '<p class="paragrafo" ><input type=checkbox name=i3GEOuploadCriaMapfile id=i3GEOuploadCriaMapfile /> '+$trad('criaMapfile',i3GEOF.upload.dicionario) + | |
| 121 | - '</fieldset>'; | |
| 122 | - } | |
| 123 | 115 | ins += '<fieldset class=subbloco >' + |
| 124 | 116 | '<p class="paragrafo" >'+$trad('tipoGeom',i3GEOF.upload.dicionario)+': </p>' + |
| 125 | 117 | ' <div class=styled-select >' + | ... | ... |
ferramentas/upload/upload.php
| ... | ... | @@ -17,6 +17,12 @@ if(isset($_GET["g_sid"]) && $_GET["g_sid"] != ""){ |
| 17 | 17 | session_start(); |
| 18 | 18 | $map_file = $_SESSION["map_file"]; |
| 19 | 19 | } |
| 20 | +else{ | |
| 21 | + exit; | |
| 22 | +} | |
| 23 | +if(!file_exists($map_file)){ | |
| 24 | + exit; | |
| 25 | +} | |
| 20 | 26 | if (ob_get_level() == 0) ob_start(); |
| 21 | 27 | ?> |
| 22 | 28 | <html> |
| ... | ... | @@ -42,18 +48,10 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 42 | 48 | ob_flush(); |
| 43 | 49 | flush(); |
| 44 | 50 | sleep(1); |
| 45 | - if(isset($map_file)){ | |
| 46 | - $mapa = ms_newMapObj($map_file); | |
| 47 | - $dirmap = dirname($map_file); | |
| 48 | - } | |
| 49 | - if(isset($dirDestino) && $dirDestino != ""){ | |
| 50 | - $dirmap = $dirDestino; | |
| 51 | - include_once(dirname(__FILE__)."/../../admin/php/login.php"); | |
| 52 | - if(verificaOperacaoSessao("admin/php/editortexto") == false){ | |
| 53 | - echo "Vc nao pode salvar os dados no servidor em uma pasta específica";exit; | |
| 54 | - } | |
| 55 | - if(!file_exists($dirmap)) | |
| 56 | - {echo "<p class='paragrafo' >Pasta não existe no servidor";paraAguarde();exit;} | |
| 51 | + $mapa = ms_newMapObj($map_file); | |
| 52 | + $dirmap = dirname($map_file); | |
| 53 | + if(!file_exists($dirmap)){ | |
| 54 | + exit; | |
| 57 | 55 | } |
| 58 | 56 | //verifica nomes |
| 59 | 57 | verificaNome($_FILES['i3GEOuploadshp']['name']); |
| ... | ... | @@ -104,6 +102,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 104 | 102 | |
| 105 | 103 | $checkphp = fileContemString($dirmap."/".$nomePrefixo.".prj","<?"); |
| 106 | 104 | if($checkphp == true){ |
| 105 | + echo "Arquivo prj invalido"; | |
| 107 | 106 | unlink($dirmap."/".$nomePrefixo.".shp"); |
| 108 | 107 | unlink($dirmap."/".$nomePrefixo.".dbf"); |
| 109 | 108 | unlink($dirmap."/".$nomePrefixo.".shx"); |
| ... | ... | @@ -112,6 +111,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 112 | 111 | } |
| 113 | 112 | $checkphp = fileContemString($dirmap."/".$nomePrefixo.".shx","<?"); |
| 114 | 113 | if($checkphp == true){ |
| 114 | + echo "Arquivo shx invalido"; | |
| 115 | 115 | unlink($dirmap."/".$nomePrefixo.".shp"); |
| 116 | 116 | unlink($dirmap."/".$nomePrefixo.".dbf"); |
| 117 | 117 | unlink($dirmap."/".$nomePrefixo.".shx"); |
| ... | ... | @@ -120,6 +120,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 120 | 120 | } |
| 121 | 121 | $checkphp = fileContemString($dirmap."/".$nomePrefixo.".dbf","<?"); |
| 122 | 122 | if($checkphp == true){ |
| 123 | + echo "Arquivo dbf invalido"; | |
| 123 | 124 | unlink($dirmap."/".$nomePrefixo.".shp"); |
| 124 | 125 | unlink($dirmap."/".$nomePrefixo.".dbf"); |
| 125 | 126 | unlink($dirmap."/".$nomePrefixo.".shx"); |
| ... | ... | @@ -130,91 +131,59 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
| 130 | 131 | echo "<p class='paragrafo' >Arquivo enviado.</p>"; |
| 131 | 132 | echo "<p class='paragrafo'></p>"; |
| 132 | 133 | //nesse caso o formulario de upload esta sendo executado de dentro de um mapa interativo, por isso o mapfile ja existe |
| 133 | - if(isset($map_file)){ | |
| 134 | - echo "<p class='paragrafo' >Adicionando tema...</p>"; | |
| 135 | - ob_flush(); | |
| 136 | - flush(); | |
| 137 | - sleep(1); | |
| 138 | - $novolayer = ms_newLayerObj($mapa); | |
| 139 | - $novolayer->set("data",$dirmap."/".$nomePrefixo.".shp"); | |
| 140 | - $novolayer->set("name",$_FILES['i3GEOuploadshp']['name']); | |
| 141 | - $novolayer->setmetadata("TEMA",$_FILES['i3GEOuploadshp']['name']); | |
| 142 | - $novolayer->setmetadata("DOWNLOAD","SIM"); | |
| 143 | - $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | |
| 144 | - if(!isset($tipo) || $tipo == "") | |
| 145 | - {$tipo = $sfileObj->type;} | |
| 146 | - if ($tipo == 1){$novolayer->set("type",MS_LAYER_POINT);} // ponto | |
| 147 | - if ($tipo == 3){$novolayer->set("type",MS_LAYER_LINE);} | |
| 148 | - if ($tipo == 5){$novolayer->set("type",MS_LAYER_POLYGON);} | |
| 149 | - $novolayer->setmetadata("TEMALOCAL","SIM"); | |
| 150 | - $novolayer->setmetadata("CLASSE","SIM"); | |
| 151 | - $novolayer->setmetadata("TEXTO","NAO"); | |
| 152 | - //if (($tipo != 3) and ($tipo != 8 )){$novolayer->set("type",0);} | |
| 153 | - $novolayer->setfilter(""); | |
| 154 | - $classe = ms_newClassObj($novolayer); | |
| 155 | - $classe->set("name",""); | |
| 156 | - $estilo = ms_newStyleObj($classe); | |
| 157 | - if ($tipo == 1) | |
| 158 | - { | |
| 159 | - $estilo->set("symbolname","ponto"); | |
| 160 | - $estilo->set("size",6); | |
| 161 | - } | |
| 162 | - $estilo->color->setrgb(200,50,0); | |
| 163 | - $estilo->outlinecolor->setrgb(0,0,0); | |
| 164 | - // le os itens | |
| 165 | - $novolayer->set("status",MS_DEFAULT); | |
| 166 | - $abriu = $novolayer->open(); | |
| 167 | - $items = $novolayer->getItems(); | |
| 168 | - $fechou = $novolayer->close(); | |
| 169 | - if ($items != "") | |
| 170 | - { | |
| 171 | - $its = implode(",",$items); | |
| 172 | - $novolayer->setmetadata("ITENS",$its); | |
| 173 | - $novolayer->setmetadata("ITENSDESC",$its); | |
| 174 | - $novolayer->set("template","none.htm"); | |
| 175 | - } | |
| 176 | - if(isset($_GET["uploadEPSG"]) && $_GET["uploadEPSG"] != ""){ | |
| 177 | - $novolayer->setProjection("init=epsg:".$_GET["uploadEPSG"]); | |
| 178 | - } | |
| 179 | - if(file_exists($dirmap."/".$nomePrefixo.".prj")){ | |
| 180 | - $novolayer->setProjection("AUTO"); | |
| 181 | - } | |
| 182 | - //$adiciona = ms_newLayerObj($mapa, $novolayer); | |
| 183 | - $salvo = $mapa->save($map_file); | |
| 184 | - //grava os templates de cada tema | |
| 185 | - echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa."; | |
| 186 | - echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; | |
| 134 | + echo "<p class='paragrafo' >Adicionando tema...</p>"; | |
| 135 | + ob_flush(); | |
| 136 | + flush(); | |
| 137 | + sleep(1); | |
| 138 | + $novolayer = ms_newLayerObj($mapa); | |
| 139 | + $novolayer->set("data",$dirmap."/".$nomePrefixo.".shp"); | |
| 140 | + $novolayer->set("name",$_FILES['i3GEOuploadshp']['name']); | |
| 141 | + $novolayer->setmetadata("TEMA",$_FILES['i3GEOuploadshp']['name']); | |
| 142 | + $novolayer->setmetadata("DOWNLOAD","SIM"); | |
| 143 | + $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | |
| 144 | + if(!isset($tipo) || $tipo == "") | |
| 145 | + {$tipo = $sfileObj->type;} | |
| 146 | + if ($tipo == 1){$novolayer->set("type",MS_LAYER_POINT);} // ponto | |
| 147 | + if ($tipo == 3){$novolayer->set("type",MS_LAYER_LINE);} | |
| 148 | + if ($tipo == 5){$novolayer->set("type",MS_LAYER_POLYGON);} | |
| 149 | + $novolayer->setmetadata("TEMALOCAL","SIM"); | |
| 150 | + $novolayer->setmetadata("CLASSE","SIM"); | |
| 151 | + $novolayer->setmetadata("TEXTO","NAO"); | |
| 152 | + //if (($tipo != 3) and ($tipo != 8 )){$novolayer->set("type",0);} | |
| 153 | + $novolayer->setfilter(""); | |
| 154 | + $classe = ms_newClassObj($novolayer); | |
| 155 | + $classe->set("name",""); | |
| 156 | + $estilo = ms_newStyleObj($classe); | |
| 157 | + if ($tipo == 1) | |
| 158 | + { | |
| 159 | + $estilo->set("symbolname","ponto"); | |
| 160 | + $estilo->set("size",6); | |
| 187 | 161 | } |
| 188 | - elseif($i3GEOuploadCriaMapfile == "on"){ | |
| 189 | - //verifica se o usuario marcou a opcao de cria mapfile | |
| 190 | - //nesse caso o aplicativo de upload esta sendo executado de dentro do sistema de administracao, e o mapfile devera | |
| 191 | - //ser criado e registrado no sistema | |
| 192 | - $nome = $nomePrefixo; | |
| 193 | - $codigo = $nomePrefixo; | |
| 194 | - $it = $nomePrefixo; | |
| 195 | - $en = $nomePrefixo; | |
| 196 | - $es = $nomePrefixo; | |
| 197 | - $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | |
| 198 | - if(!isset($tipo) || $tipo == ""){ | |
| 199 | - $tipo = $sfileObj->type; | |
| 200 | - } | |
| 201 | - if ($tipo == 1){ | |
| 202 | - $tipoLayer = "point"; | |
| 203 | - } | |
| 204 | - if ($tipo == 3){ | |
| 205 | - $tipoLayer = "line"; | |
| 206 | - } | |
| 207 | - if ($tipo == 5){ | |
| 208 | - $tipoLayer = "polygon"; | |
| 209 | - } | |
| 210 | - $funcao = "CRIARNOVOMAP"; | |
| 211 | - $output = "retorno"; | |
| 212 | - $data = $dirmap."/".$nomePrefixo.".shp"; | |
| 213 | - include_once($locaplic."/admin/php/editormapfile.php"); | |
| 214 | - echo "<b><p class='paragrafo' >Criado!!!<br>"; | |
| 215 | - echo "Para editar clique: <a href='../../admin/html/editormapfile.html' target=_blank >editar</a>"; | |
| 216 | - echo "<script>window.scrollTo(0,10000);i3GEO.util.insereCookie('I3GEOletraAdmin','".$nomePrefixo."');</script>"; | |
| 162 | + $estilo->color->setrgb(200,50,0); | |
| 163 | + $estilo->outlinecolor->setrgb(0,0,0); | |
| 164 | + // le os itens | |
| 165 | + $novolayer->set("status",MS_DEFAULT); | |
| 166 | + $abriu = $novolayer->open(); | |
| 167 | + $items = $novolayer->getItems(); | |
| 168 | + $fechou = $novolayer->close(); | |
| 169 | + if ($items != "") | |
| 170 | + { | |
| 171 | + $its = implode(",",$items); | |
| 172 | + $novolayer->setmetadata("ITENS",$its); | |
| 173 | + $novolayer->setmetadata("ITENSDESC",$its); | |
| 174 | + $novolayer->set("template","none.htm"); | |
| 175 | + } | |
| 176 | + if(isset($_GET["uploadEPSG"]) && $_GET["uploadEPSG"] != ""){ | |
| 177 | + $novolayer->setProjection("init=epsg:".$_GET["uploadEPSG"]); | |
| 178 | + } | |
| 179 | + if(file_exists($dirmap."/".$nomePrefixo.".prj")){ | |
| 180 | + $novolayer->setProjection("AUTO"); | |
| 217 | 181 | } |
| 182 | + //$adiciona = ms_newLayerObj($mapa, $novolayer); | |
| 183 | + $salvo = $mapa->save($map_file); | |
| 184 | + //grava os templates de cada tema | |
| 185 | + echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa."; | |
| 186 | + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; | |
| 218 | 187 | } |
| 219 | 188 | else |
| 220 | 189 | { | ... | ... |