Commit e09b7bbd6060840c58c87e3f5808f6363410e4c5
1 parent
5d1864e5
Exists in
master
and in
7 other branches
Inclusão de contador de acessos para os web services do tipo WMS
Showing
12 changed files
with
176 additions
and
47 deletions
Show diff stats
admin/php/criabanco.php
... | ... | @@ -8,7 +8,7 @@ $tabelas = array( |
8 | 8 | "CREATE TABLE i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", |
9 | 9 | "CREATE TABLE i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT)", |
10 | 10 | "CREATE TABLE i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, kml_tema TEXT, ogc_tema TEXT, download_tema TEXT, tags_tema TEXT, tipoa_tema TEXT, link_tema TEXT, desc_tema TEXT, nome_tema TEXT, codigo_tema TEXT)", |
11 | -"CREATE TABLE i3geoadmin_ws (autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | |
11 | +"CREATE TABLE i3geoadmin_ws (nacessos INTEGER, nacessosok INTEGER, autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | |
12 | 12 | "CREATE TABLE i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", |
13 | 13 | "CREATE TABLE i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", |
14 | 14 | "CREATE TABLE i3geoadmin_atlasp (ordem_prancha NUMERIC, desc_prancha TEXT, h_prancha NUMERIC, icone_prancha TEXT, id_atlas NUMERIC, id_prancha INTEGER PRIMARY KEY, link_prancha TEXT, mapext_prancha TEXT, titulo_prancha TEXT, w_prancha NUMERIC)", | ... | ... |
admin/php/webservices.php
... | ... | @@ -83,7 +83,7 @@ function alterarWS() |
83 | 83 | } |
84 | 84 | else |
85 | 85 | { |
86 | - $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,tipo_ws,link_ws) VALUES ('','','','','')"); | |
86 | + $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,tipo_ws,link_ws,nacessos,nacessosok) VALUES ('','','','','','','')"); | |
87 | 87 | $id = $dbhw->query("SELECT id_ws FROM i3geoadmin_ws"); |
88 | 88 | $id = $id->fetchAll(); |
89 | 89 | $id = intval($id[count($id)-1]['id_ws']); |
... | ... | @@ -114,6 +114,27 @@ function excluirWS() |
114 | 114 | return "Error!: " . $e->getMessage(); |
115 | 115 | } |
116 | 116 | } |
117 | +function adicionaAcesso($id_ws,$sucesso) | |
118 | +{ | |
119 | + try | |
120 | + { | |
121 | + //error_reporting(E_ALL); | |
122 | + include("conexao.php"); | |
123 | + $dados = pegaDados("select * from i3geoadmin_ws WHERE id_ws = $id_ws"); | |
124 | + $acessos = $dados[0]["nacessos"] + 1; | |
125 | + if($sucesso) | |
126 | + $ok = $dados[0]["nacessosok"] + 1; | |
127 | + else | |
128 | + $ok = $dados[0]["nacessosok"]; | |
129 | + $dbhw->query("UPDATE i3geoadmin_ws SET nacessos = '$acessos',nacessosok = '$ok' WHERE id_ws = $id_ws"); | |
130 | + $dbhw = null; | |
131 | + $dbh = null; | |
132 | + } | |
133 | + catch (PDOException $e) | |
134 | + { | |
135 | + return "Error!: " . $e->getMessage(); | |
136 | + } | |
137 | +} | |
117 | 138 | function importarXmlWS() |
118 | 139 | { |
119 | 140 | global $xml,$tipo; |
... | ... | @@ -146,7 +167,7 @@ function importarXmlWS() |
146 | 167 | $autor = utf8_encode($autor); |
147 | 168 | } |
148 | 169 | if(!isset($wsExistentes[$nome])) |
149 | - $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws) VALUES ('$nome','$desc','$autor','$link','$tipo')"); | |
170 | + $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws,nacessos,nacessosok) VALUES ('$nome','$desc','$autor','$link','$tipo',0,0)"); | |
150 | 171 | $wsExistentes[$nome] = 0; |
151 | 172 | } |
152 | 173 | } | ... | ... |
admin/php/xml.php
... | ... | @@ -106,6 +106,9 @@ function geraXmlRSS($locaplic,$sql,$descricao) |
106 | 106 | $xml .= "<link>".xmlTexto_prepara($row["link_ws"])."</link>\n"; |
107 | 107 | $xml .= "<pubDate/>\n"; |
108 | 108 | $xml .= "<author>".xmlTexto_prepara($row["autor_ws"])."</author>\n"; |
109 | + $xml .= "<nacessos>".xmlTexto_prepara($row["nacessos"])."</nacessos>\n"; | |
110 | + $xml .= "<nacessosok>".xmlTexto_prepara($row["nacessosok"])."</nacessosok>\n"; | |
111 | + $xml .= "<id>".xmlTexto_prepara($row["id_ws"])."</id>\n"; | |
109 | 112 | $xml .= "</item>\n"; |
110 | 113 | } |
111 | 114 | $xml .= "</channel></rss>\n"; | ... | ... |
classesphp/classe_mapa.php
... | ... | @@ -1134,9 +1134,10 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1134 | 1134 | { |
1135 | 1135 | $env = array(); |
1136 | 1136 | //define o tipo |
1137 | - $tipog = "envelope"; | |
1137 | + $tipog = ""; | |
1138 | 1138 | if ($item->xpath('geo:lat')){$tipog = "geo";} |
1139 | 1139 | if ($item->xpath('georss:point')){$tipog = "georsspoint";} |
1140 | + if ($item->xpath('georss:where')){$tipog = "envelope";} | |
1140 | 1141 | if ($tipog == "envelope") |
1141 | 1142 | { |
1142 | 1143 | foreach ($item->xpath('georss:where') as $w) |
... | ... | @@ -1175,7 +1176,7 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1175 | 1176 | } |
1176 | 1177 | if (count($env) > 0) |
1177 | 1178 | { |
1178 | - $resultado[] = array($item->title,$item->link,$item->description,$item->category,$env); | |
1179 | + $resultado[] = array(ixml($item,"title"),ixml($item,"link"),ixml($item,"description"),ixml($item,"category"),$env); | |
1179 | 1180 | } |
1180 | 1181 | } |
1181 | 1182 | //cria o shapefile com os dados |
... | ... | @@ -1254,6 +1255,7 @@ $canal - Identificador do canal (ordem em que está no RSS) |
1254 | 1255 | } |
1255 | 1256 | //$layer->set("transparency",50); |
1256 | 1257 | $layer->setmetadata("nomeoriginal",basename($nomeshp)); |
1258 | + //echo $tipol; | |
1257 | 1259 | return("ok"); |
1258 | 1260 | } |
1259 | 1261 | return("erro"); | ... | ... |
classesphp/funcoes_gerais.php
... | ... | @@ -1448,7 +1448,7 @@ function reSLD($map_file,$tema,$sld) |
1448 | 1448 | fclose($fp); |
1449 | 1449 | } |
1450 | 1450 | /* |
1451 | -function: georssCanais | |
1451 | +function: georssCanais (depreciado) | |
1452 | 1452 | |
1453 | 1453 | Lista os canais de um GeoRss. |
1454 | 1454 | |
... | ... | @@ -1464,15 +1464,15 @@ $locaplic - Localização do I3geo |
1464 | 1464 | function georssCanais($servico,$map_file,$dir_tmp,$locaplic) |
1465 | 1465 | { |
1466 | 1466 | $xml = simplexml_load_file($servico); |
1467 | + //var_dump($xml); | |
1467 | 1468 | foreach($xml->channel as $c) |
1468 | 1469 | { |
1469 | - $resultado[] = $c->title."#".$c->link."#".$c->description."#".$c->category; | |
1470 | + $resultado[] = array("title"=>(ixml($c,"title")),"link"=>(ixml($c,"link")),"description"=>(ixml($c,"description")),"category"=>(ixml($c,"category"))); | |
1470 | 1471 | } |
1471 | - if (function_exists("mb_convert_encoding")) | |
1472 | - {return(mb_convert_encoding(implode("*",$resultado),"HTML-ENTITIES","auto"));} | |
1473 | - else | |
1474 | - {return(implode("*",$resultado));} | |
1472 | + //var_dump($resultado); | |
1473 | + return $resultado; | |
1475 | 1474 | } |
1475 | + | |
1476 | 1476 | /* |
1477 | 1477 | Section: tema |
1478 | 1478 | */ | ... | ... |
classesphp/wmswfs.php
... | ... | @@ -90,10 +90,12 @@ parameters: |
90 | 90 | $servico - Endereço do web service. |
91 | 91 | |
92 | 92 | $cp - Objeto CPAINT. |
93 | + | |
94 | +$id_ws - id do wms se estiver sendo utilizado o banco de administração do i3geo | |
93 | 95 | */ |
94 | 96 | function getcapabilities() |
95 | 97 | { |
96 | - global $servico,$cp; | |
98 | + global $servico,$cp,$id_ws; | |
97 | 99 | $teste = explode("=",$servico); |
98 | 100 | if ( count($teste) > 1 ){$servico = $servico."&";} |
99 | 101 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&version=1.1.0"; |
... | ... | @@ -227,7 +229,7 @@ $cp - Objeto CPAINT. |
227 | 229 | */ |
228 | 230 | function temaswms() |
229 | 231 | { |
230 | - global $servico,$cp; | |
232 | + global $servico,$cp,$id_ws; | |
231 | 233 | $teste = explode("=",$servico); |
232 | 234 | if ( count($teste) > 1 ){$servico = $servico."&";} |
233 | 235 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1"; |
... | ... | @@ -235,11 +237,21 @@ function temaswms() |
235 | 237 | # Test that the capabilites file has successfully downloaded. |
236 | 238 | # |
237 | 239 | //$wms_service_request = "c://temp//teste.xml"; |
240 | + include_once("../admin/php/webservices.php"); | |
238 | 241 | if( !($wms_capabilities = file($wms_service_request)) ) { |
239 | 242 | # Cannot download the capabilities file. |
243 | + //registra a tentativa de acesso | |
244 | + if(isset($id_ws)) | |
245 | + { | |
246 | + adicionaAcesso($id_ws,false); | |
247 | + } | |
240 | 248 | $cp->set_data("Erro de acesso"); |
241 | 249 | return; |
242 | 250 | } |
251 | + if(isset($id_ws)) | |
252 | + { | |
253 | + adicionaAcesso($id_ws,true); | |
254 | + } | |
243 | 255 | $wms_capabilities = implode("",$wms_capabilities); |
244 | 256 | $dom = new DomDocument(); |
245 | 257 | $dom->loadXML($wms_capabilities); | ... | ... |
classesphp/wscliente.php
... | ... | @@ -338,8 +338,15 @@ if ($funcao == "listaRSSws2") |
338 | 338 | $cp->return_data(); |
339 | 339 | exit; |
340 | 340 | } |
341 | +if ($funcao == "listaRSSwsARRAY") | |
342 | +{ | |
343 | + $cp->register('listaRSSwsARRAY'); | |
344 | + $cp->start(); | |
345 | + $cp->return_data(); | |
346 | + exit; | |
347 | +} | |
341 | 348 | /* |
342 | -Function: listaRSSws2 | |
349 | +Function: listaRSSws2 (depreciado) | |
343 | 350 | |
344 | 351 | Pega os links de um RSS. |
345 | 352 | |
... | ... | @@ -394,6 +401,74 @@ function listaRSSws2() |
394 | 401 | $cp->set_data($retorna); |
395 | 402 | } |
396 | 403 | /* |
404 | +Function: listaRSSwsARRAY | |
405 | + | |
406 | +Pega os links de um RSS e retorna o resultado como um array. | |
407 | + | |
408 | +cp - Objeto CPAINT. | |
409 | + | |
410 | +rss - Endereços dos RSS. | |
411 | + | |
412 | +tipo - Tipo de recurso, permite a escolha do programa PHP que será usado GEORSS|WMS|WS|DOWNLOAD | |
413 | +*/ | |
414 | +function listaRSSwsARRAY() | |
415 | +{ | |
416 | + global $cp,$rss,$locaplic,$tipo; | |
417 | + if(!isset($tipo)){$tipo = "GEORSS";} | |
418 | + include_once("$locaplic/classesphp/funcoes_gerais.php"); | |
419 | + include_once("$locaplic/admin/php/xml.php"); | |
420 | + include_once("$locaplic/ms_configura.php"); | |
421 | + $rsss = explode("|",$rss); | |
422 | + if(count($rsss) == 0){$rsss = array(" ");} | |
423 | + $erro = "Erro. Nao foi possivel ler o arquivo"; | |
424 | + $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | |
425 | + $urli3geo = $protocolo[0]."://".$_SERVER['HTTP_HOST']."/".basename($locaplic); | |
426 | + foreach ($rsss as $r) | |
427 | + { | |
428 | + if($r == "" || $r == " ") | |
429 | + { | |
430 | + | |
431 | + if($tipo == "GEORSS") | |
432 | + { | |
433 | + $canali = simplexml_load_string(geraXmlGeorss($locaplic)); | |
434 | + $linkrss = $urli3geo."/admin/xmlgeorss.php"; | |
435 | + } | |
436 | + if($tipo == "WMS") | |
437 | + { | |
438 | + $canali = simplexml_load_string(geraXmlWMS($locaplic)); | |
439 | + $linkrss = $urli3geo."/admin/xmlservicoswms.php"; | |
440 | + } | |
441 | + if($tipo == "WS") | |
442 | + { | |
443 | + $canali = simplexml_load_string(geraXmlWS($locaplic)); | |
444 | + $linkrss = $urli3geo."/admin/xmlservicosws.php"; | |
445 | + } | |
446 | + if($tipo == "DOWNLOAD") | |
447 | + { | |
448 | + $canali = simplexml_load_string(geraXmlDownload($locaplic)); | |
449 | + $linkrss = $urli3geo."/admin/xmllinksdownload.php"; | |
450 | + } | |
451 | + } | |
452 | + else | |
453 | + {$canali = simplexml_load_file($rss);} | |
454 | + if($r != "") | |
455 | + $linhas["rss"] = "<a href='".$r."' target=blank ><img src='imagens/rss.gif' /></a>"; | |
456 | + else | |
457 | + { | |
458 | + $linhas["rss"] = "<a href='".$linkrss."' target=blank ><img src='imagens/rss.gif' /></a>"; | |
459 | + } | |
460 | + //var_dump($canali); | |
461 | + $canais = array(); | |
462 | + foreach ($canali->channel->item as $item) | |
463 | + { | |
464 | + $canais[] = array("id_ws"=>(ixml($item,"id")),"title"=>(ixml($item,"title")),"description"=>(ixml($item,"description")),"link"=>(ixml($item,"link")),"author"=>(ixml($item,"author")),"nacessos"=>(ixml($item,"nacessos")),"nacessosok"=>(ixml($item,"nacessosok"))); | |
465 | + } | |
466 | + $linhas["canais"] = $canais; | |
467 | + } | |
468 | + $cp->set_data($linhas); | |
469 | +} | |
470 | + | |
471 | +/* | |
397 | 472 | Function: listaRSSws |
398 | 473 | |
399 | 474 | Pega os links de um RSS usando a biblioteca magpierss (depreciado). | ... | ... |
ferramentas/conectargeorss/index.htm
... | ... | @@ -38,23 +38,34 @@ if (document.getElementById("RSS")) |
38 | 38 | { |
39 | 39 | if (g_RSS.length > 0) |
40 | 40 | { |
41 | - var p = "../../classesphp/wscliente.php?funcao=listaRSSws2&rss="+g_RSS.join("|")+"&tipo=GEORSS"; | |
41 | + var p = "../../classesphp/wscliente.php?funcao=listaRSSwsARRAY&rss="+g_RSS.join("|")+"&tipo=GEORSS"; | |
42 | 42 | var cp = new cpaint(); |
43 | 43 | //cp.set_debug(2) |
44 | 44 | cp.set_response_type("JSON"); |
45 | - cp.call(p,"listaRSSws2",mostraRetornoRSS); | |
45 | + cp.call(p,"listaRSSwsARRAY",mostraRetornoRSS); | |
46 | 46 | } |
47 | 47 | } |
48 | 48 | function mostraRetornoRSS(retorno) |
49 | 49 | { |
50 | - aguarde("none"); | |
51 | - var linhas = retorno.data.split("|") | |
52 | - var ins = "" | |
53 | - for (i=0;i<linhas.length; i++) | |
50 | + aguarde("none") | |
51 | + var reg = /Erro/gi; | |
52 | + if (retorno.data.rss.search(reg) != -1) | |
54 | 53 | { |
55 | - var caso = linhas[i].split("#") | |
56 | - ins += "\<p class=clique onclick=\"registraws('"+caso[2]+"')\" \>\<b\>"+caso[0]+"\<\/b\> "+caso[1]; | |
57 | - if (caso[3] != ""){ins += " ("+caso[3]+")\<\/p\>"} | |
54 | + alert("OOps! Ocorreu um erro\n"+retorno.data); | |
55 | + return; | |
56 | + } | |
57 | + var canais = retorno.data.canais | |
58 | + var ncanais = canais.length | |
59 | + var ins = "<br>"+retorno.data.rss | |
60 | + for (i=0;i<ncanais; i++) | |
61 | + { | |
62 | + var caso = canais[i] | |
63 | + ins += "\<p class=clique onclick=\"registraws('"+caso.link+"','"+caso.id_ws+"')\" \>\<b\>"+caso.title+"\<\/b\> "+caso.description+" ("+caso.author+")" | |
64 | + if(caso.nacessos > 0) | |
65 | + { | |
66 | + var pc = (parseInt(caso.nacessosok) * 100) / parseInt(caso.nacessos) | |
67 | + ins += " \<span style=color:gray \>(disponibilidade: "+pc+"%, acessos considerados: "+caso.nacessos+")\<\/span>\<\/p\>"; | |
68 | + } | |
58 | 69 | } |
59 | 70 | document.getElementById("RSS").innerHTML = ins+"<br><br>" |
60 | 71 | } | ... | ... |
ferramentas/conectargeorss/index.js
... | ... | @@ -51,9 +51,13 @@ function clickGuia2() |
51 | 51 | cp.call(p,"georssCanais",listaCanais); |
52 | 52 | } |
53 | 53 | } |
54 | -function registraws(nome) | |
54 | +function registraws(nome,id_ws) | |
55 | 55 | { |
56 | 56 | $i("servico").value = nome; |
57 | + if(arguments.length == 2) | |
58 | + g_idws = id_ws | |
59 | + else | |
60 | + g_idws = "" | |
57 | 61 | clickGuia2() |
58 | 62 | } |
59 | 63 | function listaCanais(retorno) |
... | ... | @@ -61,15 +65,13 @@ function listaCanais(retorno) |
61 | 65 | var ins = "Clique no botão 'mapa' para incluir os dados do canal desejado<br>" |
62 | 66 | if (retorno.data != undefined) |
63 | 67 | { |
64 | - var retorno = (retorno.data).split("*") | |
68 | + var retorno = retorno.data | |
65 | 69 | for (i=0;i<retorno.length; i++) |
66 | 70 | { |
67 | - var canal = retorno[i] | |
68 | - var descs = canal.split("#") | |
69 | - ins += "<p style=cursor:pointer onclick=adicionatema('"+i+"') ><input type=radio name=cn value=mapa > <b>"+descs[0]+ "</b></p>" | |
70 | - ins += "<br><a href="+descs[1]+" target=blank >"+descs[1]+"</a>" | |
71 | - ins += "<br><i>Descrição:</i> "+descs[2] | |
72 | - ins += "<br><i>Categoria: </i>"+descs[3] | |
71 | + ins += "<p style=cursor:pointer onclick=adicionatema('"+i+"') ><input type=radio name=cn value=mapa > <b>"+retorno[i].title+ "</b></p>" | |
72 | + ins += "<br><a href="+retorno[i].link+" target=blank >"+retorno[i].link+"</a>" | |
73 | + ins += "<br><i>Descrição:</i> "+retorno[i].description | |
74 | + ins += "<br><i>Categoria: </i>"+retorno[i].category | |
73 | 75 | } |
74 | 76 | $i("resultadoget").innerHTML = ins |
75 | 77 | } | ... | ... |
ferramentas/conectarwms/index.htm
... | ... | @@ -63,6 +63,7 @@ |
63 | 63 | <script type="text/javascript" > |
64 | 64 | mensagemAjuda("men1",document.getElementById("men1").innerHTML) |
65 | 65 | mensagemAjuda("men2",document.getElementById("men2").innerHTML) |
66 | +g_RSSwms = new Array("") | |
66 | 67 | |
67 | 68 | aguarde("block") |
68 | 69 | g_locaplic = window.parent.g_locaplic; |
... | ... | @@ -70,36 +71,34 @@ if (document.getElementById("RSSwms")) |
70 | 71 | { |
71 | 72 | if (g_RSSwms.length > 0) |
72 | 73 | { |
73 | - var p = g_locaplic+"/classesphp/wscliente.php?funcao=listaRSSws2&rss="+g_RSSwms.join("|")+"&tipo=WMS"; | |
74 | + var p = g_locaplic+"/classesphp/wscliente.php?funcao=listaRSSwsARRAY&rss="+g_RSSwms.join("|")+"&tipo=WMS"; | |
74 | 75 | var cp = new cpaint(); |
75 | 76 | //cp.set_debug(2) |
76 | 77 | cp.set_response_type("JSON"); |
77 | - cp.call(p,"listaRSSws2",mostraRetornowmsRSS); | |
78 | + cp.call(p,"listaRSSwsARRAY",mostraRetornowmsRSS); | |
78 | 79 | } |
79 | 80 | } |
80 | 81 | function mostraRetornowmsRSS(retorno) |
81 | 82 | { |
82 | 83 | aguarde("none") |
83 | 84 | var reg = /Erro/gi; |
84 | - if (retorno.data.search(reg) != -1) | |
85 | + if (retorno.data.rss.search(reg) != -1) | |
85 | 86 | { |
86 | 87 | alert("OOps! Ocorreu um erro\n"+retorno.data); |
87 | 88 | return; |
88 | 89 | } |
89 | - var linhas = retorno.data.split("|") | |
90 | - var ins = "" | |
91 | - for (i=0;i<linhas.length; i++) | |
90 | + var canais = retorno.data.canais | |
91 | + var ncanais = canais.length | |
92 | + var ins = "<br>"+retorno.data.rss | |
93 | + for (i=0;i<ncanais; i++) | |
92 | 94 | { |
93 | - var caso = linhas[i].split("#") | |
94 | - if (i > 0) | |
95 | + var caso = canais[i] | |
96 | + ins += "\<p class=clique onclick=\"registraws('"+caso.link+"','"+caso.id_ws+"')\" \>\<b\>"+caso.title+"\<\/b\> "+caso.description+" ("+caso.author+")" | |
97 | + if(caso.nacessos > 0) | |
95 | 98 | { |
96 | - ins += "\<p class=clique onclick=\"registraws('"+caso[2]+"')\" \>\<b\>"+caso[0]+"\<\/b\> "+caso[1]+" ("+caso[3]+")" | |
97 | - if (caso[4]) | |
98 | - {ins += " \<span style=color:gray \>(disponibilidade: "+parseInt(caso[4])+"%, dias considerados: "+caso[5]+")\<\/span>\<\/p\>";} | |
99 | - else {ins += "\<\/p\>"} | |
99 | + var pc = (parseInt(caso.nacessosok) * 100) / parseInt(caso.nacessos) | |
100 | + ins += " \<span style=color:gray \>(disponibilidade: "+pc+"%, acessos considerados: "+caso.nacessos+")\<\/span>\<\/p\>"; | |
100 | 101 | } |
101 | - else | |
102 | - {ins += "\<p class=clique \>\<b\>"+caso[0]+"\<\/b\> "+caso[1]+" \<\/p\>"} | |
103 | 102 | } |
104 | 103 | document.getElementById("RSSwms").innerHTML = ins+"<br><br>" |
105 | 104 | } | ... | ... |
ferramentas/conectarwms/index.js
... | ... | @@ -65,19 +65,23 @@ function clickGuia3() |
65 | 65 | mostraGuia("guia3") |
66 | 66 | $i("listatemas").innerHTML = ""; |
67 | 67 | aguarde("block") |
68 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=temaswms&servico="+$i("servico").value | |
68 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=temaswms&&id_ws="+g_idws+"&servico="+$i("servico").value | |
69 | 69 | var cp = new cpaint(); |
70 | 70 | //cp.set_debug(2) |
71 | 71 | cp.set_response_type("JSON"); |
72 | 72 | cp.call(p,"temaswms",listatemas); |
73 | 73 | } |
74 | -function registraws(nome) | |
74 | +function registraws(nome,id_ws) | |
75 | 75 | { |
76 | 76 | $i("servico").value = nome; |
77 | 77 | g_tipo = ""; //tipo de tema |
78 | 78 | g_tema = ""; //tema selecionado do ws |
79 | 79 | g_legenda = ""; //legenda do tema |
80 | 80 | g_nometema = ""; //nome do tema |
81 | + if(arguments.length == 2) | |
82 | + g_idws = id_ws | |
83 | + else | |
84 | + g_idws = "" | |
81 | 85 | clickGuia3() |
82 | 86 | } |
83 | 87 | ... | ... |
menutemas/admin.db
No preview for this file type