Commit d1a68759e99e59767331438ee4c5eebb74096753
1 parent
3ce768b6
Exists in
master
and in
7 other branches
--no commit message
Showing
4 changed files
with
39 additions
and
11 deletions
Show diff stats
admin/js/estat_variavel.js
@@ -451,7 +451,10 @@ function sql(tipo,id) { | @@ -451,7 +451,10 @@ function sql(tipo,id) { | ||
451 | callback = { | 451 | callback = { |
452 | success: function(oResponse){ | 452 | success: function(oResponse){ |
453 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText); | 453 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText); |
454 | - dados = dados.histograma; | 454 | + dados = dados.grupos; |
455 | + if(dados == ""){ | ||
456 | + dados = dados.histograma; | ||
457 | + } | ||
455 | //converte os dados para o padrao usado no grafico | 458 | //converte os dados para o padrao usado no grafico |
456 | abreDados = function(){ | 459 | abreDados = function(){ |
457 | i3GEOF.graficointerativo.dados = dados; | 460 | i3GEOF.graficointerativo.dados = dados; |
@@ -494,7 +497,13 @@ function sql(tipo,id) { | @@ -494,7 +497,13 @@ function sql(tipo,id) { | ||
494 | i++; | 497 | i++; |
495 | } | 498 | } |
496 | ins.push("</table><br>"); | 499 | ins.push("</table><br>"); |
500 | + //ins.push("<input type=hidden id=i3GEOgraficointerativoComboXid />"); | ||
501 | + //ins.push("<input type=hidden id=i3GEOgraficointerativoComboYid />"); | ||
497 | $i("i3GEOgraficointerativoDados").innerHTML = ins.join(""); | 502 | $i("i3GEOgraficointerativoDados").innerHTML = ins.join(""); |
503 | + if($i("agruparsql").value != ""){ | ||
504 | + //$i("i3GEOgraficointerativoComboXid").value = $i("agruparsql").value; | ||
505 | + //$i("i3GEOgraficointerativoComboYid").value = "Soma"; | ||
506 | + } | ||
498 | }; | 507 | }; |
499 | i3GEOF.graficointerativo.criaJanelaFlutuante(); | 508 | i3GEOF.graficointerativo.criaJanelaFlutuante(); |
500 | core_carregando("desativa"); | 509 | core_carregando("desativa"); |
admin/php/classe_metaestat.php
@@ -46,7 +46,7 @@ class Metaestat{ | @@ -46,7 +46,7 @@ class Metaestat{ | ||
46 | Cria um objeto Metaestat | 46 | Cria um objeto Metaestat |
47 | */ | 47 | */ |
48 | function __construct(){ | 48 | function __construct(){ |
49 | - error_reporting(E_ALL); | 49 | + error_reporting(0); |
50 | include(__DIR__."/conexao.php"); | 50 | include(__DIR__."/conexao.php"); |
51 | if(!isset($convUTF)){ | 51 | if(!isset($convUTF)){ |
52 | $convUTF = true; | 52 | $convUTF = true; |
@@ -189,7 +189,6 @@ class Metaestat{ | @@ -189,7 +189,6 @@ class Metaestat{ | ||
189 | $filtro = false; | 189 | $filtro = false; |
190 | $dados = $this->listaMedidaVariavel("",$id_medida_variavel); | 190 | $dados = $this->listaMedidaVariavel("",$id_medida_variavel); |
191 | $dadosgeo = $this->listaTipoRegiao($dados["codigo_tipo_regiao"]); | 191 | $dadosgeo = $this->listaTipoRegiao($dados["codigo_tipo_regiao"]); |
192 | - | ||
193 | if($todasascolunas == 0){ | 192 | if($todasascolunas == 0){ |
194 | $sql = " SELECT d.".$dados["colunavalor"].",d.".$dados["colunaidgeo"]; | 193 | $sql = " SELECT d.".$dados["colunavalor"].",d.".$dados["colunaidgeo"]; |
195 | $sqlgeo = $sql.",g.".$dadosgeo["colunageo"]; | 194 | $sqlgeo = $sql.",g.".$dadosgeo["colunageo"]; |
@@ -216,7 +215,7 @@ class Metaestat{ | @@ -216,7 +215,7 @@ class Metaestat{ | ||
216 | $sqlgeo = $dadosgeo["colunageo"]." from ($sqlgeo) as foo using unique ".$dados["colunaidgeo"]." using srid= ".$dadosgeo["srid"]; | 215 | $sqlgeo = $dadosgeo["colunageo"]." from ($sqlgeo) as foo using unique ".$dados["colunaidgeo"]." using srid= ".$dadosgeo["srid"]; |
217 | return array("sql"=>$sql,"sqlmapserver"=>$sqlgeo,"filtro"=>$filtro); | 216 | return array("sql"=>$sql,"sqlmapserver"=>$sqlgeo,"filtro"=>$filtro); |
218 | } | 217 | } |
219 | - function dadosMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0,$agruparpor = ""){ | 218 | + function dadosMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0){ |
220 | $sql = $this->sqlMedidaVariavel($id_medida_variavel,$todasascolunas); | 219 | $sql = $this->sqlMedidaVariavel($id_medida_variavel,$todasascolunas); |
221 | $sqlf = $sql["sql"]; | 220 | $sqlf = $sql["sql"]; |
222 | if($sql["filtro"] == true){ | 221 | if($sql["filtro"] == true){ |
@@ -240,20 +239,37 @@ class Metaestat{ | @@ -240,20 +239,37 @@ class Metaestat{ | ||
240 | } | 239 | } |
241 | return false; | 240 | return false; |
242 | } | 241 | } |
243 | - function sumarioMedidaVariavel($id_medida_variavel,$filtro=""){ | 242 | + function sumarioMedidaVariavel($id_medida_variavel,$filtro="",$agruparpor=""){ |
244 | $dados = $this->dadosMedidaVariavel($id_medida_variavel,$filtro,0); | 243 | $dados = $this->dadosMedidaVariavel($id_medida_variavel,$filtro,0); |
244 | + if(!empty($agruparpor)){ | ||
245 | + $dados = $this->dadosMedidaVariavel($id_medida_variavel,$filtro,1); | ||
246 | + } | ||
245 | if($dados){ | 247 | if($dados){ |
246 | $metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel); | 248 | $metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel); |
247 | $un = $this->listaUnidadeMedida($metaVariavel["codigo_unidade_medida"]); | 249 | $un = $this->listaUnidadeMedida($metaVariavel["codigo_unidade_medida"]); |
250 | + $agrupamento = ""; | ||
248 | foreach($dados as $d){ | 251 | foreach($dados as $d){ |
249 | $valores[] = $d[$metaVariavel["colunavalor"]]; | 252 | $valores[] = $d[$metaVariavel["colunavalor"]]; |
250 | } | 253 | } |
254 | + if(!empty($agruparpor)){ | ||
255 | + $agrupamento = array(); | ||
256 | + foreach($dados as $d){ | ||
257 | + $g = $d[$agruparpor]; | ||
258 | + //var_dump($d);exit; | ||
259 | + if(!empty($agrupamento[$g])){ | ||
260 | + $agrupamento[$g] += $d[$metaVariavel["colunavalor"]]; | ||
261 | + } | ||
262 | + else{ | ||
263 | + $agrupamento[$g] = $d[$metaVariavel["colunavalor"]]; | ||
264 | + } | ||
265 | + } | ||
266 | + natsort($agrupamento); | ||
267 | + } | ||
251 | $soma = ""; | 268 | $soma = ""; |
252 | $media = ""; | 269 | $media = ""; |
253 | $min = ""; | 270 | $min = ""; |
254 | $max = ""; | 271 | $max = ""; |
255 | $quantidade = count($valores); | 272 | $quantidade = count($valores); |
256 | - | ||
257 | if($un["permitesoma"] == "1"){ | 273 | if($un["permitesoma"] == "1"){ |
258 | $soma = array_sum($valores); | 274 | $soma = array_sum($valores); |
259 | } | 275 | } |
@@ -273,6 +289,7 @@ class Metaestat{ | @@ -273,6 +289,7 @@ class Metaestat{ | ||
273 | "maior"=>$max, | 289 | "maior"=>$max, |
274 | "quantidade"=>$quantidade, | 290 | "quantidade"=>$quantidade, |
275 | "histograma"=>$histograma, | 291 | "histograma"=>$histograma, |
292 | + "grupos"=>$agrupamento, | ||
276 | "unidademedida"=>$un | 293 | "unidademedida"=>$un |
277 | ); | 294 | ); |
278 | } | 295 | } |
admin/php/metaestat.php
@@ -52,9 +52,8 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ | @@ -52,9 +52,8 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ | ||
52 | } | 52 | } |
53 | } | 53 | } |
54 | */ | 54 | */ |
55 | -error_reporting(E_ALL); | ||
56 | include(__DIR__."/classe_metaestat.php"); | 55 | include(__DIR__."/classe_metaestat.php"); |
57 | - | 56 | +error_reporting(0); |
58 | //faz a busca da função que deve ser executada | 57 | //faz a busca da função que deve ser executada |
59 | switch (strtoupper($funcao)) | 58 | switch (strtoupper($funcao)) |
60 | { | 59 | { |
temas/testegdal.map
1 | MAP | 1 | MAP |
2 | - FONTSET "/var/www/i3geo/symbols/fontes.txt" | ||
3 | - SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" | 2 | + # FONTSET "/var/www/i3geo/symbols/fontes.txt" |
3 | + # SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" | ||
4 | + FONTSET "c:\ms4w\apache\htdocs\i3geo\symbols\fontes.txt" | ||
5 | + SYMBOLSET "c:\ms4w\apache\htdocs\i3geo\symbols\simbolos.sym" | ||
6 | + | ||
4 | LAYER | 7 | LAYER |
5 | NAME testegdal | 8 | NAME testegdal |
6 | - DATA "/var/www/i3geo/temas/gdalsrtm.xml" | 9 | + DATA "c:\ms4w\apache\htdocs\i3geo\temas\gdalsrtm.xml" |
7 | OFFSITE 255 255 255 | 10 | OFFSITE 255 255 255 |
8 | PROJECTION | 11 | PROJECTION |
9 | "proj=latlong" | 12 | "proj=latlong" |