Commit 20a3f13804557bceea2cc491c5cffb50fa159865
1 parent
36047ebe
Exists in
master
and in
7 other branches
correção na acentuação nas funções de importação de xml
Showing
9 changed files
with
48 additions
and
24 deletions
Show diff stats
admin/php/admin.php
@@ -167,7 +167,7 @@ function pegaDados($sql,$locaplic="") | @@ -167,7 +167,7 @@ function pegaDados($sql,$locaplic="") | ||
167 | if($locaplic == "") | 167 | if($locaplic == "") |
168 | include("conexao.php"); | 168 | include("conexao.php"); |
169 | else | 169 | else |
170 | - include("$locaplic./admin/php/conexao.php"); | 170 | + include("$locaplic/admin/php/conexao.php"); |
171 | $q = $dbh->query($sql,PDO::FETCH_ASSOC); | 171 | $q = $dbh->query($sql,PDO::FETCH_ASSOC); |
172 | $resultado = $q->fetchAll(); | 172 | $resultado = $q->fetchAll(); |
173 | $dbh = null; | 173 | $dbh = null; |
admin/php/atlas.php
@@ -346,8 +346,8 @@ function importarXmlAtlas() | @@ -346,8 +346,8 @@ function importarXmlAtlas() | ||
346 | $contaAtlas = 0; | 346 | $contaAtlas = 0; |
347 | foreach($xml->ATLAS as $atlas) | 347 | foreach($xml->ATLAS as $atlas) |
348 | { | 348 | { |
349 | - $titulo = ixml($atlas,"TITULO"); | ||
350 | - $desc = ixml($atlas,"DESCRICAO"); | 349 | + $titulo = html_entity_decode(ixml($atlas,"TITULO")); |
350 | + $desc = html_entity_decode(ixml($atlas,"DESCRICAO")); | ||
351 | $icone = ixml($atlas,"ICONE"); | 351 | $icone = ixml($atlas,"ICONE"); |
352 | $link = ixml($atlas,"LINKMAISINFO"); | 352 | $link = ixml($atlas,"LINKMAISINFO"); |
353 | $template = ixml($atlas,"TEMPLATEHTML"); | 353 | $template = ixml($atlas,"TEMPLATEHTML"); |
@@ -367,8 +367,8 @@ function importarXmlAtlas() | @@ -367,8 +367,8 @@ function importarXmlAtlas() | ||
367 | $contaPrancha = 0; | 367 | $contaPrancha = 0; |
368 | foreach ($atlas->PRANCHAS->PRANCHA as $prancha) | 368 | foreach ($atlas->PRANCHAS->PRANCHA as $prancha) |
369 | { | 369 | { |
370 | - $titulo = ixml($prancha,"TITULO"); | ||
371 | - $desc = ixml($prancha,"DESCRICAO"); | 370 | + $titulo = html_entity_decode(ixml($prancha,"TITULO")); |
371 | + $desc = html_entity_decode(ixml($prancha,"DESCRICAO")); | ||
372 | $icone = ixml($prancha,"ICONE"); | 372 | $icone = ixml($prancha,"ICONE"); |
373 | $link = ixml($prancha,"LINKMAISINFO"); | 373 | $link = ixml($prancha,"LINKMAISINFO"); |
374 | $w = ixml($prancha,"WABERUTRA"); | 374 | $w = ixml($prancha,"WABERUTRA"); |
admin/php/conexao.php
@@ -53,6 +53,9 @@ else | @@ -53,6 +53,9 @@ else | ||
53 | } | 53 | } |
54 | } | 54 | } |
55 | } | 55 | } |
56 | +if(!isset($conexaoadmin)) | ||
57 | +{$conexaoadmin = "";} | ||
58 | + | ||
56 | if($conexaoadmin == "") | 59 | if($conexaoadmin == "") |
57 | { | 60 | { |
58 | $arquivosqlite = $locaplic."/menutemas/admin.db"; | 61 | $arquivosqlite = $locaplic."/menutemas/admin.db"; |
admin/php/identifica.php
@@ -128,7 +128,7 @@ function importarXmlI() | @@ -128,7 +128,7 @@ function importarXmlI() | ||
128 | {$iExistentes[$r["nome_i"]] = 0;} | 128 | {$iExistentes[$r["nome_i"]] = 0;} |
129 | foreach($xml->FUNCAO as $item) | 129 | foreach($xml->FUNCAO as $item) |
130 | { | 130 | { |
131 | - $nome_i = ixml($item,"NOMESIS"); | 131 | + $nome_i = html_entity_decode(ixml($item,"NOMESIS")); |
132 | $target_i = ixml($item,"TARGET"); | 132 | $target_i = ixml($item,"TARGET"); |
133 | $abrir_i = ixml($item,"ABRIR"); | 133 | $abrir_i = ixml($item,"ABRIR"); |
134 | if(!isset($iExistentes[$nome_i])) | 134 | if(!isset($iExistentes[$nome_i])) |
admin/php/mapas.php
@@ -130,9 +130,9 @@ function importarXmlMapas() | @@ -130,9 +130,9 @@ function importarXmlMapas() | ||
130 | foreach($xml->MAPA as $mapa) | 130 | foreach($xml->MAPA as $mapa) |
131 | { | 131 | { |
132 | $perfil = ixml($mapa,"PERFIL"); | 132 | $perfil = ixml($mapa,"PERFIL"); |
133 | - $descricao = ixml($mapa,"DESCRICAO"); | 133 | + $descricao = html_entity_decode(ixml($mapa,"DESCRICAO")); |
134 | //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); | 134 | //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); |
135 | - $nome = ixml($mapa,"NOME"); | 135 | + $nome = html_entity_decode(ixml($mapa,"NOME")); |
136 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | 136 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); |
137 | $imagem = ixml($mapa,"IMAGEM"); | 137 | $imagem = ixml($mapa,"IMAGEM"); |
138 | $temas = ixml($mapa,"TEMAS"); | 138 | $temas = ixml($mapa,"TEMAS"); |
admin/php/mapfiles.php
@@ -28,7 +28,6 @@ File: i3geo/admin/mapfiles.php | @@ -28,7 +28,6 @@ File: i3geo/admin/mapfiles.php | ||
28 | 28 | ||
29 | */ | 29 | */ |
30 | require_once("admin.php"); | 30 | require_once("admin.php"); |
31 | -$cp = new cpaint(); | ||
32 | //faz a busca da função que deve ser executada | 31 | //faz a busca da função que deve ser executada |
33 | switch ($funcao) | 32 | switch ($funcao) |
34 | { | 33 | { |
admin/php/menutemas.php
@@ -100,6 +100,28 @@ switch ($funcao) | @@ -100,6 +100,28 @@ switch ($funcao) | ||
100 | exit; | 100 | exit; |
101 | break; | 101 | break; |
102 | 102 | ||
103 | + case "pegaTemaPorMapfile": | ||
104 | + $sql = "SELECT * from i3geoadmin_temas where codigo_tema = '$codigo_tema'"; | ||
105 | + $dados = pegaDados($sql); | ||
106 | + if(count($dados) == 0) | ||
107 | + { | ||
108 | + $id = alteraTemas(); | ||
109 | + $nome = ""; | ||
110 | + $desc = ""; | ||
111 | + $codigo = $codigo_tema; | ||
112 | + $tipoa = ""; | ||
113 | + $download = "SIM"; | ||
114 | + $ogc = "SIM"; | ||
115 | + $kml = "SIM"; | ||
116 | + $link = ""; | ||
117 | + $tags = ""; | ||
118 | + alteraTemas(); | ||
119 | + $dados = pegaDados($sql); | ||
120 | + } | ||
121 | + retornaJSON($dados); | ||
122 | + exit; | ||
123 | + break; | ||
124 | + | ||
103 | case "pegaTemas2": | 125 | case "pegaTemas2": |
104 | retornaJSON(pegaTemas2()); | 126 | retornaJSON(pegaTemas2()); |
105 | exit; | 127 | exit; |
@@ -654,7 +676,7 @@ function alteraTemas() | @@ -654,7 +676,7 @@ function alteraTemas() | ||
654 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | 676 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); |
655 | //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | 677 | //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); |
656 | //$tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); | 678 | //$tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); |
657 | - require_once("conexao.php"); | 679 | + include("conexao.php"); |
658 | if($id != "") | 680 | if($id != "") |
659 | { | 681 | { |
660 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); | 682 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); |
@@ -662,7 +684,7 @@ function alteraTemas() | @@ -662,7 +684,7 @@ function alteraTemas() | ||
662 | } | 684 | } |
663 | else | 685 | else |
664 | { | 686 | { |
665 | - $dbhw->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')"); | 687 | + $dbhw->query("INSERT INTO i3geoadmin_temas");// (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')"); |
666 | $id = $dbh->query("SELECT * FROM i3geoadmin_temas"); | 688 | $id = $dbh->query("SELECT * FROM i3geoadmin_temas"); |
667 | $id = $id->fetchAll(); | 689 | $id = $id->fetchAll(); |
668 | $id = intval($id[count($id)-1]['id_tema']); | 690 | $id = intval($id[count($id)-1]['id_tema']); |
@@ -750,8 +772,8 @@ function importarXmlMenu() | @@ -750,8 +772,8 @@ function importarXmlMenu() | ||
750 | {$gruposExistentes[$r["nome_grupo"]] = 0;} | 772 | {$gruposExistentes[$r["nome_grupo"]] = 0;} |
751 | foreach($xml->GRUPO as $grupo) | 773 | foreach($xml->GRUPO as $grupo) |
752 | { | 774 | { |
753 | - $nome = ixml($grupo,"GTIPO"); | ||
754 | - $descricao = ixml($grupo,"DTIPO"); | 775 | + $nome = html_entity_decode(ixml($grupo,"GTIPO")); |
776 | + $descricao = html_entity_decode(ixml($grupo,"DTIPO")); | ||
755 | if(!isset($gruposExistentes[$nome])) | 777 | if(!isset($gruposExistentes[$nome])) |
756 | $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); | 778 | $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); |
757 | $gruposExistentes[$nome] = 0; | 779 | $gruposExistentes[$nome] = 0; |
@@ -768,7 +790,7 @@ function importarXmlMenu() | @@ -768,7 +790,7 @@ function importarXmlMenu() | ||
768 | { | 790 | { |
769 | foreach($grupo->SGRUPO as $sgrupo) | 791 | foreach($grupo->SGRUPO as $sgrupo) |
770 | { | 792 | { |
771 | - $nome = ixml($sgrupo,"SDTIPO"); | 793 | + $nome = html_entity_decode(ixml($sgrupo,"SDTIPO")); |
772 | $descricao = ""; | 794 | $descricao = ""; |
773 | if(!isset($subgruposExistentes[$nome])) | 795 | if(!isset($subgruposExistentes[$nome])) |
774 | $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); | 796 | $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); |
@@ -788,8 +810,8 @@ function importarXmlMenu() | @@ -788,8 +810,8 @@ function importarXmlMenu() | ||
788 | } | 810 | } |
789 | foreach($xml->TEMA as $tema) | 811 | foreach($xml->TEMA as $tema) |
790 | { | 812 | { |
791 | - $nome = ixml($tema,"TNOME"); | ||
792 | - $descricao = ixml($tema,"TDESC"); | 813 | + $nome = html_entity_decode(ixml($tema,"TNOME")); |
814 | + $descricao = html_entity_decode(ixml($tema,"TDESC")); | ||
793 | $codigo = ixml($tema,"TID"); | 815 | $codigo = ixml($tema,"TID"); |
794 | $link = ixml($tema,"TLINK"); | 816 | $link = ixml($tema,"TLINK"); |
795 | $tipo = ixml($tema,"TIPOA"); | 817 | $tipo = ixml($tema,"TIPOA"); |
@@ -806,8 +828,8 @@ function importarXmlMenu() | @@ -806,8 +828,8 @@ function importarXmlMenu() | ||
806 | { | 828 | { |
807 | foreach($grupo->TEMA as $tema) | 829 | foreach($grupo->TEMA as $tema) |
808 | { | 830 | { |
809 | - $nome = ixml($tema,"TNOME"); | ||
810 | - $descricao = ixml($tema,"TDESC"); | 831 | + $nome = html_entity_decode(ixml($tema,"TNOME")); |
832 | + $descricao = html_entity_decode(ixml($tema,"TDESC")); | ||
811 | $codigo = ixml($tema,"TID"); | 833 | $codigo = ixml($tema,"TID"); |
812 | $link = ixml($tema,"TLINK"); | 834 | $link = ixml($tema,"TLINK"); |
813 | $tipo = ixml($tema,"TIPOA"); | 835 | $tipo = ixml($tema,"TIPOA"); |
@@ -824,8 +846,8 @@ function importarXmlMenu() | @@ -824,8 +846,8 @@ function importarXmlMenu() | ||
824 | { | 846 | { |
825 | foreach($sgrupo->TEMA as $tema) | 847 | foreach($sgrupo->TEMA as $tema) |
826 | { | 848 | { |
827 | - $nome = ixml($tema,"TNOME"); | ||
828 | - $descricao = ixml($tema,"TDESC"); | 849 | + $nome = html_entity_decode(ixml($tema,"TNOME")); |
850 | + $descricao = html_entity_decode(ixml($tema,"TDESC")); | ||
829 | $codigo = ixml($tema,"TID"); | 851 | $codigo = ixml($tema,"TID"); |
830 | $link = ixml($tema,"TLINK"); | 852 | $link = ixml($tema,"TLINK"); |
831 | $tipo = ixml($tema,"TIPOA"); | 853 | $tipo = ixml($tema,"TIPOA"); |
admin/php/sistemas.php
@@ -204,7 +204,7 @@ function importarXmlSistemas() | @@ -204,7 +204,7 @@ function importarXmlSistemas() | ||
204 | {$sistemasExistentes[$r["nome_sistema"]] = 0;} | 204 | {$sistemasExistentes[$r["nome_sistema"]] = 0;} |
205 | foreach($xml->SISTEMA as $item) | 205 | foreach($xml->SISTEMA as $item) |
206 | { | 206 | { |
207 | - $nome = ixml($item,"NOMESIS"); | 207 | + $nome = html_entity_decode(ixml($item,"NOMESIS")); |
208 | $perfil = ixml($item,"PERFIL"); | 208 | $perfil = ixml($item,"PERFIL"); |
209 | if(!isset($sistemasExistentes[$nome])) | 209 | if(!isset($sistemasExistentes[$nome])) |
210 | $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')"); | 210 | $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')"); |
@@ -215,7 +215,7 @@ function importarXmlSistemas() | @@ -215,7 +215,7 @@ function importarXmlSistemas() | ||
215 | foreach ($item->FUNCAO as $funcao) | 215 | foreach ($item->FUNCAO as $funcao) |
216 | { | 216 | { |
217 | $abrir_funcao = ixml($funcao,"ABRIR"); | 217 | $abrir_funcao = ixml($funcao,"ABRIR"); |
218 | - $nome_funcao = ixml($funcao,"NOMEFUNCAO"); | 218 | + $nome_funcao = html_entity_decode(ixml($funcao,"NOMEFUNCAO")); |
219 | $w_funcao = ixml($funcao,"JANELAW"); | 219 | $w_funcao = ixml($funcao,"JANELAW"); |
220 | $h_funcao = ixml($funcao,"JANELAH"); | 220 | $h_funcao = ixml($funcao,"JANELAH"); |
221 | $perfil_funcao = ixml($funcao,"PERFIL"); | 221 | $perfil_funcao = ixml($funcao,"PERFIL"); |
admin/php/webservices.php
@@ -131,8 +131,8 @@ function importarXmlWS() | @@ -131,8 +131,8 @@ function importarXmlWS() | ||
131 | { | 131 | { |
132 | foreach($c->item as $item) | 132 | foreach($c->item as $item) |
133 | { | 133 | { |
134 | - $descricao = ixml($item,"description"); | ||
135 | - $nome = ixml($item,"title"); | 134 | + $descricao = html_entity_decode(ixml($item,"description")); |
135 | + $nome = html_entity_decode(ixml($item,"title")); | ||
136 | $autor = ixml($item,"author"); | 136 | $autor = ixml($item,"author"); |
137 | $link = ixml($item,"link"); | 137 | $link = ixml($item,"link"); |
138 | if(!isset($wsExistentes[$nome])) | 138 | if(!isset($wsExistentes[$nome])) |