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 | 451 | callback = { |
452 | 452 | success: function(oResponse){ |
453 | 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 | 458 | //converte os dados para o padrao usado no grafico |
456 | 459 | abreDados = function(){ |
457 | 460 | i3GEOF.graficointerativo.dados = dados; |
... | ... | @@ -494,7 +497,13 @@ function sql(tipo,id) { |
494 | 497 | i++; |
495 | 498 | } |
496 | 499 | ins.push("</table><br>"); |
500 | + //ins.push("<input type=hidden id=i3GEOgraficointerativoComboXid />"); | |
501 | + //ins.push("<input type=hidden id=i3GEOgraficointerativoComboYid />"); | |
497 | 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 | 508 | i3GEOF.graficointerativo.criaJanelaFlutuante(); |
500 | 509 | core_carregando("desativa"); | ... | ... |
admin/php/classe_metaestat.php
... | ... | @@ -46,7 +46,7 @@ class Metaestat{ |
46 | 46 | Cria um objeto Metaestat |
47 | 47 | */ |
48 | 48 | function __construct(){ |
49 | - error_reporting(E_ALL); | |
49 | + error_reporting(0); | |
50 | 50 | include(__DIR__."/conexao.php"); |
51 | 51 | if(!isset($convUTF)){ |
52 | 52 | $convUTF = true; |
... | ... | @@ -189,7 +189,6 @@ class Metaestat{ |
189 | 189 | $filtro = false; |
190 | 190 | $dados = $this->listaMedidaVariavel("",$id_medida_variavel); |
191 | 191 | $dadosgeo = $this->listaTipoRegiao($dados["codigo_tipo_regiao"]); |
192 | - | |
193 | 192 | if($todasascolunas == 0){ |
194 | 193 | $sql = " SELECT d.".$dados["colunavalor"].",d.".$dados["colunaidgeo"]; |
195 | 194 | $sqlgeo = $sql.",g.".$dadosgeo["colunageo"]; |
... | ... | @@ -216,7 +215,7 @@ class Metaestat{ |
216 | 215 | $sqlgeo = $dadosgeo["colunageo"]." from ($sqlgeo) as foo using unique ".$dados["colunaidgeo"]." using srid= ".$dadosgeo["srid"]; |
217 | 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 | 219 | $sql = $this->sqlMedidaVariavel($id_medida_variavel,$todasascolunas); |
221 | 220 | $sqlf = $sql["sql"]; |
222 | 221 | if($sql["filtro"] == true){ |
... | ... | @@ -240,20 +239,37 @@ class Metaestat{ |
240 | 239 | } |
241 | 240 | return false; |
242 | 241 | } |
243 | - function sumarioMedidaVariavel($id_medida_variavel,$filtro=""){ | |
242 | + function sumarioMedidaVariavel($id_medida_variavel,$filtro="",$agruparpor=""){ | |
244 | 243 | $dados = $this->dadosMedidaVariavel($id_medida_variavel,$filtro,0); |
244 | + if(!empty($agruparpor)){ | |
245 | + $dados = $this->dadosMedidaVariavel($id_medida_variavel,$filtro,1); | |
246 | + } | |
245 | 247 | if($dados){ |
246 | 248 | $metaVariavel = $this->listaMedidaVariavel("",$id_medida_variavel); |
247 | 249 | $un = $this->listaUnidadeMedida($metaVariavel["codigo_unidade_medida"]); |
250 | + $agrupamento = ""; | |
248 | 251 | foreach($dados as $d){ |
249 | 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 | 268 | $soma = ""; |
252 | 269 | $media = ""; |
253 | 270 | $min = ""; |
254 | 271 | $max = ""; |
255 | 272 | $quantidade = count($valores); |
256 | - | |
257 | 273 | if($un["permitesoma"] == "1"){ |
258 | 274 | $soma = array_sum($valores); |
259 | 275 | } |
... | ... | @@ -273,6 +289,7 @@ class Metaestat{ |
273 | 289 | "maior"=>$max, |
274 | 290 | "quantidade"=>$quantidade, |
275 | 291 | "histograma"=>$histograma, |
292 | + "grupos"=>$agrupamento, | |
276 | 293 | "unidademedida"=>$un |
277 | 294 | ); |
278 | 295 | } | ... | ... |
admin/php/metaestat.php
... | ... | @@ -52,9 +52,8 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
52 | 52 | } |
53 | 53 | } |
54 | 54 | */ |
55 | -error_reporting(E_ALL); | |
56 | 55 | include(__DIR__."/classe_metaestat.php"); |
57 | - | |
56 | +error_reporting(0); | |
58 | 57 | //faz a busca da função que deve ser executada |
59 | 58 | switch (strtoupper($funcao)) |
60 | 59 | { | ... | ... |
temas/testegdal.map
1 | 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 | 7 | LAYER |
5 | 8 | NAME testegdal |
6 | - DATA "/var/www/i3geo/temas/gdalsrtm.xml" | |
9 | + DATA "c:\ms4w\apache\htdocs\i3geo\temas\gdalsrtm.xml" | |
7 | 10 | OFFSITE 255 255 255 |
8 | 11 | PROJECTION |
9 | 12 | "proj=latlong" | ... | ... |