From ee1b8ed519523621b39076c7ddc18ab6a8507a92 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 22 Mar 2016 22:53:24 -0300 Subject: [PATCH] novos parametros na ferramenta de animação --- ferramentas/animagif/exec.php | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/ferramentas/animagif/exec.php b/ferramentas/animagif/exec.php index 307fb54..4a2c81f 100755 --- a/ferramentas/animagif/exec.php +++ b/ferramentas/animagif/exec.php @@ -14,6 +14,9 @@ if(empty($_GET)){ &mapext = extensão geográfica xmin,ymin,xmax,ymax que será usada nas imagens
&legenda = sim|nao
&transparente = sim|nao
+ &operador = operador que será utilizado no filtro. Por default utilza-se 'igual a'. Pode ser ainda lt (menor que) ou gt (maior que)
+ &nulos = lista de valores, separados por ',' que não serão considerados ao aplicar o filtro, por exemplo &nulos=-, ,0
+ &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro
"; exit; } @@ -30,6 +33,24 @@ if($cache == "nao"){ if(empty($tempo)){ $tempo = 40; } +if(empty($nulos)){ + $nulos = ""; +} +if(empty($tipocolunat)){ + $tipocolunat = "string"; +} +if(empty($operador)){ + $operador = "="; +} +else{ + if($operador == "lt"){ + $operador = "<"; + } + if($operador == "gt"){ + $operador = ">"; + } +} +$nulos = explode(",",$nulos); $arqtemp = $dir_tmp."/".$nometemp; if(file_exists($arqtemp.".gif")){ $gifBinary = file_get_contents($arqtemp.".gif"); @@ -42,15 +63,13 @@ if(file_exists($arqtemp.".gif")){ // //carrega o phpmapscript // -if (!function_exists('ms_GetVersion')) -{ - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - { +if (!function_exists('ms_GetVersion')){ + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ if(!@dl('php_mapscript_48.dll')) dl('php_mapscript.dll'); } - else - {dl('php_mapscript.so'); + else{ + dl('php_mapscript.so'); } } $versao = versao(); @@ -176,6 +195,7 @@ $c = $mapa->imagecolor; $c->setrgb(-1,-1,-1); $o = $mapa->outputformat; $o->set("imagemode",MS_IMAGEMODE_RGBA); + if($transparente == "sim"){ $o->set("transparent",MS_TRUE); } @@ -190,6 +210,7 @@ $m = new Atributos($arqtemp.".map",$tema); $lista = $m->listaUnicoRapida($colunat); $listaunica = array(); foreach($lista as $l){ + $l = str_replace($nulos,"",$l); if($l != ""){ $listaunica[] = $l; } @@ -208,10 +229,16 @@ $objImagem = ""; //$listaunica = array($listaunica[1]); foreach($listaunica as $d){ if(strtoupper($colunat) == $colunat){ - $filtro = "(('[$colunat]' = '$d'))"; + $filtro = "(('[$colunat]' $operador '$d'))"; + if($tipocolunat == "numerico"){ + $filtro = "(([$colunat] $operador $d))"; + } } else{ - $filtro = "$colunat = '$d'"; + $filtro = "$colunat $operador '$d'"; + if($tipocolunat == "numerico"){ + $filtro = "$colunat $operador $d"; + } } $layer->setfilter($filtro); //$mapa->save($arqtemp.".map");echo $arqtemp;exit; -- libgit2 0.21.2