Commit ee1b8ed519523621b39076c7ddc18ab6a8507a92
1 parent
11d0da9a
Exists in
master
and in
7 other branches
novos parametros na ferramenta de animação
Showing
1 changed file
with
35 additions
and
8 deletions
Show diff stats
ferramentas/animagif/exec.php
... | ... | @@ -14,6 +14,9 @@ if(empty($_GET)){ |
14 | 14 | &mapext = extensão geográfica xmin,ymin,xmax,ymax que será usada nas imagens<br> |
15 | 15 | &legenda = sim|nao<br> |
16 | 16 | &transparente = sim|nao<br> |
17 | + &operador = operador que será utilizado no filtro. Por default utilza-se 'igual a'. Pode ser ainda lt (menor que) ou gt (maior que)<br> | |
18 | + &nulos = lista de valores, separados por ',' que não serão considerados ao aplicar o filtro, por exemplo &nulos=-, ,0<br> | |
19 | + &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro<br> | |
17 | 20 | "; |
18 | 21 | exit; |
19 | 22 | } |
... | ... | @@ -30,6 +33,24 @@ if($cache == "nao"){ |
30 | 33 | if(empty($tempo)){ |
31 | 34 | $tempo = 40; |
32 | 35 | } |
36 | +if(empty($nulos)){ | |
37 | + $nulos = ""; | |
38 | +} | |
39 | +if(empty($tipocolunat)){ | |
40 | + $tipocolunat = "string"; | |
41 | +} | |
42 | +if(empty($operador)){ | |
43 | + $operador = "="; | |
44 | +} | |
45 | +else{ | |
46 | + if($operador == "lt"){ | |
47 | + $operador = "<"; | |
48 | + } | |
49 | + if($operador == "gt"){ | |
50 | + $operador = ">"; | |
51 | + } | |
52 | +} | |
53 | +$nulos = explode(",",$nulos); | |
33 | 54 | $arqtemp = $dir_tmp."/".$nometemp; |
34 | 55 | if(file_exists($arqtemp.".gif")){ |
35 | 56 | $gifBinary = file_get_contents($arqtemp.".gif"); |
... | ... | @@ -42,15 +63,13 @@ if(file_exists($arqtemp.".gif")){ |
42 | 63 | // |
43 | 64 | //carrega o phpmapscript |
44 | 65 | // |
45 | -if (!function_exists('ms_GetVersion')) | |
46 | -{ | |
47 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
48 | - { | |
66 | +if (!function_exists('ms_GetVersion')){ | |
67 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | |
49 | 68 | if(!@dl('php_mapscript_48.dll')) |
50 | 69 | dl('php_mapscript.dll'); |
51 | 70 | } |
52 | - else | |
53 | - {dl('php_mapscript.so'); | |
71 | + else{ | |
72 | + dl('php_mapscript.so'); | |
54 | 73 | } |
55 | 74 | } |
56 | 75 | $versao = versao(); |
... | ... | @@ -176,6 +195,7 @@ $c = $mapa->imagecolor; |
176 | 195 | $c->setrgb(-1,-1,-1); |
177 | 196 | $o = $mapa->outputformat; |
178 | 197 | $o->set("imagemode",MS_IMAGEMODE_RGBA); |
198 | + | |
179 | 199 | if($transparente == "sim"){ |
180 | 200 | $o->set("transparent",MS_TRUE); |
181 | 201 | } |
... | ... | @@ -190,6 +210,7 @@ $m = new Atributos($arqtemp.".map",$tema); |
190 | 210 | $lista = $m->listaUnicoRapida($colunat); |
191 | 211 | $listaunica = array(); |
192 | 212 | foreach($lista as $l){ |
213 | + $l = str_replace($nulos,"",$l); | |
193 | 214 | if($l != ""){ |
194 | 215 | $listaunica[] = $l; |
195 | 216 | } |
... | ... | @@ -208,10 +229,16 @@ $objImagem = ""; |
208 | 229 | //$listaunica = array($listaunica[1]); |
209 | 230 | foreach($listaunica as $d){ |
210 | 231 | if(strtoupper($colunat) == $colunat){ |
211 | - $filtro = "(('[$colunat]' = '$d'))"; | |
232 | + $filtro = "(('[$colunat]' $operador '$d'))"; | |
233 | + if($tipocolunat == "numerico"){ | |
234 | + $filtro = "(([$colunat] $operador $d))"; | |
235 | + } | |
212 | 236 | } |
213 | 237 | else{ |
214 | - $filtro = "$colunat = '$d'"; | |
238 | + $filtro = "$colunat $operador '$d'"; | |
239 | + if($tipocolunat == "numerico"){ | |
240 | + $filtro = "$colunat $operador $d"; | |
241 | + } | |
215 | 242 | } |
216 | 243 | $layer->setfilter($filtro); |
217 | 244 | //$mapa->save($arqtemp.".map");echo $arqtemp;exit; | ... | ... |