{JSON} */ case "COLUNASTABELA": $m = new Metaestat(); if (empty($_GET["tipo"])) { $_GET["tipo"] = ""; } if ($_GET["formato"] == "json") { retornaJSON($m->colunasTabela($codigo_estat_conexao, $_GET["nome_esquema"], $_GET["nome_tabela"], $_GET["tipo"])); } exit; break; case "INFOTABELA": $m = new Metaestat(); $colunas = $m->colunasTabela($codigo_estat_conexao, $_GET["nome_esquema"], $_GET["nome_tabela"], ""); $comentario = $m->comentarioTabela($codigo_estat_conexao, $_GET["nome_esquema"], $_GET["nome_tabela"]); if ($_GET["formato"] == "json") { retornaJSON(array("colunas" => $colunas, "comentario" => $comentario)); } exit; case "CRIACOLUNADB": $m = new Metaestat(); if ($_GET["nome_esquema"] != "i3geo_metaestat") { retornaJSON("erro"); exit; } retornaJSON($m->criaColunaDB($codigo_estat_conexao, $_GET["nome_esquema"], $_GET["nome_tabela"], $_GET["nova_coluna"], $_GET["tipo"])); exit; break; case "ALTERANOMECOLUNADB":
exit; } $m = new Metaestat(); $meta = $m->listaTipoRegiao($codigo_tipo_regiao); $titulolayer = $meta["nome_tipo_regiao"]; if (empty($titulolayer)) { echo "Nao foi possivel encontrar a regiao ou localidade no sistema Metaestat"; exit; } $titulolayer = mb_convert_encoding($titulolayer, "ISO-8859-1", mb_detect_encoding($titulolayer)); $conexao = $m->listaConexao($meta["codigo_estat_conexao"], true); $conexao = "user="******"usuario"] . " password="******"senha"] . " dbname=" . $conexao["bancodedados"] . " host=" . $conexao["host"] . " port=" . $conexao["porta"] . ""; $colunageo = $meta["colunageo"]; $sqlColunaGeo = $meta["colunageo"]; $srid = $meta["srid"]; $colunastabela = $m->colunasTabela($meta["codigo_estat_conexao"], $meta["esquemadb"], $meta["tabela"], "geometry", "!="); $tipoLayer = "POLYGON"; //define a coluna geo correta if ($opcoes["tipo"] == "calor" || $opcoes["tipo"] == "mapaPizzas" || $opcoes["tipo"] == "mapaBarras" || $opcoes["tipo"] == "raiosProporcionais" || $opcoes["tipo"] == "circulosProporcionais") { if ($meta["colunacentroide"] != "") { $colunageo = $meta["colunacentroide"]; $sqlColunaGeo = $meta["colunacentroide"]; } $sqlColunaGeo = "st_centroid(" . $colunageo . ")"; $tipoLayer = "POINT"; if ($opcoes["tipo"] == "mapaBarras" || $opcoes["tipo"] == "mapaPizzas") { $tipoLayer = "CHART"; } } //var_dump($metadados);exit; //constroi um sql que retorna os dados na forma de uma tabela inline