From 1057f2b452b6d7b34f072d117c30a9477e1434ed Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 16 Aug 2012 20:40:01 +0000 Subject: [PATCH] --- admin/admin.db | Bin 131072 -> 0 bytes admin/js/estat_variavel.js | 94 ++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- admin/php/classe_metaestat.php | 48 ++++++++++++++++++++++++------------------------ admin/php/metaestat.php | 34 +++++++++++++++++----------------- admin/sql/metaestat.sql | 84 ++++++++++++++++++++++++++++++++++++++++++------------------------------------------ admin/sql/metaestat_basededados.sql | 8 ++++---- documentacao/diagramas/metaestat.erm | 1830 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pacotes/tme/TME_Engine.php | 2 +- 8 files changed, 1133 insertions(+), 967 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 3abe881..11483d7 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/js/estat_variavel.js b/admin/js/estat_variavel.js index 1505b51..70b2f28 100755 --- a/admin/js/estat_variavel.js +++ b/admin/js/estat_variavel.js @@ -164,11 +164,11 @@ function adicionaNosMedidas(no,dados,redesenha) {currentIconMode = newVal;} } function loadNodeData(node, fnLoadComplete){ - var sUrl = "../php/metaestat.php?funcao=listaDimensao&id_medida_variavel="+node.data.no_dimensoes, + var sUrl = "../php/metaestat.php?funcao=listaParametro&id_medida_variavel="+node.data.no_parametros, callback = { success: function(oResponse){ var dados = YAHOO.lang.JSON.parse(oResponse.responseText); - adicionaNosDimensao(node,dados,false); + adicionaNosParametro(node,dados,false); oResponse.argument.fnLoadComplete(); }, failure: function(oResponse){ @@ -264,8 +264,8 @@ function adicionaNosMedidas(no,dados,redesenha) tempNode1 = new YAHOO.widget.HTMLNode(d, no, false,true); tempNode1.isLeaf = false; //tempNode1.setDynamicLoad(temp, 1); - conteudo = " Dimensões"; - d = {html:conteudo,no_dimensoes:dados[i].id_medida_variavel}; + conteudo = " Parâmetros"; + d = {html:conteudo,no_parametros:dados[i].id_medida_variavel}; tempNode2 = new YAHOO.widget.HTMLNode(d, tempNode1, false,true); tempNode2.isLeaf = false; tempNode2.setDynamicLoad(loadNodeData, 1); @@ -289,11 +289,11 @@ function adicionaNosMedidas(no,dados,redesenha) if(redesenha){tree.draw();} } /* -Function: adicionaNosDimensao +Function: adicionaNosParametro -Mostra os nós de uma dimensao +Mostra os nós de uma parametro */ -function adicionaNosDimensao(no,dados,redesenha){ +function adicionaNosParametro(no,dados,redesenha){ var tempNode,i,j,conteudo,d; function temaIconMode() { var newVal = parseInt(this.value); @@ -303,7 +303,7 @@ function adicionaNosDimensao(no,dados,redesenha){ if(!redesenha) { tempNode = new YAHOO.widget.HTMLNode( { - html:"Adicionar nova dimensão" + html:"Adicionar novo parâmetro" }, no, false, @@ -312,13 +312,13 @@ function adicionaNosDimensao(no,dados,redesenha){ tempNode.isLeaf = true; } for (i=0, j=dados.length; i"; - conteudo += " "; - if(dados[i].nomedimensao != "") - {conteudo += " "+dados[i].nomedimensao+" - "+dados[i].descricao+" id: "+dados[i].id_dimensao_medida+"";} + conteudo = " "; + conteudo += " "; + if(dados[i].nome != "") + {conteudo += " "+dados[i].nome+" - "+dados[i].descricao+" id: "+dados[i].id_parametro_medida+"";} else {conteudo += " Edite para definir a nova medida!!!";} - d = {html:conteudo,id_dimensao_medida:dados[i].id_dimensao_medida,tipo:"dimensao"}; + d = {html:conteudo,id_parametro_medida:dados[i].id_parametro_medida,tipo:"parametro"}; tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); tempNode.isLeaf = true; } @@ -327,7 +327,7 @@ function adicionaNosDimensao(no,dados,redesenha){ /* Function: adicionaNosClassificacao -Mostra os nós de uma dimensao +Mostra os nós de um parametro */ function adicionaNosClassificacao(no,dados,redesenha){ var tempNode,i,j,conteudo,d; @@ -369,7 +369,7 @@ function adicionaNosClassificacao(no,dados,redesenha){ for (i=0, j=dados.length; i"; conteudo += " "; - if(dados[i].nomedimensao != "") + if(dados[i].nome != "") {conteudo += " "+dados[i].nome+" Obs.: "+dados[i].observacao+" id: "+dados[i].id_classificacao+"";} else {conteudo += " Edite para definir a nova classificação!!!";} @@ -406,7 +406,7 @@ function adicionaNosClasses(no,dados,redesenha){ for (i=0, j=dados.length; i"; conteudo += " "; - if(dados[i].nomedimensao != "") + if(dados[i].nome != "") {conteudo += " "+dados[i].titulo+" id: "+dados[i].id_classe+"";} else {conteudo += " Edite para definir a nova classe!!!";} @@ -558,25 +558,19 @@ function montaDivMedidaVariavel(i){ $i("Ccodigo_estat_conexao").innerHTML = temp; } } -function montaDivDimensaoMedida(i){ +function montaDivParametroMedida(i){ var temp,ins = "", param = { "linhas":[ - {titulo:"Nome:",id:"Enomedimensao",size:"50",value:i.nomedimensao,tipo:"text",div:""}, + {titulo:"Nome:",id:"Enome",size:"50",value:i.nome,tipo:"text",div:""}, {titulo:"Descrição:",id:"Edescricao",size:"50",value:i.descricao,tipo:"text",div:""}, {titulo:"Coluna:",id:"Ecoluna",size:"50",value:i.coluna,tipo:"text",div:""}, - {titulo:"Agrega valores:",id:"",size:"50",value:i.agregavalores,tipo:"text",div:"
"} + {titulo:"id_pai:",id:"Eid_pai",size:"50",value:i.id_pai,tipo:"text",div:""} ] }; ins += core_geraLinhas(param); ins += "


"; $i("editor_bd").innerHTML = ins; - if($i("Cagregavalores")){ - temp = ""; - $i("Cagregavalores").innerHTML = temp; - } } function montaDivClassificacaoMedida(i){ var ins = "", @@ -653,20 +647,20 @@ function adicionarMedidaVariavel(codigo_variavel){ core_makeRequest(sUrl,callback); } /* -Function: adicionarDimensaoMedida +Function: adicionarParametroMedida -Adiciona uma nova dimensao a uma medida de variavel +Adiciona uma nova parametro a uma medida de variavel - + */ -function adicionarDimensaoMedida(id_medida_variavel){ +function adicionarParametroMedida(id_medida_variavel){ var no = tree.getNodeByProperty("id_medida_variavel",id_medida_variavel), - sUrl = "../php/metaestat.php?funcao=alteraDimensaoMedida&id_medida_variavel="+id_medida_variavel, + sUrl = "../php/metaestat.php?funcao=alteraParametroMedida&id_medida_variavel="+id_medida_variavel, callback = { success: function(oResponse){ var dados = YAHOO.lang.JSON.parse(oResponse.responseText); - adicionaNosDimensao(no,[dados],true); - editar('dimensaoMedida',dados.id_dimensao_medida); + adicionaNosParametro(no,[dados],true); + editar('parametroMedida',dados.id_parametro_medida); }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } @@ -762,10 +756,10 @@ function editar(tipo,id) { core_montaEditor("gravaDados('medidaVariavel','"+id+"')","450px","200px","","Editor de medidas"); montaDivMedidaVariavel(dados); } - if(tipo == "dimensaoMedida"){ + if(tipo == "parametroMedida"){ dados = YAHOO.lang.JSON.parse(o.responseText); - core_montaEditor("gravaDados('dimensaoMedida','"+id+"')","450px","200px","","Editor de dimens&oatilde;es"); - montaDivDimensaoMedida(dados); + core_montaEditor("gravaDados('parametroMedida','"+id+"')","450px","200px","","Editor de parâmetros"); + montaDivParametroMedida(dados); } if(tipo == "classificacaoMedida"){ dados = YAHOO.lang.JSON.parse(o.responseText); @@ -795,8 +789,8 @@ function editar(tipo,id) { if(tipo == "medidaVariavel"){ sUrl = "../php/metaestat.php?funcao=listaMedidaVariavel&id_medida_variavel="+id; } - if(tipo == "dimensaoMedida"){ - sUrl = "../php/metaestat.php?funcao=listaDimensao&id_dimensao_medida="+id; + if(tipo == "parametroMedida"){ + sUrl = "../php/metaestat.php?funcao=listaParametro&id_parametro_medida="+id; } if(tipo == "classificacaoMedida"){ sUrl = "../php/metaestat.php?funcao=listaClassificacaoMedida&id_classificacao="+id; @@ -1008,7 +1002,7 @@ function sql(tipo,id) { core_makeRequest(sUrl,callback); }; } - if(tipo == "dimensaoMedida"){ + if(tipo == "parametroMedida"){ } core_carregando("desativa"); @@ -1021,8 +1015,8 @@ function sql(tipo,id) { if(tipo == "medidaVariavel"){ sUrl = "../php/metaestat.php?funcao=sqlMedidaVariavel&id_medida_variavel="+id; } - if(tipo == "dimensaoMedida"){ - sUrl = "../php/metaestat.php?funcao=listaDimensao&id_dimensao_medida="+id; + if(tipo == "parametroMedida"){ + sUrl = "../php/metaestat.php?funcao=listaParametro&id_parametro_medida="+id; } if(sUrl){ core_makeRequest(sUrl,callback); @@ -1046,9 +1040,9 @@ function excluir(tipo,id){ no = tree.getNodeByProperty("id_medida_variavel",id); sUrl = "../php/metaestat.php?funcao=excluirMedidaVariavel&id_medida_variavel="+id; } - if(tipo == "dimensaoMedida") { - no = tree.getNodeByProperty("id_dimensao_medida",id); - sUrl = "../php/metaestat.php?funcao=excluirDimensaoMedida&id_dimensao_medida="+id; + if(tipo == "parametroMedida") { + no = tree.getNodeByProperty("id_parametro_medida",id); + sUrl = "../php/metaestat.php?funcao=excluirParametroMedida&id_parametro_medida="+id; } if(tipo == "classificacaoMedida") { no = tree.getNodeByProperty("id_classificacao",id); @@ -1094,10 +1088,10 @@ function gravaDados(tipo,id){ par = "&id_medida_variavel="+id; prog = "../php/metaestat.php?funcao=alteraMedidaVariavel"; } - if(tipo == "dimensaoMedida"){ - campos = new Array("nomedimensao","descricao","coluna","agregavalores"); - par = "&id_dimensao_medida="+id; - prog = "../php/metaestat.php?funcao=alteraDimensaoMedida"; + if(tipo == "parametroMedida"){ + campos = new Array("nome","descricao","coluna","id_pai"); + par = "&id_parametro_medida="+id; + prog = "../php/metaestat.php?funcao=alteraParametroMedida"; } if(tipo == "classificacaoMedida"){ campos = new Array("nome","observacao"); @@ -1143,9 +1137,9 @@ function gravaDados(tipo,id){ no.getContentEl().getElementsByTagName("span")[0].style.color = ""; no.html = no.getContentEl().innerHTML; } - if(tipo == "dimensaoMedida"){ - no = tree.getNodeByProperty("id_dimensao_medida",id); - no.getContentEl().getElementsByTagName("span")[0].innerHTML = ""+document.getElementById("Enomedimensao").value+" - "+document.getElementById("Edescricao").value+" id: "+id+""; + if(tipo == "parametroMedida"){ + no = tree.getNodeByProperty("id_parametro_medida",id); + no.getContentEl().getElementsByTagName("span")[0].innerHTML = ""+document.getElementById("Enome").value+" - "+document.getElementById("Edescricao").value+" id: "+id+""; no.getContentEl().getElementsByTagName("span")[0].style.color = ""; no.html = no.getContentEl().innerHTML; } diff --git a/admin/php/classe_metaestat.php b/admin/php/classe_metaestat.php index ff8aac1..17f5588 100755 --- a/admin/php/classe_metaestat.php +++ b/admin/php/classe_metaestat.php @@ -671,25 +671,25 @@ class Metaestat{ } } /* - Function: alteraDimensaoMedida + Function: alteraParametroMedida - Altera uma dimensao de uma medida ou cria uma nova + Altera uma parametro de uma medida ou cria uma nova */ - function alteraDimensaoMedida($id_medida_variavel,$id_dimensao_medida="",$nomedimensao,$descricao,$coluna,$agregavalores){ + function alteraParametroMedida($id_medida_variavel,$id_parametro_medida="",$nome,$descricao,$coluna,$id_pai){ try { - if($id_dimensao_medida != ""){ + if($id_parametro_medida != ""){ if($this->convUTF){ - $nomedimensao = utf8_encode($nomedimensao); + $nomeparametro = utf8_encode($nomeparametro); $descricao = utf8_encode($descricao); } - //echo "UPDATE ".$this->esquemaadmin."i3geoestat_dimensao_medida SET nomedimensao = '$nomedimensao',descricao = '$descricao',coluna = '$coluna',agregavalores = '$agregavalores' WHERE id_dimensao_medida = $id_dimensao_medida";exit; - $this->dbhw->query("UPDATE ".$this->esquemaadmin."i3geoestat_dimensao_medida SET nomedimensao = '$nomedimensao',descricao = '$descricao',coluna = '$coluna',agregavalores = '$agregavalores' WHERE id_dimensao_medida = $id_dimensao_medida"); - $retorna = $id_dimensao_medida; + //echo "UPDATE ".$this->esquemaadmin."i3geoestat_parametro_medida SET nomeparametro = '$nomeparametro',descricao = '$descricao',coluna = '$coluna',agregavalores = '$agregavalores' WHERE id_parametro_medida = $id_parametro_medida";exit; + $this->dbhw->query("UPDATE ".$this->esquemaadmin."i3geoestat_parametro_medida SET nome = '$nome',descricao = '$descricao',coluna = '$coluna',id_pai = '$id_pai' WHERE id_parametro_medida = $id_parametro_medida"); + $retorna = $id_parametro_medida; } else{ - $retorna = $this->insertId("i3geoestat_dimensao_medida","nomedimensao","id_dimensao_medida"); + $retorna = $this->insertId("i3geoestat_parametro_medida","nome","id_parametro_medida"); if($retorna){ - $this->dbhw->query("UPDATE ".$this->esquemaadmin."i3geoestat_dimensao_medida SET id_medida_variavel = $id_medida_variavel WHERE id_dimensao_medida = $retorna"); + $this->dbhw->query("UPDATE ".$this->esquemaadmin."i3geoestat_parametro_medida SET id_medida_variavel = $id_medida_variavel WHERE id_parametro_medida = $retorna"); } } return $retorna; @@ -699,9 +699,9 @@ class Metaestat{ } } /* - Function: alteraDimensaoMedida + Function: alteraParametroMedida - Altera uma dimensao de uma medida ou cria uma nova + Altera uma parametro de uma medida ou cria uma nova */ function alteraClassificacaoMedida($id_medida_variavel,$id_classificacao="",$nome="",$observacao=""){ try { @@ -711,7 +711,7 @@ class Metaestat{ $observacao = utf8_encode($observacao); } $this->dbhw->query("UPDATE ".$this->esquemaadmin."i3geoestat_classificacao SET observacao = '$observacao',nome = '$nome' WHERE id_classificacao = $id_classificacao"); - $retorna = $id_dimensao_medida; + $retorna = $id_parametro_medida; } else{ $retorna = $this->insertId("i3geoestat_classificacao","nome","id_classificacao"); @@ -918,7 +918,7 @@ class Metaestat{ return $this->execSQL($sql,$codigo_estat_conexao); } /* - Function: listaDimensao + Function: listaParametro Lista as variaveis cadastradas ou uma unica variavel @@ -926,24 +926,24 @@ class Metaestat{ $id_medida_variavel - $id_dimensao_variavel - opcional + $id_parametro_variavel - opcional */ - function listaDimensao($id_medida_variavel,$id_dimensao_medida=""){ - $sql = "SELECT i3geoestat_dimensao_medida.* "; - $sql .= "FROM ".$this->esquemaadmin."i3geoestat_dimensao_medida "; + function listaParametro($id_medida_variavel,$id_parametro_medida=""){ + $sql = "SELECT i3geoestat_parametro_medida.* "; + $sql .= "FROM ".$this->esquemaadmin."i3geoestat_parametro_medida "; $sql .= "INNER JOIN ".$this->esquemaadmin."i3geoestat_medida_variavel "; - $sql .= "ON i3geoestat_dimensao_medida.id_medida_variavel = i3geoestat_medida_variavel.id_medida_variavel "; + $sql .= "ON i3geoestat_parametro_medida.id_medida_variavel = i3geoestat_medida_variavel.id_medida_variavel "; if($id_medida_variavel != ""){ - $sql .= "WHERE i3geoestat_dimensao_medida.id_medida_variavel = $id_medida_variavel "; - if($id_dimensao_medida != ""){ - $sql .= "AND i3geoestat_dimensao_medida.id_dimensao_medida = $id_dimensao_medida "; + $sql .= "WHERE i3geoestat_parametro_medida.id_medida_variavel = $id_medida_variavel "; + if($id_parametro_medida != ""){ + $sql .= "AND i3geoestat_parametro_medida.id_parametro_medida = $id_parametro_medida "; } } else{ - $sql .= "WHERE i3geoestat_dimensao_medida.id_dimensao_medida = $id_dimensao_medida "; + $sql .= "WHERE i3geoestat_parametro_medida.id_parametro_medida = $id_parametro_medida "; } //echo $sql;exit; - return $this->execSQL($sql,$id_dimensao_medida); + return $this->execSQL($sql,$id_parametro_medida); } /* diff --git a/admin/php/metaestat.php b/admin/php/metaestat.php index 2470197..caf55e3 100644 --- a/admin/php/metaestat.php +++ b/admin/php/metaestat.php @@ -138,17 +138,17 @@ switch (strtoupper($funcao)) exit; break; /* - Valor: LISTADIMENSAO + Valor: LISTAPARAMETRO - Lista de dimensoes + Lista de parametros Retorno: {JSON} */ - case "LISTADIMENSAO": + case "LISTAPARAMETRO": $m = new Metaestat(); - retornaJSON($m->listaDimensao($id_medida_variavel,$id_dimensao_medida)); + retornaJSON($m->listaParametro($id_medida_variavel,$id_parametro_medida)); exit; break; /* @@ -244,23 +244,23 @@ switch (strtoupper($funcao)) exit; break; /* - Valor: ALTERADIMENSAOMEDIDA + Valor: ALTERAPARAMETROMEDIDA - Altera os dados de uma dimensao de uma medida + Altera os dados de uma parametro de uma medida Retorno: {JSON} */ - case "ALTERADIMENSAOMEDIDA": + case "ALTERAPARAMETROMEDIDA": $m = new Metaestat(); - if(empty($id_dimensao_medida)){ - $id_dimensao_medida = $m->alteraDimensaoMedida($id_medida_variavel); + if(empty($id_parametro_medida)){ + $id_parametro_medida = $m->alteraParametroMedida($id_medida_variavel); } else{ - $m->alteraDimensaoMedida("",$id_dimensao_medida,$nomedimensao,$descricao,$coluna,$agregavalores); + $m->alteraParametroMedida("",$id_parametro_medida,$nome,$descricao,$coluna,$id_pai); } - retornaJSON($m->listaDimensao($id_medida_variavel,$id_dimensao_medida)); + retornaJSON($m->listaParametro($id_medida_variavel,$id_parametro_medida)); exit; break; /* @@ -570,21 +570,21 @@ switch (strtoupper($funcao)) exit; break; /* - Valor: EXCLUIRDIMENSAOMEDIDA + Valor: EXCLUIRPARAMETROMEDIDA Exclui uma medida da variavel Parametros: - id_dimensao_medida + id_parametro_medida Retorno: {JSON} */ - case "EXCLUIRDIMENSAOMEDIDA": + case "EXCLUIRPARAMETROMEDIDA": $m = new Metaestat(); - retornaJSON($m->excluirRegistro("i3geoestat_dimensao_medida","id_dimensao_medida",$id_dimensao_medida)); + retornaJSON($m->excluirRegistro("i3geoestat_parametro_medida","id_parametro_medida",$id_parametro_medida)); exit; break; /* @@ -594,7 +594,7 @@ switch (strtoupper($funcao)) Parametros: - id_dimensao_medida + id_classificacao Retorno: @@ -767,7 +767,7 @@ switch (strtoupper($funcao)) 'dirtmp' => $dir_tmp, 'barSize'=> 5000 ); - + include (__DIR__."/../../pacotes/tme/TME_i3geo.php"); } exit; diff --git a/admin/sql/metaestat.sql b/admin/sql/metaestat.sql index 33fdee4..ddc4a03 100644 --- a/admin/sql/metaestat.sql +++ b/admin/sql/metaestat.sql @@ -3,9 +3,9 @@ drop table i3geoestat_classes; drop table i3geoestat_classificacao; -drop table i3geoestat_dimensao_medida; drop table i3geoestat_fonteinfo_medida; drop table i3geoestat_medida_variavel_link; +drop table i3geoestat_parametro_medida; drop table i3geoestat_medida_variavel; drop table i3geoestat_tipo_regiao; drop table i3geoestat_conexao; @@ -15,10 +15,22 @@ drop table i3geoestat_unidade_medida; drop table i3geoestat_variavel; - + /* create tables */ +create table i3geoestat_unidade_medida +( + codigo_unidade_medida integer not null unique primary key autoincrement, + nome text, + sigla text, + -- o tipo de unidade permite que os valores sejam somados? (0 ou 1) + permitesoma integer default 0, + -- o tipo de unidade permite o cálculo de média aritmética? (0 ou 1) + permitemedia integer default 0 +); + + -- lista controlada dos parâmetros de conexão com o banco de dados onde residem dados create table i3geoestat_conexao ( @@ -64,15 +76,12 @@ create table i3geoestat_tipo_regiao ); -create table i3geoestat_unidade_medida +-- lista controlada de tipos de período de tempo +create table i3geoestat_tipo_periodo ( - codigo_unidade_medida integer not null unique primary key autoincrement, + codigo_tipo_periodo integer not null unique primary key autoincrement, nome text, - sigla text, - -- o tipo de unidade permite que os valores sejam somados? (0 ou 1) - permitesoma integer default 0, - -- o tipo de unidade permite o cálculo de média aritmética? (0 ou 1) - permitemedia integer default 0 + descricao text ); @@ -85,15 +94,6 @@ create table i3geoestat_variavel ); --- lista controlada de tipos de período de tempo -create table i3geoestat_tipo_periodo -( - codigo_tipo_periodo integer not null unique primary key autoincrement, - nome text, - descricao text -); - - -- descreve as colunas que contém valores de algum tipo de medida, por exemplo população residente create table i3geoestat_medida_variavel ( @@ -115,16 +115,16 @@ create table i3geoestat_medida_variavel filtro text, -- titulo da medida nomemedida text, - foreign key (codigo_tipo_regiao) - references i3geoestat_tipo_regiao (codigo_tipo_regiao), foreign key (codigo_unidade_medida) references i3geoestat_unidade_medida (codigo_unidade_medida), - foreign key (codigo_variavel) - references i3geoestat_variavel (codigo_variavel), + foreign key (codigo_tipo_regiao) + references i3geoestat_tipo_regiao (codigo_tipo_regiao), + foreign key (codigo_tipo_periodo) + references i3geoestat_tipo_periodo (codigo_tipo_periodo), foreign key (codigo_estat_conexao) references i3geoestat_conexao (codigo_estat_conexao), - foreign key (codigo_tipo_periodo) - references i3geoestat_tipo_periodo (codigo_tipo_periodo) + foreign key (codigo_variavel) + references i3geoestat_variavel (codigo_variavel) ); @@ -173,20 +173,6 @@ create table i3geoestat_classes ); -create table i3geoestat_dimensao_medida -( - id_dimensao_medida integer not null unique primary key autoincrement, - coluna text, - nomedimensao text, - descricao text, - -- (0 ou 1) indica se a coluna de valores da variável deve ser agregada ou não (soma dos valores ou média) conforme o tipo de unidade de medida - agregavalores integer default 0, - id_medida_variavel integer, - foreign key (id_medida_variavel) - references i3geoestat_medida_variavel (id_medida_variavel) -); - - create table i3geoestat_fonteinfo ( id_fonteinfo integer not null unique primary key autoincrement, @@ -200,10 +186,10 @@ create table i3geoestat_fonteinfo_medida ( id_medida_variavel integer not null, id_fonteinfo integer not null, - foreign key (id_medida_variavel) - references i3geoestat_medida_variavel (id_medida_variavel), foreign key (id_fonteinfo) - references i3geoestat_fonteinfo (id_fonteinfo) + references i3geoestat_fonteinfo (id_fonteinfo), + foreign key (id_medida_variavel) + references i3geoestat_medida_variavel (id_medida_variavel) ); @@ -218,4 +204,18 @@ create table i3geoestat_medida_variavel_link ); - +create table i3geoestat_parametro_medida +( + id_parametro_medida integer not null unique primary key autoincrement, + coluna text, + nome text, + descricao text, + -- (0 ou 1) indica se a coluna de valores da variável deve ser agregada ou não (soma dos valores ou média) conforme o tipo de unidade de medida + id_pai integer default 0, + id_medida_variavel integer, + foreign key (id_medida_variavel) + references i3geoestat_medida_variavel (id_medida_variavel) +); + + + diff --git a/admin/sql/metaestat_basededados.sql b/admin/sql/metaestat_basededados.sql index 0be3969..96f81c6 100644 --- a/admin/sql/metaestat_basededados.sql +++ b/admin/sql/metaestat_basededados.sql @@ -19,9 +19,9 @@ INSERT INTO i3geoestat_unidade_medida (codigo_unidade_medida, nome, sigla, permi INSERT INTO i3geoestat_medida_variavel (id_medida_variavel, codigo_unidade_medida, codigo_tipo_periodo, codigo_variavel, codigo_tipo_regiao, codigo_estat_conexao, esquemadb, tabela, colunavalor, colunaidgeo, filtro, nomemedida) VALUES ('1', '1', '2', '1', '1', '1', 'dbacoes_saude', 'tb_farmacia_pop', 'nu_farm_funcionando', 'co_ibge', '', 'Número de farmácias em funcionamento por mês e ano'); --- i3geoestat_dimensao_medida -INSERT INTO i3geoestat_dimensao_medida (id_dimensao_medida, coluna, nomedimensao, descricao, agregavalores, id_medida_variavel) VALUES ('1', "to_date(mes_farm_pop||' '||ano_farm,'MM YYYY') as mes", 'mês e ano', '', '0', '1'); -INSERT INTO i3geoestat_dimensao_medida (id_dimensao_medida, coluna, nomedimensao, descricao, agregavalores, id_medida_variavel) VALUES ('2', 'ano_farm', 'ano', '', '1', '1'); +-- i3geoestat_parametro_medida +INSERT INTO i3geoestat_parametro_medida (id_parametro_medida, coluna, nome, descricao, id_pai, id_medida_variavel) VALUES ('1', 'mes_farm_pop', 'mês', '', '2', '1'); +INSERT INTO i3geoestat_parametro_medida (id_parametro_medida, coluna, nome, descricao, id_pai, id_medida_variavel) VALUES ('2', 'ano_farm', 'ano', '', '0', '1'); -- i3geoestat_variavel @@ -42,7 +42,7 @@ INSERT INTO i3geoestat_classes (id_classe, expressao, titulo, vermelho, verde, a INSERT INTO i3geoestat_medida_variavel_link (link, id_medida_variavel, nome, id_link) VALUES ('http://portal.saude.gov.br/portal/saude/area.cfm?id_area=1095', '1', 'Site das Fármacias Populares', '1'); --- i3geoestat_fontinfo_medida +-- i3geoestat_fonteinfo_medida INSERT INTO i3geoestat_fonteinfo_medida (id_medida_variavel, id_fonteinfo) VALUES ('1', '1'); diff --git a/documentacao/diagramas/metaestat.erm b/documentacao/diagramas/metaestat.erm index d406b3d..4bd1c54 100644 --- a/documentacao/diagramas/metaestat.erm +++ b/documentacao/diagramas/metaestat.erm @@ -11,12 +11,12 @@ 0 1.0 - 193 - 17 + 155 + 111 - 144 - 238 - 144 + 255 + 128 + 255 255 @@ -41,7 +41,7 @@ false All - /var/www/i3geo/admin/sql/metaestat.sql + C:\ms4w\Apache\htdocs\i3geo\admin\sql\metaestat.sql @@ -78,7 +78,7 @@ ISO-8859-1 - /var/www/i3geo/admin/sql + C:\ms4w\Apache\htdocs\i3geo\admin\sql 0 @@ -97,7 +97,7 @@ -1 -1 - Ubuntu + Segoe UI 9 50 50 @@ -110,7 +110,7 @@ false 2012-07-17 15:03:53 - 2012-08-15 01:02:44 + 2012-08-16 11:27:59 Project Name @@ -151,26 +151,13 @@ null false - (0 ou 1) indica se a coluna de valores da variável deve ser agregada ou não (soma dos valores ou média) conforme o tipo de unidade de medida - agregavalores - agregavalores - integer - - - 1 - null - null - false - null - false - componente B da cor utilizada para representar a classe azul azul text - 2 + 1 null null false @@ -183,7 +170,7 @@ text - 3 + 2 null null false @@ -196,7 +183,7 @@ integer - 4 + 3 null null false @@ -209,7 +196,7 @@ integer - 5 + 4 null null false @@ -222,6 +209,19 @@ integer + 5 + null + null + false + null + false + + + codigo_tipo_regiao_pai + codigo_tipo_regiao_pai + integer + + 6 null null @@ -307,13 +307,26 @@ null false + Coluna na tabela filho que liga com a coluna de identificadores da coluna pai + colunaligacao_regiaopai + colunaligacao_regiaopai + text + + + 13 + null + null + false + null + false + Coluna que contém o nome de cada região ou local colunanomeregiao colunanomeregiao text - 13 + 14 null null false @@ -326,7 +339,7 @@ text - 14 + 15 null null false @@ -339,7 +352,7 @@ text - 15 + 16 null null false @@ -352,7 +365,7 @@ text - 16 + 17 null null false @@ -365,7 +378,7 @@ text - 17 + 18 null null false @@ -378,7 +391,7 @@ text - 18 + 19 null null false @@ -391,7 +404,7 @@ text - 19 + 20 null null false @@ -404,7 +417,7 @@ text - 20 + 21 null null false @@ -417,7 +430,7 @@ text - 21 + 22 null null false @@ -430,7 +443,7 @@ text - 22 + 23 null null false @@ -443,7 +456,7 @@ text - 23 + 24 null null false @@ -456,7 +469,7 @@ text - 24 + 25 null null false @@ -469,7 +482,7 @@ integer - 25 + 26 null null false @@ -477,12 +490,12 @@ false - id_classe - id_classe + id_agregaregiao + id_agregaregiao integer - 26 + 27 null null false @@ -490,12 +503,12 @@ false - id_classificacao - id_classificacao + id_classe + id_classe integer - 27 + 28 null null false @@ -503,12 +516,12 @@ false - id_dimensao_medida - id_dimensao_medida + id_classificacao + id_classificacao integer - 28 + 29 null null false @@ -521,7 +534,7 @@ integer - 29 + 30 null null false @@ -534,7 +547,7 @@ integer - 30 + 31 null null false @@ -547,7 +560,33 @@ integer - 31 + 32 + null + null + false + null + false + + (0 ou 1) indica se a coluna de valores da variável deve ser agregada ou não (soma dos valores ou média) conforme o tipo de unidade de medida + id_pai + id_pai + integer + + + 33 + null + null + false + null + false + + + id_parametro_medida + id_parametro_medida + integer + + + 34 null null false @@ -560,7 +599,7 @@ text - 32 + 35 null null false @@ -573,7 +612,7 @@ text - 33 + 36 null null false @@ -586,7 +625,7 @@ text - 34 + 37 null null false @@ -599,7 +638,7 @@ text - 35 + 38 null null false @@ -612,7 +651,7 @@ text - 36 + 39 null null false @@ -625,7 +664,7 @@ text - 37 + 40 null null false @@ -638,7 +677,7 @@ text - 38 + 41 null null false @@ -646,12 +685,12 @@ false - nomedimensao - nomedimensao + nome + nome text - 39 + 42 null null false @@ -664,7 +703,7 @@ text - 40 + 43 null null false @@ -677,7 +716,7 @@ text - 41 + 44 null null false @@ -690,7 +729,7 @@ text - 42 + 45 null null false @@ -703,7 +742,7 @@ text - 43 + 46 null null false @@ -716,7 +755,7 @@ text - 44 + 47 null null false @@ -729,7 +768,7 @@ text - 45 + 48 null null false @@ -742,7 +781,7 @@ text - 46 + 49 null null false @@ -755,7 +794,7 @@ integer - 47 + 50 null null false @@ -768,7 +807,7 @@ integer - 48 + 51 null null false @@ -781,7 +820,7 @@ text - 49 + 52 null null false @@ -794,7 +833,7 @@ text - 50 + 53 null null false @@ -807,7 +846,7 @@ text - 51 + 54 null null false @@ -820,7 +859,7 @@ text - 52 + 55 null null false @@ -833,7 +872,7 @@ text - 53 + 56 null null false @@ -846,7 +885,7 @@ text - 54 + 57 null null false @@ -859,7 +898,7 @@ text - 55 + 58 null null false @@ -872,33 +911,33 @@ text - 56 + 59 null null false null false - Título da classe + Título completo da fonte, devendo conter o ano quando for o caso titulo titulo text - 57 + 60 null null false null false - Título completo da fonte, devendo conter o ano quando for o caso + Título da classe titulo titulo text - 58 + 61 null null false @@ -911,7 +950,7 @@ text - 59 + 62 null null false @@ -924,7 +963,7 @@ text - 60 + 63 null null false @@ -942,23 +981,6 @@ 0 - 135 - 120 - Ubuntu - 9 - -328 - 584 - - 255 - 255 - 255 - - - - Esta tabela deverá ser sempre juntada com a tabela medida_variavel por meio de JOIN - - - 1 75 365 Ubuntu @@ -975,7 +997,7 @@ Modelo de dados do sistema de metadados estatísticos do i3Geo - 2 + 1 -1 -1 Ubuntu @@ -992,7 +1014,7 @@ Os nomes de colunas podem receber funções, por exemplo, pode-se agregar as geometrias de COLUNAGEO ou somar valores de COLUNAVALOR - 3 + 2107242Ubuntu @@ -1046,7 +1068,7 @@ - 34 + 36 1 @@ -1078,7 +1100,7 @@ - 50 + 53 2 @@ -1110,7 +1132,7 @@ - 47 + 50 3 @@ -1142,7 +1164,7 @@ - 46 + 49 4 @@ -1183,7 +1205,7 @@
- 4 + 3107280Ubuntu @@ -1205,7 +1227,7 @@ - 4 + 3 5 @@ -1237,7 +1259,7 @@ - 36 + 40 6 @@ -1310,7 +1332,7 @@
- 5 + 4107250Ubuntu @@ -1364,7 +1386,7 @@ - 35 + 38 9 @@ -1396,7 +1418,7 @@ - 16 + 18 10 @@ -1437,51 +1459,29 @@
- 6 + 5170292Ubuntu9 - 387 - 533 + 8 + 499 - 160 - 32 - 240 + 255 + 165 + 0 - - 0 - 13 - 6 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - 1 - 7 - 6 - - i3geoestat_dimensao_medida - i3geoestat_dimensao_medida - + i3geoestat_conexao + i3geoestat_conexao + Lista controlada dos parâmetros de conexão com o banco de dados onde residem dados - 27 + 2 11 @@ -1513,7 +1513,7 @@ - 8 + 1 12 @@ -1545,7 +1545,7 @@ - 38 + 24 13 @@ -1577,7 +1577,7 @@ - 15 + 51 14 @@ -1609,15 +1609,15 @@ - 0 + 61 15 - integer + text - 0 + false false false @@ -1641,18 +1641,17 @@ + 52 16 - 55 - 0 - integer + text false - true + false false false false @@ -1682,46 +1681,24 @@
- - 7 - 111 - 188 - Ubuntu - 9 - 748 - 594 - - 255 - 255 - 255 - - - - As colunas obtidas da junção de medida_variavel com tipo_regiao podem ser utilizadas para definir uma dimensão - - 8 - 275 - 292 + 6 + 128 + 247Ubuntu9 - -336 - 236 + 673 + -89 - 255 - 165 - 0 + 230 + 230 + 250 - - 2 - 0 - 8 - - 3 + 0 9 - 8 + 6 1..n 1 true @@ -1736,15 +1713,15 @@ null - i3geoestat_tipo_regiao - i3geoestat_tipo_regiao - Identifica as tabelas que possuem colunas com geometrias de determinado local ou região + i3geoestat_classificacao + i3geoestat_classificacao + Lista de classificacoes de uma medida de variável - 5 + 28 17 @@ -1776,7 +1753,7 @@ - 40 + 37 18 @@ -1808,17 +1785,18 @@ - 18 19 + 37 + 0 - text + integer false - false + true false false false @@ -1840,18 +1818,17 @@ + 45 20 - 29 - 3 - integer + text false - true + false false false false @@ -1872,21 +1849,69 @@ 0 + + + + + + + + +
+ + 7 + 317 + 210 + Ubuntu + 9 + 1018 + -24 + + 230 + 230 + 250 + + + + 1 + 6 + 7 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + i3geoestat_classes + i3geoestat_classes + Classes pertencentes a uma classificação + + + + - 20 + 27 21 - text + integer - false + true false - false - false - false + true + true + true @@ -1905,7 +1930,7 @@ - 54 + 22 22 @@ -1937,7 +1962,7 @@ - 10 + 60 23 @@ -1969,7 +1994,7 @@ - 14 + 63 24 @@ -2001,13 +2026,13 @@ - 24 + 62 25 - integer + text false @@ -2033,7 +2058,7 @@ - 12 + 0 26 @@ -2065,17 +2090,18 @@ - 52 27 + 17 + 1 - text + integer - 4326 + false - false + true false false false @@ -2097,7 +2123,7 @@ - 9 + 58 28 @@ -2128,52 +2154,21 @@ 0 - - - - - - - - -
- - 9 - 170 - 292 - Ubuntu - 9 - 8 - 499 - - 255 - 165 - 0 - - - - i3geoestat_conexao - i3geoestat_conexao - Lista controlada dos parâmetros de conexão com o banco de dados onde residem dados - - - - - 3 + 54 29 - integer + text - true + false false - true - true - true + false + false + false @@ -2192,7 +2187,7 @@ - 2 + 48 30 @@ -2224,7 +2219,7 @@ - 23 + 47 31 @@ -2256,7 +2251,7 @@ - 48 + 44 32 @@ -2288,7 +2283,7 @@ - 58 + 46 33 @@ -2319,13 +2314,76 @@ 0 + + + + + + + + +
+ + 8 + 107 + 228 + Ubuntu + 9 + 937 + 321 + + 144 + 238 + 144 + + + + i3geoestat_fonteinfo + i3geoestat_fonteinfo + + + + + - 49 + 29 34 + integer + + + true + false + true + true + true + + + + + + + + + + + false + false + + + 0 + + + + 59 + 35 + + + + text @@ -2333,7 +2391,39 @@ false false false - false + true + + + + + + + + + + + false + false + + + 0 + + + + 34 + 36 + + + + + text + + + false + false + false + false + false @@ -2361,23 +2451,91 @@
- 10 - 128 - 247 + 9 + 339 + 292Ubuntu9 - 673 - -89 + 353 + 155 - 230 - 230 - 250 + 160 + 32 + 240 + 2 + 2 + 9 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 3 + 4 + 9 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + 4 13 - 10 + 9 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 5 + 5 + 9 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 6 + 3 + 9 1..n 1 true @@ -2392,16 +2550,16 @@ null - i3geoestat_classificacao - i3geoestat_classificacao - Lista de classificacoes de uma medida de variável + i3geoestat_medida_variavel + i3geoestat_medida_variavel + Descreve as colunas que contém valores de algum tipo de medida, por exemplo população residente - 26 - 35 + 31 + 37 @@ -2432,17 +2590,18 @@ - 33 - 36 + 38 + 0 + 2 - text + integer false - false + true false false false @@ -2464,9 +2623,9 @@ - 37 - 55 - 4 + 39 + 5 + 6 @@ -2497,17 +2656,18 @@ - 42 - 38 + 40 + 8 + 3 - text + integer false - false + true false false false @@ -2528,57 +2688,10 @@ 0 - - - - - - - - -
- - 11 - 317 - 210 - Ubuntu - 9 - 1018 - -24 - - 230 - 230 - 250 - - - - 5 - 10 - 11 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - i3geoestat_classes - i3geoestat_classes - Classes pertencentes a uma classificação - - - - - 25 - 39 + 41 + 61 + 4 @@ -2586,40 +2699,8 @@ integer - true - false - true - true - true - - - - - - - - - - - false - false - - - 0 - - - - 21 - 40 - - - - - text - - false - false + true false false false @@ -2641,17 +2722,18 @@ - 56 - 41 + 42 + 11 + 5 - text + integer false - false + true false false false @@ -2673,8 +2755,8 @@ - 60 - 42 + 20 + 43 @@ -2705,8 +2787,8 @@ - 59 - 43 + 56 + 44 @@ -2737,8 +2819,8 @@ - 1 - 44 + 14 + 45 @@ -2769,18 +2851,17 @@ - 45 - 35 - 5 + 11 + 46 - integer + text false - true + false false false false @@ -2802,8 +2883,8 @@ - 55 - 46 + 23 + 47 @@ -2834,8 +2915,8 @@ - 51 - 47 + 42 + 48 @@ -2865,9 +2946,57 @@ 0 + + + + + + + + +
+ + 10 + 128 + 269 + Ubuntu + 9 + 753 + 442 + + 230 + 230 + 250 + + + + 7 + 9 + 10 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + i3geoestat_medida_variavel_link + i3geoestat_medida_variavel_link + + + + + - 45 - 48 + 35 + 49 @@ -2898,17 +3027,18 @@ - 44 - 49 + 50 + 37 + 7 - text + integer false - false + true false false false @@ -2931,7 +3061,7 @@ 41 - 50 + 51 @@ -2962,20 +3092,20 @@ - 43 - 51 + 30 + 52 - text + integer - false + true false - false - false - false + true + true + true @@ -3003,74 +3133,77 @@
- 12 - 107 - 228 + 11 + 86 + 269Ubuntu9 - 937 - 321 + 705 + 152 144 238 144 + + 8 + 9 + 11 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 9 + 8 + 11 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + - i3geoestat_fonteinfo - i3geoestat_fonteinfo + i3geoestat_fonteinfo_medida + i3geoestat_fonteinfo_medida - 28 - 52 - - - - - integer - - - true - false - true - true - true - - - - - - - - - - - false - false - - - 0 - - - - 57 53 + 37 + 8 - text + integer false - false - false + true + true false - true + false @@ -3089,18 +3222,19 @@ - 32 54 + 34 + 9 - text + integer - false - false - false + false + true + true false false @@ -3130,13 +3264,13 @@
- 13 - 339 + 12 + 170292Ubuntu9 - 353 - 155 + 387 + 533 160 32 @@ -3144,77 +3278,9 @@ - 6 - 8 - 13 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - 7 - 3 - 13 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - 8 - 5 - 13 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - 9 - 9 - 13 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - 10 - 4 - 13 + 9 + 12 1..n 1 true @@ -3229,15 +3295,15 @@ null - i3geoestat_medida_variavel - i3geoestat_medida_variavel - Descreve as colunas que contém valores de algum tipo de medida, por exemplo população residente + i3geoestat_parametro_medida + i3geoestat_parametro_medida + - 30 + 33 55 @@ -3269,18 +3335,17 @@ + 8 56 - 0 - 7 - integer + text false - true + false false false false @@ -3302,18 +3367,17 @@ + 39 57 - 5 - 10 - integer + text false - true + false false false false @@ -3335,18 +3399,17 @@ + 16 58 - 8 - 8 - integer + text false - true + false false false false @@ -3368,18 +3431,17 @@ + 32 59 - 17 - 6 integer - + 0 false - true + false false false false @@ -3402,8 +3464,8 @@ 60 - 29 - 9 + 37 + 10 @@ -3433,21 +3495,69 @@ 0 + + + + + + + + +
+ + 13 + 275 + 292 + Ubuntu + 9 + -336 + 236 + + 255 + 128 + 255 + + + + 11 + 5 + 13 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + i3geoestat_tipo_regiao + i3geoestat_tipo_regiao + Identifica as tabelas que possuem colunas com geometrias de determinado local ou região + + + + - 19 + 4 61 - text + integer - false + true false - false - false - false + true + true + true @@ -3466,7 +3576,7 @@ - 53 + 43 62 @@ -3498,7 +3608,7 @@ - 13 + 19 63 @@ -3530,17 +3640,18 @@ - 11 64 + 11 + 11 - text + integer false - false + true false false false @@ -3562,7 +3673,7 @@ - 22 + 21 65 @@ -3594,7 +3705,7 @@ - 39 + 57 66 @@ -3625,57 +3736,41 @@ 0 - - - - - - - - -
- - 14 - 128 - 269 - Ubuntu - 9 - 753 - 442 - - 230 - 230 - 250 - - - - 11 - 13 - 14 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - i3geoestat_medida_variavel_link - i3geoestat_medida_variavel_link - - - - - - 31 - 67 + 10 + 67 + + + + + text + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 15 + 68 @@ -3706,9 +3801,8 @@ - 68 - 55 - 11 + 25 + 69 @@ -3717,7 +3811,7 @@ false - true + false false false false @@ -3739,8 +3833,8 @@ - 37 - 69 + 13 + 70 @@ -3771,20 +3865,52 @@ - 29 - 70 + 55 + 71 - integer + text + + 4326 + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 9 + 72 + + + + + text - true + false false - true - true - true + false + false + false @@ -3812,40 +3938,23 @@
- 15 - 86 - 269 + 14 + 128 + 270Ubuntu9 - 705 - 152 + -372 + 596 - 144 - 238 - 144 + 255 + 128 + 255 12 13 - 15 - 1..n - 1 - true - - RESTRICT - RESTRICT - -1 - -1 - -1 - -1 - null - null - - - 13 - 12 - 15 + 14 1..n 1 true @@ -3860,16 +3969,48 @@ null - i3geoestat_fonteinfo_medida - i3geoestat_fonteinfo_medida + i3geoestat_agregaregiao + i3geoestat_agregaregiao - 71 - 55 + 26 + 73 + + + + + integer + + + true + false + true + true + true + + + + + + + + + + + false + false + + + 0 + + + + 74 + 61 12 @@ -3880,7 +4021,7 @@ false true - true + false false false @@ -3901,9 +4042,8 @@ - 72 - 52 - 13 + 5 + 75 @@ -3912,8 +4052,40 @@ false - true - true + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 12 + 76 + + + + + text + + + false + false + false false false @@ -3950,31 +4122,31 @@ metaestat_basededados 0 - 9 + 5 - 29 + 11 1 - 30 + 12 dbspo - 31 + 13 localhost - 32 + 14 5432 - 33 + 15 postgres - 34 + 16 postgres @@ -3983,7 +4155,7 @@ 0 - 29 + 11 Format 1 @@ -3998,7 +4170,7 @@ - 30 + 12 Format 1 @@ -4013,7 +4185,7 @@ - 31 + 13 Format 1 @@ -4028,7 +4200,7 @@ - 32 + 14 Format 1 @@ -4043,7 +4215,7 @@ - 33 + 15 Format 1 @@ -4058,7 +4230,7 @@ - 34 + 16 Format 1 @@ -4076,7 +4248,7 @@ - 4 + 3 @@ -4159,55 +4331,55 @@ - 8 + 13 - 17 + 61 1 - 18 + 62 Município - 19 + 63 Limites municipais - 20 + 64 1 - 21 + 65 public - 22 + 66 tb_ibge - 23 + 67 the_geom - 24 + 68 - 25 + 69 ibge - 26 + 70 no_cidade - 27 + 71 4326 - 28 + 72 the_geom2 @@ -4216,7 +4388,7 @@ 0 - 17 + 61 Format 1 @@ -4231,7 +4403,7 @@ - 18 + 62 Format 1 @@ -4246,7 +4418,7 @@ - 19 + 63 Format 1 @@ -4261,7 +4433,7 @@ - 20 + 64 Foreign Key 1 @@ -4276,7 +4448,7 @@ - 21 + 65 Format 1 @@ -4291,7 +4463,7 @@ - 22 + 66 Format 1 @@ -4306,7 +4478,7 @@ - 23 + 67 Format 1 @@ -4321,7 +4493,7 @@ - 24 + 68 Format 1 @@ -4336,7 +4508,7 @@ - 25 + 69 Format 1 @@ -4351,7 +4523,7 @@ - 26 + 70 Format 1 @@ -4366,7 +4538,7 @@ - 27 + 71 Format 1 @@ -4381,7 +4553,7 @@ - 28 + 72 Format 1 @@ -4399,7 +4571,7 @@ - 3 + 2 @@ -4506,55 +4678,55 @@ - 13 + 9 - 55 + 37 1 - 56 + 38 1 - 57 + 39 2 - 58 + 40 1 - 59 + 41 1 - 60 + 42 1 - 61 + 43 dbacoes_saude - 62 + 44 tb_farmacia_pop - 63 + 45 nu_farm_funcionando - 64 + 46 co_ibge - 65 + 47 - 66 + 48 Número de farmácias em funcionamento por mês e ano @@ -4563,7 +4735,7 @@ 0 - 55 + 37 Format 1 @@ -4578,7 +4750,7 @@ - 56 + 38 Foreign Key 1 @@ -4593,7 +4765,7 @@ - 57 + 39 Foreign Key 1 @@ -4608,7 +4780,7 @@ - 58 + 40 Foreign Key 1 @@ -4623,7 +4795,7 @@ - 59 + 41 Foreign Key 1 @@ -4638,7 +4810,7 @@ - 60 + 42 Foreign Key 1 @@ -4653,7 +4825,7 @@ - 61 + 43 Format 1 @@ -4668,7 +4840,7 @@ - 62 + 44 Format 1 @@ -4683,7 +4855,7 @@ - 63 + 45 Format 1 @@ -4698,7 +4870,7 @@ - 64 + 46 Format 1 @@ -4713,7 +4885,7 @@ - 65 + 47 Format 1 @@ -4728,7 +4900,7 @@ - 66 + 48 Format 1 @@ -4746,57 +4918,57 @@ - 6 + 12 - 11 + 55 1 - 12 - to_date(mes_farm_pop||' '||ano_farm,'MM YYYY') as mes + 56 + mes_farm_pop - 13 - mês e ano + 57 + mês - 14 + 58 - 15 - 0 + 59 + 2 - 16 + 60 1 - 11 + 55 2 - 12 + 56 ano_farm - 13 + 57 ano - 14 + 58 - 15 - 1 + 59 + 0 - 16 + 60 1 @@ -4805,7 +4977,7 @@ 0 - 11 + 55 Format 1 @@ -4820,7 +4992,7 @@ - 12 + 56 Format 1 @@ -4835,7 +5007,7 @@ - 13 + 57 Format 1 @@ -4850,7 +5022,7 @@ - 14 + 58 Format 1 @@ -4865,7 +5037,7 @@ - 15 + 59 Format 1 @@ -4880,7 +5052,7 @@ - 16 + 60 Foreign Key 1 @@ -4898,7 +5070,7 @@ - 5 + 4 @@ -4967,23 +5139,23 @@ - 10 + 6 - 35 + 17 1 - 36 + 18 Pela média - 37 + 19 1 - 38 + 20 @@ -4992,7 +5164,7 @@ 0 - 35 + 17 Format 1 @@ -5007,7 +5179,7 @@ - 36 + 18 Format 1 @@ -5022,7 +5194,7 @@ - 37 + 19 Foreign Key 1 @@ -5037,7 +5209,7 @@ - 38 + 20 Format 1 @@ -5055,167 +5227,167 @@ - 11 + 7 - 39 + 21 1 - 40 + 22 ([nu_farm_funcionando] < 1) - 41 + 23 Nenhuma - 42 + 24 255 - 43 + 25 0 - 44 + 26 0 - 45 + 27 1 - 46 + 28 - 47 + 29 - 48 + 30 0 - 49 + 31 0 - 50 + 32 0 - 51 + 33 - 39 + 21 2 - 40 + 22 ([nu_farm_funcionando] = 1) - 41 + 23 Uma - 42 + 24 0 - 43 + 25 255 - 44 + 26 0 - 45 + 27 1 - 46 + 28 - 47 + 29 - 48 + 30 - 49 + 31 - 50 + 32 - 51 + 33 - 39 + 21 3 - 40 + 22 ([nu_farm_funcionando] > 1) - 41 + 23 Mais de uma - 42 + 24 0 - 43 + 25 0 - 44 + 26 255 - 45 + 27 1 - 46 + 28 - 47 + 29 - 48 + 30 - 49 + 31 - 50 + 32 - 51 + 33 @@ -5224,7 +5396,7 @@ 0 - 39 + 21 Format 1 @@ -5239,7 +5411,7 @@ - 40 + 22 Format 1 @@ -5254,7 +5426,7 @@ - 41 + 23 Format 1 @@ -5269,7 +5441,7 @@ - 42 + 24 Format 1 @@ -5284,7 +5456,7 @@ - 43 + 25 Format 1 @@ -5299,7 +5471,7 @@ - 44 + 26 Format 1 @@ -5314,7 +5486,7 @@ - 45 + 27 Foreign Key 1 @@ -5329,7 +5501,7 @@ - 46 + 28 Format 1 @@ -5344,7 +5516,7 @@ - 47 + 29 Format 1 @@ -5359,7 +5531,7 @@ - 48 + 30 Format 1 @@ -5374,7 +5546,7 @@ - 49 + 31 Format 1 @@ -5389,7 +5561,7 @@ - 50 + 32 Format 1 @@ -5404,7 +5576,7 @@ - 51 + 33 Format 1 @@ -5422,23 +5594,23 @@ - 14 + 10 - 67 + 49 http://portal.saude.gov.br/portal/saude/area.cfm?id_area=1095 - 68 + 50 1 - 69 + 51 Site das Fármacias Populares - 70 + 52 1 @@ -5447,7 +5619,7 @@ 0 - 67 + 49 Format 1 @@ -5462,7 +5634,7 @@ - 68 + 50 Foreign Key 1 @@ -5477,7 +5649,7 @@ - 69 + 51 Format 1 @@ -5492,7 +5664,7 @@ - 70 + 52 Format 1 @@ -5510,15 +5682,15 @@ - 15 + 11 - 71 + 53 1 - 72 + 54 1 @@ -5527,7 +5699,7 @@ 0 - 71 + 53 Foreign Key 1 @@ -5542,7 +5714,7 @@ - 72 + 54 Foreign Key 1 @@ -5560,19 +5732,19 @@ - 12 + 8 - 52 + 34 1 - 53 + 35 Ministério da Saúde - 54 + 36 http://saude.gov.br @@ -5581,7 +5753,7 @@ 0 - 52 + 34 Format 1 @@ -5596,7 +5768,7 @@ - 53 + 35 Format 1 @@ -5611,7 +5783,7 @@ - 54 + 36 Format 1 diff --git a/pacotes/tme/TME_Engine.php b/pacotes/tme/TME_Engine.php index d5658d9..c90697c 100644 --- a/pacotes/tme/TME_Engine.php +++ b/pacotes/tme/TME_Engine.php @@ -663,7 +663,7 @@ $z->close();age': $zip->output($file);//edmar if($download){ ob_end_clean(); - header('Content-Type: application/vnd.google-earth.kml+xml'); + //header('Content-Type: application/vnd.google-earth.kml+xml'); header('Content-Disposition: attachment; filename='.basename($file)); print $file; exit; -- libgit2 0.21.2