Commit 511b488f289520ea745be529dddd50435f716096

Authored by Edmar Moretti
1 parent bb1ff43c

Inclusão da opção de adição de temas

mobile/adicionatema.php 0 → 100644
@@ -0,0 +1,100 @@ @@ -0,0 +1,100 @@
  1 +<?php
  2 +error_reporting(0);
  3 +require_once("../classesphp/funcoes_gerais.php");
  4 +include_once ("../classesphp/pega_variaveis.php");
  5 +include_once("../classesphp/carrega_ext.php");
  6 +include("../classesphp/classe_menutemas.php");
  7 +include("../ms_configura.php");
  8 +?>
  9 +<html>
  10 +<style>
  11 +body
  12 +{
  13 + font:14pt arial,helvetica,clean,sans-serif;
  14 + color:rgb(100,100,100);
  15 +}
  16 +p
  17 +{
  18 + font:12pt arial,helvetica,clean,sans-serif;
  19 + color:black;
  20 +}
  21 +input
  22 +{
  23 + font:14pt arial,helvetica,clean,sans-serif;
  24 + color:black;
  25 + cursor:pointer;
  26 + background-color:white;
  27 +}
  28 +</style>
  29 +<body>
  30 +<form id='f' action='adicionatema.php?' method='get'>
  31 + <input type='hidden' name='tmpfname' value='<?php echo $tmpfname; ?>' />
  32 + <input id='tipo' type=hidden name='tipo' value='retorno' />
  33 + <input id='grupo' type=hidden name='grupo' value='' />
  34 + <input id='subgrupo' type=hidden name='subgrupo' value='' />
  35 + <input id='tid' type=hidden name='tid' value='' />
  36 +</form>
  37 +<input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br><br>
  38 +<?php
  39 +if ($tipo == "listatemas")
  40 +{
  41 + $m = new Menutemas($tmpfname,"","nao");
  42 + $r = $m->pegaListaDeTemas($grupo,$subgrupo,"");
  43 + echo "Escolha o tema:<br><br>";
  44 + foreach($r as $l)
  45 + {
  46 + echo "<input type='radio' onclick='adicionatema(\"".$l["tid"]."\")' />".$l["nome"]."<br>";
  47 + }
  48 +}
  49 +if($tipo == "adicionatema")
  50 +{
  51 + include("../classesphp/classe_mapa.php");
  52 + $m = new Mapa($tmpfname);
  53 + $m->adicionaTema($tid,$locaplic);
  54 + $m->salva();
  55 + $urln = "mobile.php?tmpfname=".$tmpfname;
  56 + echo "<meta http-equiv='refresh' content='0;url=$urln'>";
  57 +}
  58 +if ($tipo == "adicionar")
  59 +{
  60 + $m = new Menutemas($tmpfname,"",$locsistemas);
  61 + $r = $m->pegaListaDeGrupos("","nao");
  62 + echo "Escolha o sub-grupo:<br><br>";
  63 + for($rid=0;$rid<count($r);$rid++)
  64 + {
  65 + $g = $r[$rid];
  66 + echo $g["nome"]."<br>";
  67 + $sub = $g["subgrupos"];
  68 + for($sid=0;$sid<count($sub);$sid++)
  69 + {
  70 + $s = $sub[$sid];
  71 + echo "<input type='radio' onclick='listatemas(\"".$rid."\",\"".$sid."\")' /><span style='color:gray;font-size:12pt;'>".$s["nome"]."</span><br>";
  72 + }
  73 + }
  74 +}
  75 +
  76 +
  77 +?>
  78 +</body>
  79 +<script>
  80 +function retorno()
  81 +{
  82 + document.getElementById('tipo').value='retorno';
  83 + document.getElementById('f').action = 'mobile.php';
  84 + document.getElementById('f').submit();
  85 +}
  86 +function listatemas(grupo,sub)
  87 +{
  88 + document.getElementById("tipo").value = "listatemas";
  89 + document.getElementById("grupo").value = grupo;
  90 + document.getElementById("subgrupo").value = sub;
  91 + document.getElementById('f').submit();
  92 +}
  93 +function adicionatema(tid)
  94 +{
  95 + document.getElementById("tipo").value = "adicionatema";
  96 + document.getElementById("tid").value = tid;
  97 + document.getElementById('f').submit();
  98 +}
  99 +</script>
  100 +</html>
0 \ No newline at end of file 101 \ No newline at end of file
mobile/localizar.php
@@ -94,50 +94,8 @@ if($tipo == &quot;zoom&quot;) @@ -94,50 +94,8 @@ if($tipo == &quot;zoom&quot;)
94 $m = new Mapa($tmpfname); 94 $m = new Mapa($tmpfname);
95 $m->adicionatemawms($layer,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo); 95 $m->adicionatemawms($layer,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo);
96 $m->salva(); 96 $m->salva();
97 - //echo $tmpfname;exit;  
98 $urln = "mobile.php?tmpfname=".$tmpfname; 97 $urln = "mobile.php?tmpfname=".$tmpfname;
99 echo "<meta http-equiv='refresh' content='0;url=$urln'>"; 98 echo "<meta http-equiv='refresh' content='0;url=$urln'>";
100 -  
101 -/*  
102 - var re = new RegExp("POLYGON", "g")  
103 - wkt = wkt.replace(re,"")  
104 - wkt = wkt.split("(")[2].split(")")[0]  
105 - wkt = wkt.split(",");  
106 - x = new Array();  
107 - y = new Array();  
108 - for (w=0;w<wkt.length; w++)  
109 - {  
110 - temp = wkt[w].split(" ");  
111 - x.push(temp[0])  
112 - y.push(temp[1])  
113 - }  
114 - x.sort(sortNumber)  
115 - xMin = x[0]  
116 - xMax = x[(x.length)-1]  
117 - y.sort(sortNumber)  
118 - yMin = y[0]  
119 - yMax = y[(y.length)-1]  
120 - var ext = xMin+" "+yMin+" "+xMax+" "+yMax  
121 - window.parent.objaguarde.abre("ajaxredesenha","Aguarde...");  
122 - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+ext+"&g_sid="+g_sid;  
123 - var cp = new cpaint();  
124 - //cp.set_debug(2)  
125 - cp.set_response_type("JSON");  
126 - cp.call(p,"mudaExtensao",adicionaCamada(layer,gid,nm));  
127 - var adicionaCamada = function(layer,gid,nm)  
128 - {  
129 - var s = "&tema="+layer  
130 - s += "&servico=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&";  
131 - s += "&nome=default"  
132 - s += "&proj=EPSG:4291&formato=image/png&nomecamada="+nm+" - "+layer  
133 - s += "&suportasld=nao&versao=1.1.0"  
134 - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adicionatemawms&g_sid="+g_sid+s;  
135 - var cp = new cpaint();  
136 - //cp.set_debug(2)  
137 - cp.set_response_type("JSON");  
138 - cp.call(p,"mudaExtensao",window.parent.ajaxredesenha);  
139 - }  
140 -*/  
141 } 99 }
142 ?> 100 ?>
143 </body> 101 </body>
mobile/mobile.php
@@ -106,6 +106,7 @@ else @@ -106,6 +106,7 @@ else
106 <option value='legenda'>legenda</option> 106 <option value='legenda'>legenda</option>
107 <option value='escala'>escala</option> 107 <option value='escala'>escala</option>
108 <option value='localizar'>localizar</option> 108 <option value='localizar'>localizar</option>
  109 + <option value='adicionar'>adicionar</option>
109 </select> 110 </select>
110 </div> 111 </div>
111 <form id='f' action='mobile.php?' method='get'> 112 <form id='f' action='mobile.php?' method='get'>
@@ -161,6 +162,8 @@ function op(valor) @@ -161,6 +162,8 @@ function op(valor)
161 {document.getElementById('f').action = "legenda.php?"} 162 {document.getElementById('f').action = "legenda.php?"}
162 if (valor=="localizar") 163 if (valor=="localizar")
163 {document.getElementById('f').action = "localizar.php?"} 164 {document.getElementById('f').action = "localizar.php?"}
  165 + if (valor=="adicionar")
  166 + {document.getElementById('f').action = "adicionatema.php?"}
164 document.getElementById('f').submit(); 167 document.getElementById('f').submit();
165 } 168 }
166 </script> 169 </script>