Commit 565589f017ff89d210602ae1440be7c835af7ac1
1 parent
8aa4a61e
Exists in
master
and in
7 other branches
correção no ms_criamapa.php
Showing
9 changed files
with
508 additions
and
86 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/subirshapefile_.html
@@ -1,77 +0,0 @@ | @@ -1,77 +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/upload/index.js"></script> | ||
20 | -<script type="text/javascript" src="../../ferramentas/upload/dicionario.js"></script> | ||
21 | -<script type="text/javascript" src="../dicionario/core.js"></script> | ||
22 | -<link rel="stylesheet" type="text/css" href="admin.css"> | ||
23 | -</head> | ||
24 | -<body class=" yui-skin-sam fundoPonto" style="background-color: white; margin-top: 20px;"> | ||
25 | - <center> | ||
26 | - <div class="mascaraPrincipal" id="divGeral"> | ||
27 | - <div id="formulario" style="display: none"> | ||
28 | - <div id="conteudo" ></div> | ||
29 | - </div> | ||
30 | - </div> | ||
31 | - <br> <br> <br> <br> <br> <br> <br> | ||
32 | - <br> <br> <br> <br> <br> <br> <br> | ||
33 | - <br> <br> <br> <br> <br> <br> <br> | ||
34 | - </center> | ||
35 | - <script> | ||
36 | -/* | ||
37 | -Title: Subir shapefile | ||
38 | - | ||
39 | -Envia um arquivo shape file para o servidor | ||
40 | - | ||
41 | -Licenca: | ||
42 | - | ||
43 | -GPL2 | ||
44 | - | ||
45 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
46 | - | ||
47 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
48 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
49 | - | ||
50 | -Este programa é software livre; você pode redistribuí-lo | ||
51 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
52 | -GNU conforme publicada pela Free Software Foundation; | ||
53 | - | ||
54 | -Este programa é distribuído na expectativa de que seja útil, | ||
55 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
56 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
57 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
58 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
59 | -GNU junto com este programa; se não, escreva para a | ||
60 | -Free Software Foundation, Inc., no endereço | ||
61 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
62 | - | ||
63 | -Arquivo: | ||
64 | - | ||
65 | -i3geo/admin/html/subirshapefile.html | ||
66 | -*/ | ||
67 | -i3GEO.configura.locaplic = "../.."; | ||
68 | -i3GEO.parametros.editor = "sim"; | ||
69 | -i3GEO.configura.sid = ""; | ||
70 | -cabecalhoGeral("cabecalhoPrincipal",""); | ||
71 | -temp = function(){ | ||
72 | - document.getElementById("formulario").style.display = "block"; | ||
73 | - i3GEOF.upload.inicia("conteudo"); | ||
74 | -}; | ||
75 | -i3GEO.login.verificaOperacao("admin/html/subirshapefile",i3GEO.configura.locaplic,temp,"sessao",i3GEO.login.dialogo.abreLogin); | ||
76 | -</script> | ||
77 | -</body> |
@@ -0,0 +1,72 @@ | @@ -0,0 +1,72 @@ | ||
1 | +i3GEOadmin.uploadshp.dicionario = { | ||
2 | + 'pastaArmazenamento' : [ { | ||
3 | + pt : "Pasta no servidor onde os dados serão armazenados (caminho físico completo)", | ||
4 | + en : "", | ||
5 | + es : "" | ||
6 | + } ], | ||
7 | + 'tipoGeom' : [ { | ||
8 | + pt : "Tipo de geometria", | ||
9 | + en : "", | ||
10 | + es : "" | ||
11 | + } ], | ||
12 | + 'naoConhecido' : [ { | ||
13 | + pt : "não conhecido", | ||
14 | + en : "", | ||
15 | + es : "" | ||
16 | + } ], | ||
17 | + 'pontual' : [ { | ||
18 | + pt : "pontual", | ||
19 | + en : "", | ||
20 | + es : "" | ||
21 | + } ], | ||
22 | + 'poligonal' : [ { | ||
23 | + pt : "poligonal", | ||
24 | + en : "", | ||
25 | + es : "" | ||
26 | + } ], | ||
27 | + 'linear' : [ { | ||
28 | + pt : "linear", | ||
29 | + en : "", | ||
30 | + es : "" | ||
31 | + } ], | ||
32 | + 'projecao' : [ { | ||
33 | + pt : "Projeção (apenas será utilizado se não for feito o upload de um arquivo .prj)", | ||
34 | + en : "", | ||
35 | + es : "" | ||
36 | + } ], | ||
37 | + 'envia' : [ { | ||
38 | + pt : "Enviar", | ||
39 | + en : "", | ||
40 | + es : "" | ||
41 | + } ], | ||
42 | + 'ajudaCaracter' : [ { | ||
43 | + pt : "Não utilize _ no nome do arquivo. Apenas letras e números são aceitos!!!", | ||
44 | + en : "", | ||
45 | + es : "" | ||
46 | + } ], | ||
47 | + 'criaMapfile' : [ { | ||
48 | + pt : "Marque para criar o arquivo de configuração (mapfile) e visualizar os dados no mapa interativo (você poderá editar esse arquivo posteriormente no editor de mapfiles)", | ||
49 | + en : "", | ||
50 | + es : "" | ||
51 | + } ], | ||
52 | + 'txtTitulo' : [ { | ||
53 | + pt : "Upload de arquivo shapefile", | ||
54 | + en : "", | ||
55 | + es : "" | ||
56 | + } ], | ||
57 | + 'txtDesc' : [ { | ||
58 | + pt : "Envie e armazene no servidor arquivos no formato shapefile. Os arquivos poderão ser utilizados para incluir camadas no catálogo de temas ou utilizados de outras maneiras para compor mapas.", | ||
59 | + en : "", | ||
60 | + es : "" | ||
61 | + } ], | ||
62 | + 'txtAjuda' : [ { | ||
63 | + pt : "A pasta no servidor onde o arquivo ficará armazenado deve ter as permissões adequadas para permitir o armazenamento dos arquivos. Verifique com o administrador do servidor essas permissões e os endereços das pastas que podem receber arquivos.<br>Para evitar a remoção de arquivos que estão em uso por outros usuários, não é permitido apagar arquivos. Para apagar arquivos, solicite diretamente ao administrador do servidor.", | ||
64 | + en : "", | ||
65 | + es : "" | ||
66 | + } ], | ||
67 | + 'txtArquivos' : [ { | ||
68 | + pt : "Escolha os arquivos que formam o shapefile (shp, shx, dbf, prj)", | ||
69 | + en : "", | ||
70 | + es : "" | ||
71 | + } ] | ||
72 | +}; |
@@ -0,0 +1,248 @@ | @@ -0,0 +1,248 @@ | ||
1 | +<?php | ||
2 | +/* | ||
3 | + * Licenca: | ||
4 | + * | ||
5 | + * GPL2 | ||
6 | + * | ||
7 | + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
8 | + * | ||
9 | + * Direitos Autorais Reservados (c) 2006 Edmar Moretti | ||
10 | + * Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
11 | + * | ||
12 | + * Este programa é software livre; você pode redistribuí-lo | ||
13 | + * e/ou modificá-lo sob os termos da Licença Pública Geral | ||
14 | + * GNU conforme publicada pela Free Software Foundation; | ||
15 | + * | ||
16 | + * Este programa é distribuído na expectativa de que seja útil, | ||
17 | + * porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
18 | + * de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
19 | + * Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
20 | + * Você deve ter recebido uma copia da Licença Pública Geral do | ||
21 | + * GNU junto com este programa; se não, escreva para a | ||
22 | + * Free Software Foundation, Inc., no endereço | ||
23 | + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | + */ | ||
25 | +error_reporting ( 0 ); | ||
26 | +// | ||
27 | +// pega as variaveis passadas com get ou post | ||
28 | +// | ||
29 | + | ||
30 | +include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php"); | ||
31 | +$funcoesEdicao = array ( | ||
32 | + "ADICIONAR", | ||
33 | + "ALTERAR", | ||
34 | + "EXCLUIR" | ||
35 | +); | ||
36 | +if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | ||
37 | + if (verificaOperacaoSessao ( "admin/html/usuarios" ) === false) { | ||
38 | + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); | ||
39 | + exit (); | ||
40 | + } | ||
41 | +} | ||
42 | +include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); | ||
43 | +$funcao = strtoupper ( $funcao ); | ||
44 | +// converte os parametros de definicao dos papeis em um array | ||
45 | +if ($funcao == "ADICIONAR" || $funcao == "ALTERAR") { | ||
46 | + $papeis = array (); | ||
47 | + foreach ( array_keys ( $_POST ) as $k ) { | ||
48 | + $teste = explode ( "-", $k ); | ||
49 | + if ($teste[0] == "id_papel") { | ||
50 | + $papeis[] = $teste[1] * 1; | ||
51 | + } | ||
52 | + } | ||
53 | + array_unique ( $papeis ); | ||
54 | +} | ||
55 | +switch ($funcao) { | ||
56 | + case "ADICIONAR" : | ||
57 | + $novo = adicionar( $ativo, $data_cadastro, $email, $login, $nome_usuario, $senha, $papeis, $dbhw ); | ||
58 | + if ($novo != false) { | ||
59 | + $sql = "SELECT id_usuario, ativo, data_cadastro, email, login, nome_usuario from " . $esquemaadmin . "i3geousr_usuarios WHERE id_usuario = " . $novo; | ||
60 | + $dados = pegaDados ( $sql, $dbh ); | ||
61 | + if ($dados === false) { | ||
62 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
63 | + exit (); | ||
64 | + } | ||
65 | + if(strtolower($enviaSenha) == "on"){ | ||
66 | + if($senha == "" || $email == ""){ | ||
67 | + $dados = header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); | ||
68 | + } else { | ||
69 | + $dados = enviarSenha( $senha, $email ); | ||
70 | + } | ||
71 | + } | ||
72 | + retornaJSON ( $dados ); | ||
73 | + } else { | ||
74 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
75 | + exit (); | ||
76 | + } | ||
77 | + exit (); | ||
78 | + break; | ||
79 | + case "ALTERAR" : | ||
80 | + $novo = alterar ( $id_usuario, $ativo, $data_cadastro, $email, $login, $nome_usuario, $senha, $papeis, $dbhw ); | ||
81 | + if ($novo === false) { | ||
82 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
83 | + exit (); | ||
84 | + } | ||
85 | + $sql = "SELECT * from " . $esquemaadmin . "i3geousr_usuarios WHERE id_usuario = " . $novo; | ||
86 | + $dados = pegaDados ( $sql, $dbh ); | ||
87 | + if ($dados === false) { | ||
88 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
89 | + exit (); | ||
90 | + } | ||
91 | + if(strtolower($enviaSenha) == "on"){ | ||
92 | + if($senha == "" || $email == ""){ | ||
93 | + $dados = header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); | ||
94 | + } else { | ||
95 | + $dados = enviarSenha( $senha, $email ); | ||
96 | + } | ||
97 | + } | ||
98 | + retornaJSON ( $dados ); | ||
99 | + exit (); | ||
100 | + break; | ||
101 | + case "LISTA" : | ||
102 | + $usuarios = pegaDados ( "SELECT id_usuario,ativo,data_cadastro,email,login,nome_usuario from " . $esquemaadmin . "i3geousr_usuarios order by nome_usuario", $dbh, false ); | ||
103 | + $papeis = pegaDados ( "SELECT P.id_papel, P.nome, P.descricao, UP.id_usuario FROM " . $esquemaadmin . "i3geousr_usuarios AS U JOIN " . $esquemaadmin . "i3geousr_papelusuario AS UP ON U.id_usuario = UP.id_usuario JOIN " . $esquemaadmin . "i3geousr_papeis AS P ON UP.id_papel = P.id_papel ", dbh, false ); | ||
104 | + if ($usuarios === false || $papeis === false) { | ||
105 | + $dbhw = null; | ||
106 | + $dbh = null; | ||
107 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
108 | + exit (); | ||
109 | + } | ||
110 | + $o = array (); | ||
111 | + foreach ( $usuarios as $usuario ) { | ||
112 | + // pega os papeis registrados para cada operacao | ||
113 | + $p = array (); | ||
114 | + foreach ( $papeis as $papel ) { | ||
115 | + if ($papel["id_usuario"] == $usuario["id_usuario"]) { | ||
116 | + $p[$papel["id_papel"]] = $papel; | ||
117 | + } | ||
118 | + } | ||
119 | + $usuario["papeis"] = $p; | ||
120 | + $o[] = $usuario; | ||
121 | + } | ||
122 | + $papeis = pegaDados ( "SELECT * from " . $esquemaadmin . "i3geousr_papeis order by nome", $dbh ); | ||
123 | + $dbhw = null; | ||
124 | + $dbh = null; | ||
125 | + if ($papeis === false) { | ||
126 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
127 | + exit(); | ||
128 | + } | ||
129 | + retornaJSON ( array ( | ||
130 | + "usuarios" => $o, | ||
131 | + "papeis" => $papeis | ||
132 | + ) ); | ||
133 | + break; | ||
134 | + case "EXCLUIR" : | ||
135 | + $retorna = excluir ( $id_usuario, $dbhw ); | ||
136 | + $dbhw = null; | ||
137 | + $dbh = null; | ||
138 | + if ($retorna === false) { | ||
139 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
140 | + exit (); | ||
141 | + } | ||
142 | + retornaJSON ( $id_usuario ); | ||
143 | + exit (); | ||
144 | + break; | ||
145 | + case "ENVIARSENHA" : | ||
146 | + if($senha == "" || $email == ""){ | ||
147 | + header ( "HTTP/1.1 500 erro ao enviar e-mail. Prrencha o valor de e-mail e senha" ); | ||
148 | + exit (); | ||
149 | + } | ||
150 | + $retorna = enviarSenha ( $senha, $email ); | ||
151 | + if ($retorna === false) { | ||
152 | + header ( "HTTP/1.1 500 erro ao enviar e-mail $email" ); | ||
153 | + exit (); | ||
154 | + } | ||
155 | + retornaJSON ( true ); | ||
156 | + exit (); | ||
157 | + break; | ||
158 | +} | ||
159 | +cpjson ( $retorno ); | ||
160 | + | ||
161 | +function enviarSenha( $senha, $email ){ | ||
162 | + $to = $email; | ||
163 | + $subject = 'senha i3geo criada em '. date('l jS \of F Y h:i:s A'); | ||
164 | + $message = $senha; | ||
165 | + return mail($to, $subject, $message); | ||
166 | +} | ||
167 | +// $papeis deve ser um array | ||
168 | +function adicionar($ativo, $data_cadastro, $email, $login, $nome_usuario, $senha, $papeis, $dbhw) { | ||
169 | + global $esquemaadmin; | ||
170 | + try { | ||
171 | + $dataCol = array( | ||
172 | + "nome_usuario" => '', | ||
173 | + "login" => '', | ||
174 | + "email" => '', | ||
175 | + "ativo" => 0, | ||
176 | + "data_cadastro" => '', | ||
177 | + "senha" => '' | ||
178 | + ); | ||
179 | + $id_usuario = i3GeoAdminInsertUnico ( $dbhw, "i3geousr_usuarios", $dataCol, "nome_usuario", "id_usuario" ); | ||
180 | + $data_cadastro = date('l jS \of F Y h:i:s A'); | ||
181 | + $retorna = alterar ( $id_usuario, $ativo, $data_cadastro, $email, $login, $nome_usuario, $senha, $papeis, $dbhw ); | ||
182 | + return $retorna; | ||
183 | + } catch ( PDOException $e ) { | ||
184 | + return false; | ||
185 | + } | ||
186 | +} | ||
187 | +// $papeis deve ser um array | ||
188 | +function alterar($id_usuario, $ativo, $data_cadastro, $email, $login, $nome_usuario, $senha, $papeis, $dbhw) { | ||
189 | + global $esquemaadmin; | ||
190 | + if ($convUTF) { | ||
191 | + $nome_usuario = utf8_encode ( $nome_usuario ); | ||
192 | + } | ||
193 | + $dataCol = array ( | ||
194 | + "nome_usuario" => $nome_usuario, | ||
195 | + "login" => $login, | ||
196 | + "email" => $email, | ||
197 | + "ativo" => $ativo | ||
198 | + ); | ||
199 | + // se a senha foi enviada, ela sera trocada | ||
200 | + if ($senha != "") { | ||
201 | + $dataCol ["senha"] = md5 ( $senha ); | ||
202 | + } | ||
203 | + $resultado = i3GeoAdminUpdate ( $dbhw, "i3geousr_usuarios", $dataCol, "WHERE id_usuario = $id_usuario" ); | ||
204 | + if ($resultado === false) { | ||
205 | + return false; | ||
206 | + } | ||
207 | + // apaga todos os papeis | ||
208 | + $resultado = excluirPapeis ( $id_usuario, $dbhw ); | ||
209 | + if ($resultado === false) { | ||
210 | + return false; | ||
211 | + } | ||
212 | + if (! empty ( $papeis )) { | ||
213 | + // atualiza papeis vinculados | ||
214 | + foreach ( $papeis as $p ) { | ||
215 | + $resultado = adicionaPapel ( $id_usuario, $p, $dbhw ); | ||
216 | + if ($resultado === false) { | ||
217 | + return false; | ||
218 | + } | ||
219 | + } | ||
220 | + } | ||
221 | + return $id_usuario; | ||
222 | +} | ||
223 | +function adicionaPapel($id_usuario, $id_papel, $dbhw) { | ||
224 | + global $esquemaadmin; | ||
225 | + $dataCol = array ( | ||
226 | + "id_usuario" => $id_usuario, | ||
227 | + "id_papel" => $id_papel | ||
228 | + ); | ||
229 | + $resultado = i3GeoAdminInsert ( $dbhw, "i3geousr_papelusuario", $dataCol ); | ||
230 | + return $resultado; | ||
231 | +} | ||
232 | +function excluir($id_usuario, $dbhw) { | ||
233 | + global $esquemaadmin; | ||
234 | + $resultado = i3GeoAdminExclui ( $esquemaadmin . "i3geousr_usuarios", "id_usuario", $id_usuario, $dbhw, false ); | ||
235 | + if ($resultado === false) { | ||
236 | + return false; | ||
237 | + } | ||
238 | + if ($resultado === true) { | ||
239 | + $resultado = excluirPapeis ( $id_usuario, $dbhw ); | ||
240 | + } | ||
241 | + return $resultado; | ||
242 | +} | ||
243 | +function excluirPapeis($id_usuario, $dbhw) { | ||
244 | + global $esquemaadmin; | ||
245 | + $resultado = i3GeoAdminExclui ( $esquemaadmin . "i3geousr_papelusuario", "id_usuario", $id_usuario, $dbhw, false ); | ||
246 | + return $resultado; | ||
247 | +} | ||
248 | +?> |
@@ -0,0 +1,48 @@ | @@ -0,0 +1,48 @@ | ||
1 | +/* | ||
2 | +Licenca: | ||
3 | + | ||
4 | +GPL2 | ||
5 | + | ||
6 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7 | + | ||
8 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
9 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
10 | + | ||
11 | +Este programa é software livre; você pode redistribuí-lo | ||
12 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
13 | +GNU conforme publicada pela Free Software Foundation; | ||
14 | + | ||
15 | +Este programa é distribuído na expectativa de que seja útil, | ||
16 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
17 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
18 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
19 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
20 | +GNU junto com este programa; se não, escreva para a | ||
21 | +Free Software Foundation, Inc., no endereço | ||
22 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | + | ||
24 | + */ | ||
25 | +i3GEOadmin.uploadshp = { | ||
26 | + listaEpsg: function(){ | ||
27 | + $.post( | ||
28 | + "../../../classesphp/mapa_controle.php?funcao=listaEpsg", | ||
29 | + "g_sid=&map_file=" | ||
30 | + ) | ||
31 | + .done( | ||
32 | + function(data, status){ | ||
33 | + var json = jQuery.parseJSON(data); | ||
34 | + console.info(json) | ||
35 | + var html = Mustache.to_html( | ||
36 | + "{{#data}}" + $("#templateProj").html() + "{{/data}}", | ||
37 | + json | ||
38 | + ); | ||
39 | + $("#uploadEPSG").html("<option value='' ></option>" + html); | ||
40 | + } | ||
41 | + ) | ||
42 | + .fail( | ||
43 | + function(data){ | ||
44 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
45 | + } | ||
46 | + ); | ||
47 | + } | ||
48 | +}; | ||
0 | \ No newline at end of file | 49 | \ No newline at end of file |
admin1/upload/arquivo/index.php
1 | <?php | 1 | <?php |
2 | +// TODO incluir icone para abrir o navegador de arquivos para encontrar a pasta no servidor | ||
2 | define ( ONDEI3GEO, "../../.." ); | 3 | define ( ONDEI3GEO, "../../.." ); |
3 | include (dirname ( __FILE__ ) . "/../../../ms_configura.php"); | 4 | include (dirname ( __FILE__ ) . "/../../../ms_configura.php"); |
4 | error_reporting ( 0 ); | 5 | error_reporting ( 0 ); |
@@ -10,16 +11,115 @@ include "../../head.php"; | @@ -10,16 +11,115 @@ include "../../head.php"; | ||
10 | <li><a href="../../init/index.php">i3Geo</a></li> | 11 | <li><a href="../../init/index.php">i3Geo</a></li> |
11 | <li><a href="../../index.php">Admin</a></li> | 12 | <li><a href="../../index.php">Admin</a></li> |
12 | <li>Upload</li> | 13 | <li>Upload</li> |
13 | - <li class="active">Arquivos</li> | 14 | + <li class="active">Arquivo shapefile</li> |
14 | </ol> | 15 | </ol> |
15 | </div> | 16 | </div> |
16 | - | ||
17 | </div> | 17 | </div> |
18 | -<div class="container-fluid"> | ||
19 | - <div class="row"> | ||
20 | - <iframe src="../../../admin/html/subirshapefile_.html" style="width:100%; height:5000px;border:none; scrolling:no; frameborder:0; marginheight:0; marginwidth:0;" ></iframe> | 18 | +<div class="container"> |
19 | + <div class="row center-block"> | ||
20 | + <div class="col-md-12"> | ||
21 | + <div class="well hidden" id="titulo"> | ||
22 | + <button data-toggle="modal" data-target="#ajudaPrincipal" | ||
23 | + class="btn btn-primary btn-fab btn-fab-mini pull-right"> | ||
24 | + <i class="material-icons">help</i> | ||
25 | + </button> | ||
26 | + <h2> | ||
27 | + <small>{{{txtTitulo}}}</small> | ||
28 | + </h2> | ||
29 | + <blockquote>{{{txtDesc}}}</blockquote> | ||
30 | + <!--Modal ajuda--> | ||
31 | + <div id="ajudaPrincipal" class="modal fade" tabindex="-1"> | ||
32 | + <div class="modal-dialog"> | ||
33 | + <div class="modal-content"> | ||
34 | + <div class="modal-body"> | ||
35 | + <p>{{{txtAjuda}}}</p> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + </div> | ||
21 | </div> | 43 | </div> |
44 | +<div class="container hidden" id="corpo"> | ||
45 | + <form style="" action="#" onsubmit="return false;" class="form-horizontal" role="form" | ||
46 | + method="post"> | ||
47 | + <div class="row center-block well"> | ||
48 | + <div class="col-md-12"> | ||
49 | + <h4>{{{txtArquivos}}}</h4> | ||
50 | + <div class="form-group form-group-lg col-md-6"> | ||
51 | + <input id="i3GEOuploadshp" multiple="" type="file"> <input readonly="" class="form-control" | ||
52 | + placeholder="SHP" type="text"> | ||
53 | + </div> | ||
54 | + <div class="form-group form-group-lg col-md-6"> | ||
55 | + <input id="i3GEOuploadshx" multiple="" type="file"> <input readonly="" class="form-control" | ||
56 | + placeholder="SHX" type="text"> | ||
57 | + </div> | ||
58 | + <div class="form-group form-group-lg col-md-6"> | ||
59 | + <input id="i3GEOuploaddbf" multiple="" type="file"> <input readonly="" class="form-control" | ||
60 | + placeholder="DBF" type="text"> | ||
61 | + </div> | ||
62 | + <div class="form-group form-group-lg col-md-6"> | ||
63 | + <input id="i3GEOuploadprj" multiple="" type="file"> <input readonly="" class="form-control" | ||
64 | + placeholder="PRJ (opcional)" type="text"> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | + <div class="row center-block well"> | ||
69 | + <div class="col-md-12"> | ||
70 | + <div class="form-group form-group-lg"> | ||
71 | + <label class="col-md-5 control-label" for="dirDestino">{{{pastaArmazenamento}}}</label> | ||
72 | + <div class="col-md-7"> | ||
73 | + <input title="{{{pastaArmazenamento}}}" type="text" value="" class="form-control" | ||
74 | + name="dirDestino" required> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + <div class="form-group form-group-lg"> | ||
78 | + <label class="col-md-5 control-label" for="tipo">{{{tipoGeom}}}</label> | ||
79 | + <div class="col-md-7"> | ||
80 | + <select title="{{{tipoGeom}}}" name="tipo" class="form-control"> | ||
81 | + <option value="">{{{naoConhecido}}}</option> | ||
82 | + <option value="1">{{{pontual}}}</option> | ||
83 | + <option value="5">{{{poligonal}}}</option> | ||
84 | + <option value="3">{{{linear}}}</option> | ||
85 | + </select> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + <div class="form-group form-group-lg"> | ||
89 | + <label class="col-md-5 control-label" for="uploadEPSG">{{{projecao}}}</label> | ||
90 | + <div class="col-md-7"> | ||
91 | + <select title="{{{projecao}}}" id="uploadEPSG" name="uploadEPSG" class="form-control"> | ||
92 | + | ||
93 | + </select> | ||
94 | + </div> | ||
95 | + </div> | ||
96 | + <div class="form-group form-group-lg"> | ||
97 | + <label class="col-md-5 control-label" style="margin-top:0px;" for="i3GEOuploadCriaMapfile">{{{criaMapfile}}}</label> | ||
98 | + <div class="col-md-7"> | ||
99 | + <div class=" checkbox"> | ||
100 | + <label> | ||
101 | + <input title="{{{criaMapfile}}}" name="i3GEOuploadCriaMapfile" type="checkbox"> | ||
102 | + </label> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | + </div> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + <div class="row center-block well"> | ||
109 | + <div class="col-md-12"> | ||
110 | + <div class="pull-right"> | ||
111 | + <button type="submit" class="btn btn-primary" role="button" style="color: #008579;">{{envia}}</button> | ||
112 | + </div> | ||
113 | + </div> | ||
114 | + </div> | ||
115 | + | ||
116 | + </form> | ||
22 | </div> | 117 | </div> |
118 | +<script id="templateProj" type="x-tmpl-mustache"> | ||
119 | + <option value="{{{codigo}}}">{{{nome}}}</option> | ||
120 | +</script> | ||
121 | +<script type="text/javascript" src="index.js"></script> | ||
122 | +<script type="text/javascript" src="../../dicionario/uploadshp.js"></script> | ||
23 | <script> | 123 | <script> |
24 | $(document).ready(function(){ | 124 | $(document).ready(function(){ |
25 | //vem de admin1/index.js | 125 | //vem de admin1/index.js |
@@ -30,8 +130,39 @@ include "../../head.php"; | @@ -30,8 +130,39 @@ include "../../head.php"; | ||
30 | $(this).parent().siblings().removeClass('open'); | 130 | $(this).parent().siblings().removeClass('open'); |
31 | $(this).parent().toggleClass('open'); | 131 | $(this).parent().toggleClass('open'); |
32 | }); | 132 | }); |
133 | + //traducao | ||
134 | + var t = $("#titulo"); | ||
135 | + //complementa dicionario | ||
136 | + i3GEOadmin.uploadshp.dicionario = $.extend( | ||
137 | + {}, | ||
138 | + i3GEOadmin.uploadshp.dicionario, | ||
139 | + i3GEOadmin.core.dicionario | ||
140 | + ); | ||
141 | + | ||
142 | + i3GEOadmin.core.dicionario = null; | ||
143 | + | ||
144 | + i3GEOadmin.uploadshp.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.uploadshp.dicionario); | ||
145 | + | ||
146 | + t.html( | ||
147 | + Mustache.to_html( | ||
148 | + t.html(), | ||
149 | + i3GEOadmin.uploadshp.dicionario | ||
150 | + ) | ||
151 | + ); | ||
33 | $.material.init(); | 152 | $.material.init(); |
153 | + var inicia = function() { | ||
154 | + $(".hidden").removeClass('hidden'); | ||
155 | + var t = $("#corpo"); | ||
156 | + t.html( | ||
157 | + Mustache.to_html( | ||
158 | + t.html(), | ||
159 | + i3GEOadmin.uploadshp.dicionario | ||
160 | + ) | ||
161 | + ); | ||
162 | + i3GEOadmin.uploadshp.listaEpsg(); | ||
163 | + }; | ||
164 | + i3GEO.login.verificaOperacao("admin/html/subirshapefile",i3GEO.configura.locaplic, inicia, "sessao"); | ||
34 | }); | 165 | }); |
35 | </script> | 166 | </script> |
36 | </body> | 167 | </body> |
37 | -</html> | 168 | -</html> |
169 | +</html> | ||
38 | \ No newline at end of file | 170 | \ No newline at end of file |
ferramentas/uploadsimbolo/upload.php
@@ -27,7 +27,7 @@ if (isset($_FILES['i3GEOuploadsimboloarq']['name'])){ | @@ -27,7 +27,7 @@ if (isset($_FILES['i3GEOuploadsimboloarq']['name'])){ | ||
27 | sleep(1); | 27 | sleep(1); |
28 | include_once(dirname(__FILE__)."/../../admin/php/login.php"); | 28 | include_once(dirname(__FILE__)."/../../admin/php/login.php"); |
29 | if(verificaOperacaoSessao("admin/php/editortexto") == false){ | 29 | if(verificaOperacaoSessao("admin/php/editortexto") == false){ |
30 | - echo "Vc nao pode realizar salvar os dados no servidor em uma pasta específica";exit; | 30 | + echo "Vc nao pode salvar os dados no servidor em uma pasta específica";exit; |
31 | } | 31 | } |
32 | if(!isset($dirDestino) || $dirDestino == ""){ | 32 | if(!isset($dirDestino) || $dirDestino == ""){ |
33 | $dirDestino = $locaplic."/symbols/images"; | 33 | $dirDestino = $locaplic."/symbols/images"; |
ms_criamapa.php
@@ -595,10 +595,10 @@ $_SESSION["map_file"] = $tmpfname; | @@ -595,10 +595,10 @@ $_SESSION["map_file"] = $tmpfname; | ||
595 | $_SESSION["mapext"] = $mapext; | 595 | $_SESSION["mapext"] = $mapext; |
596 | if (isset($executa)){ | 596 | if (isset($executa)){ |
597 | if (file_exists($executa)){ | 597 | if (file_exists($executa)){ |
598 | - include_once ($executa); | 598 | + //include_once ($executa); |
599 | } | 599 | } |
600 | if (function_exists($executa)){ | 600 | if (function_exists($executa)){ |
601 | - eval($executa."();"); | 601 | + //eval($executa."();"); |
602 | } | 602 | } |
603 | } | 603 | } |
604 | if(isset($wkt)){ | 604 | if(isset($wkt)){ |