Commit 8593493792db28fd2d85aa5e37066e978fc2b00a
1 parent
dc4a34d5
Exists in
master
and in
7 other branches
Atualização do admin1
Showing
32 changed files
with
635 additions
and
260 deletions
Show diff stats
@@ -6,263 +6,248 @@ include "index.php"; | @@ -6,263 +6,248 @@ include "index.php"; | ||
6 | <div class="col-sm-12"> | 6 | <div class="col-sm-12"> |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col-md-12"> | 8 | <div class="col-md-12"> |
9 | - <div class="well"> | ||
10 | - <?php | ||
11 | - $funcao = ""; | ||
12 | - // echo dirname(__FILE__); | ||
13 | - $esquemaadmin = ""; | ||
14 | - include ("../../../admin/php/admin.php"); | ||
15 | - error_reporting ( 0 ); | ||
16 | - // valida o usuario e aplica | ||
17 | - $exts = get_loaded_extensions (); | ||
18 | - if (empty ( $_POST ["senha"] ) || empty ( $_POST ["usuario"] )) { | ||
19 | - exit (); | ||
20 | - } else { | ||
21 | - $continua = verificaMaster ( $_POST ["usuario"], $_POST ["senha"], $i3geomaster ); | ||
22 | - if ($continua == false) { | ||
23 | - echo "<div class='well well-warning'>Usuário não registrado em i3geo/ms_configura.php na variável i3geomaster</div>"; | 9 | + <div class="well"> |
10 | + <?php | ||
11 | + $funcao = ""; | ||
12 | + // echo dirname(__FILE__); | ||
13 | + $esquemaadmin = ""; | ||
14 | + include ("../../../admin/php/admin.php"); | ||
15 | + error_reporting ( 0 ); | ||
16 | + // valida o usuario e aplica | ||
17 | + $exts = get_loaded_extensions (); | ||
18 | + if (empty ( $_POST ["senha"] ) || empty ( $_POST ["usuario"] )) { | ||
24 | exit (); | 19 | exit (); |
20 | + } else { | ||
21 | + $continua = verificaMaster ( $_POST ["usuario"], $_POST ["senha"], $i3geomaster ); | ||
22 | + if ($continua == false) { | ||
23 | + echo "<div class='well well-warning'>Usuário não registrado em i3geo/ms_configura.php na variável i3geomaster</div>"; | ||
24 | + exit (); | ||
25 | + } | ||
25 | } | 26 | } |
26 | - } | ||
27 | - $tabelas = array ( | ||
28 | - // tabelas gerais do sistema de administracao | ||
29 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_grupos (desc_grupo TEXT, id_grupo INTEGER PRIMARY KEY, nome_grupo TEXT, it TEXT, es TEXT, en TEXT)", | ||
30 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", | ||
31 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT, it TEXT, es TEXT, en TEXT)", | ||
32 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, nacessos INTEGER, kml_tema TEXT, kmz_tema TEXT, ogc_tema TEXT, download_tema TEXT, tags_tema TEXT, tipoa_tema TEXT, link_tema TEXT, desc_tema TEXT, nome_tema TEXT, codigo_tema TEXT, it TEXT, es TEXT, en TEXT)", | ||
33 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_ws (nacessos INTEGER, nacessosok INTEGER, autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | ||
34 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", | ||
35 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", | ||
36 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlasp (ordem_prancha NUMERIC, desc_prancha TEXT, h_prancha NUMERIC, icone_prancha TEXT, id_atlas NUMERIC, id_prancha INTEGER PRIMARY KEY, link_prancha TEXT, mapext_prancha TEXT, titulo_prancha TEXT, w_prancha NUMERIC)", | ||
37 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlast (ordem_tema NUMERIC, codigo_tema TEXT, id_prancha TEXT, id_tema INTEGER PRIMARY KEY, ligado_tema TEXT)", | ||
38 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_menus (publicado_menu TEXT, perfil_menu TEXT, aberto TEXT, desc_menu TEXT, id_menu INTEGER PRIMARY KEY, nome_menu TEXT, it TEXT, es TEXT, en TEXT)", | ||
39 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_mapas (publicado_mapa TEXT, ordem_mapa NUMERIC, perfil_mapa TEXT, ligados_mapa TEXT, temas_mapa TEXT, desc_mapa TEXT, ext_mapa TEXT, id_mapa INTEGER PRIMARY KEY, imagem_mapa TEXT, linkdireto_mapa TEXT, nome_mapa TEXT, outros_mapa TEXT, mapfile TEXT)", | ||
40 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlas (publicado_atlas TEXT, ordem_atlas NUMERIC, basemapfile_atlas TEXT, desc_atlas TEXT, h_atlas NUMERIC, icone_atlas TEXT, id_atlas INTEGER PRIMARY KEY, link_atlas TEXT, pranchadefault_atlas TEXT, template_atlas TEXT, tipoguias_atlas TEXT, titulo_atlas TEXT, w_atlas NUMERIC)", | ||
41 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_sistemas (publicado_sistema TEXT, id_sistema INTEGER PRIMARY KEY, nome_sistema TEXT, perfil_sistema TEXT)", | ||
42 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_identifica (publicado_i TEXT, abrir_i TEXT, id_i INTEGER PRIMARY KEY, nome_i TEXT, target_i TEXT)", | ||
43 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_raiz (ordem NUMERIC, id_tema NUMERIC, id_menu NUMERIC, id_nivel NUMERIC, id_raiz INTEGER PRIMARY KEY, nivel NUMERIC, perfil TEXT)", | ||
44 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n1 (publicado TEXT, ordem NUMERIC, id_menu NUMERIC, id_grupo NUMERIC, id_n1 INTEGER PRIMARY KEY, n1_perfil TEXT)", | ||
45 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n2 (publicado TEXT, ordem NUMERIC, id_n1 NUMERIC, id_n2 INTEGER PRIMARY KEY, id_subgrupo NUMERIC, n2_perfil TEXT)", | ||
46 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n3 (publicado TEXT, ordem NUMERIC, id_n2 NUMERIC, id_n3 INTEGER PRIMARY KEY, id_tema NUMERIC, n3_perfil TEXT)", | ||
47 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_comentarios (comentario TEXT, data TEXT, openidnome TEXT, openidimagem TEXT, openidservico TEXT, openidusuario TEXT, openidurl TEXT, id_tema NUMERIC)", | ||
48 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_acessostema (codigo_tema TEXT, nacessos NUMERIC,dia NUMERIC, mes NUMERIC, ano NUMERIC)", | ||
49 | - "CREATE TABLE " . $esquemaadmin . "i3geoadmin_log (id_log INTEGER PRIMARY KEY,sql TEXT,serializedata TEXT,usuario TEXT,ip TEXT,timestamp TEXT,outros TEXT)", | ||
50 | - // tabelas do sistema de controle de usuarios | ||
51 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_usuarios (ativo NUMERIC, data_cadastro TEXT, email TEXT, id_usuario INTEGER PRIMARY KEY, login TEXT, nome_usuario TEXT, senha TEXT)", | ||
52 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_papelusuario (id_papel NUMERIC, id_usuario NUMERIC)", | ||
53 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_papeis (descricao TEXT, id_papel INTEGER PRIMARY KEY, nome TEXT)", | ||
54 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_operacoes (id_operacao INTEGER PRIMARY KEY, codigo TEXT, descricao TEXT)", | ||
55 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_operacoespapeis (id_operacao NUMERIC, id_papel NUMERIC)", | ||
56 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_grupousuario (id_usuario NUMERIC, id_grupo NUMERIC)", | ||
57 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_grupotema (id_grupo NUMERIC, id_tema NUMERIC)", | ||
58 | - "CREATE TABLE " . $esquemaadmin . "i3geousr_grupos (id_grupo INTEGER PRIMARY KEY, nome TEXT, descricao TEXT)", | ||
59 | - // tabelas do sistema metaestat | ||
60 | - "create table " . $esquemaadmin . "i3geoestat_conexao (codigo_estat_conexao INTEGER PRIMARY KEY,bancodedados text,host text,porta text,usuario text,senha text)", | ||
61 | - "create table " . $esquemaadmin . "i3geoestat_tipo_regiao(codigo_tipo_regiao INTEGER PRIMARY KEY,nome_tipo_regiao text,descricao_tipo_regiao text,codigo_estat_conexao integer,esquemadb text,tabela text,colunageo text,data text,identificador text,colunanomeregiao text,srid text,colunacentroide text, colunasvisiveis text, apelidos text)", | ||
62 | - "create table " . $esquemaadmin . "i3geoestat_agregaregiao(id_agregaregiao INTEGER PRIMARY KEY,codigo_tipo_regiao integer,codigo_tipo_regiao_pai integer,colunaligacao_regiaopai text)", | ||
63 | - "create table " . $esquemaadmin . "i3geoestat_tipo_periodo(codigo_tipo_periodo INTEGER PRIMARY KEY,nome text,descricao text)", | ||
64 | - "create table " . $esquemaadmin . "i3geoestat_unidade_medida(codigo_unidade_medida INTEGER PRIMARY KEY,nome text,sigla text,permitesoma integer default 0,permitemedia integer default 0)", | ||
65 | - "create table " . $esquemaadmin . "i3geoestat_variavel(codigo_variavel INTEGER PRIMARY KEY,nome text,descricao text)", | ||
66 | - "create table " . $esquemaadmin . "i3geoestat_medida_variavel(id_medida_variavel INTEGER PRIMARY KEY,codigo_unidade_medida integer,codigo_tipo_periodo integer,codigo_variavel integer,codigo_tipo_regiao integer,codigo_estat_conexao integer,esquemadb text,tabela text,colunavalor text,colunaidgeo text,filtro text,nomemedida text,colunaidunico text)", | ||
67 | - "create table " . $esquemaadmin . "i3geoestat_classificacao(id_classificacao INTEGER PRIMARY KEY,nome text,id_medida_variavel integer,observacao text)", | ||
68 | - "create table " . $esquemaadmin . "i3geoestat_classes(id_classe INTEGER PRIMARY KEY,expressao text,titulo text,vermelho text,verde text,azul text,id_classificacao integer,tamanho text,simbolo text,overmelho text,overde text,oazul text,otamanho text)", | ||
69 | - "create table " . $esquemaadmin . "i3geoestat_fonteinfo(id_fonteinfo INTEGER PRIMARY KEY,titulo text unique,link text)", | ||
70 | - "create table " . $esquemaadmin . "i3geoestat_fonteinfo_medida(id_medida_variavel integer not null,id_fonteinfo integer not null)", | ||
71 | - "create table " . $esquemaadmin . "i3geoestat_medida_variavel_link(link text,id_medida_variavel integer,nome text,id_link INTEGER PRIMARY KEY)", | ||
72 | - "create table " . $esquemaadmin . "i3geoestat_parametro_medida(id_parametro_medida INTEGER PRIMARY KEY,coluna text,nome text,descricao text,id_pai integer default 0,id_medida_variavel integer, tipo integer default 0)", | ||
73 | - "create table " . $esquemaadmin . "i3geoestat_mapa(id_mapa INTEGER PRIMARY KEY,titulo text,template text,logoesquerdo text,logodireito text,publicado integer)", | ||
74 | - "create table " . $esquemaadmin . "i3geoestat_mapa_grupo(id_mapa_grupo INTEGER PRIMARY KEY,id_mapa integer,titulo text)", | ||
75 | - "create table " . $esquemaadmin . "i3geoestat_mapa_tema (id_mapa_tema INTEGER PRIMARY KEY,id_mapa_grupo integer,titulo text,id_medida_variavel integer)" | ||
76 | - ); | 27 | + $tabelas = array ( |
28 | + // tabelas gerais do sistema de administracao | ||
29 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_grupos (desc_grupo TEXT, id_grupo INTEGER PRIMARY KEY, nome_grupo TEXT, it TEXT, es TEXT, en TEXT)", | ||
30 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", | ||
31 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT, it TEXT, es TEXT, en TEXT)", | ||
32 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, nacessos INTEGER, kml_tema TEXT, kmz_tema TEXT, ogc_tema TEXT, download_tema TEXT, tags_tema TEXT, tipoa_tema TEXT, link_tema TEXT, desc_tema TEXT, nome_tema TEXT, codigo_tema TEXT, it TEXT, es TEXT, en TEXT)", | ||
33 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_ws (nacessos INTEGER, nacessosok INTEGER, autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | ||
34 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", | ||
35 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", | ||
36 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlasp (ordem_prancha NUMERIC, desc_prancha TEXT, h_prancha NUMERIC, icone_prancha TEXT, id_atlas NUMERIC, id_prancha INTEGER PRIMARY KEY, link_prancha TEXT, mapext_prancha TEXT, titulo_prancha TEXT, w_prancha NUMERIC)", | ||
37 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlast (ordem_tema NUMERIC, codigo_tema TEXT, id_prancha TEXT, id_tema INTEGER PRIMARY KEY, ligado_tema TEXT)", | ||
38 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_menus (publicado_menu TEXT, perfil_menu TEXT, aberto TEXT, desc_menu TEXT, id_menu INTEGER PRIMARY KEY, nome_menu TEXT, it TEXT, es TEXT, en TEXT)", | ||
39 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_mapas (publicado_mapa TEXT, ordem_mapa NUMERIC, perfil_mapa TEXT, ligados_mapa TEXT, temas_mapa TEXT, desc_mapa TEXT, ext_mapa TEXT, id_mapa INTEGER PRIMARY KEY, imagem_mapa TEXT, linkdireto_mapa TEXT, nome_mapa TEXT, outros_mapa TEXT, mapfile TEXT)", | ||
40 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_atlas (publicado_atlas TEXT, ordem_atlas NUMERIC, basemapfile_atlas TEXT, desc_atlas TEXT, h_atlas NUMERIC, icone_atlas TEXT, id_atlas INTEGER PRIMARY KEY, link_atlas TEXT, pranchadefault_atlas TEXT, template_atlas TEXT, tipoguias_atlas TEXT, titulo_atlas TEXT, w_atlas NUMERIC)", | ||
41 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_sistemas (publicado_sistema TEXT, id_sistema INTEGER PRIMARY KEY, nome_sistema TEXT, perfil_sistema TEXT)", | ||
42 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_identifica (publicado_i TEXT, abrir_i TEXT, id_i INTEGER PRIMARY KEY, nome_i TEXT, target_i TEXT)", | ||
43 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_raiz (ordem NUMERIC, id_tema NUMERIC, id_menu NUMERIC, id_nivel NUMERIC, id_raiz INTEGER PRIMARY KEY, nivel NUMERIC, perfil TEXT)", | ||
44 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n1 (publicado TEXT, ordem NUMERIC, id_menu NUMERIC, id_grupo NUMERIC, id_n1 INTEGER PRIMARY KEY, n1_perfil TEXT)", | ||
45 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n2 (publicado TEXT, ordem NUMERIC, id_n1 NUMERIC, id_n2 INTEGER PRIMARY KEY, id_subgrupo NUMERIC, n2_perfil TEXT)", | ||
46 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_n3 (publicado TEXT, ordem NUMERIC, id_n2 NUMERIC, id_n3 INTEGER PRIMARY KEY, id_tema NUMERIC, n3_perfil TEXT)", | ||
47 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_comentarios (comentario TEXT, data TEXT, openidnome TEXT, openidimagem TEXT, openidservico TEXT, openidusuario TEXT, openidurl TEXT, id_tema NUMERIC)", | ||
48 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_acessostema (codigo_tema TEXT, nacessos NUMERIC,dia NUMERIC, mes NUMERIC, ano NUMERIC)", | ||
49 | + "CREATE TABLE " . $esquemaadmin . "i3geoadmin_log (id_log INTEGER PRIMARY KEY,sql TEXT,serializedata TEXT,usuario TEXT,ip TEXT,timestamp TEXT,outros TEXT)", | ||
50 | + // tabelas do sistema de controle de usuarios | ||
51 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_usuarios (ativo NUMERIC, data_cadastro TEXT, email TEXT, id_usuario INTEGER PRIMARY KEY, login TEXT, nome_usuario TEXT, senha TEXT)", | ||
52 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_papelusuario (id_papel NUMERIC, id_usuario NUMERIC)", | ||
53 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_papeis (descricao TEXT, id_papel INTEGER PRIMARY KEY, nome TEXT)", | ||
54 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_operacoes (id_operacao INTEGER PRIMARY KEY, codigo TEXT, descricao TEXT)", | ||
55 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_operacoespapeis (id_operacao NUMERIC, id_papel NUMERIC)", | ||
56 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_grupousuario (id_usuario NUMERIC, id_grupo NUMERIC)", | ||
57 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_grupotema (id_grupo NUMERIC, id_tema NUMERIC)", | ||
58 | + "CREATE TABLE " . $esquemaadmin . "i3geousr_grupos (id_grupo INTEGER PRIMARY KEY, nome TEXT, descricao TEXT)", | ||
59 | + // tabelas do sistema metaestat | ||
60 | + "create table " . $esquemaadmin . "i3geoestat_conexao (codigo_estat_conexao INTEGER PRIMARY KEY,bancodedados text,host text,porta text,usuario text,senha text)", | ||
61 | + "create table " . $esquemaadmin . "i3geoestat_tipo_regiao(codigo_tipo_regiao INTEGER PRIMARY KEY,nome_tipo_regiao text,descricao_tipo_regiao text,codigo_estat_conexao integer,esquemadb text,tabela text,colunageo text,data text,identificador text,colunanomeregiao text,srid text,colunacentroide text, colunasvisiveis text, apelidos text)", | ||
62 | + "create table " . $esquemaadmin . "i3geoestat_agregaregiao(id_agregaregiao INTEGER PRIMARY KEY,codigo_tipo_regiao integer,codigo_tipo_regiao_pai integer,colunaligacao_regiaopai text)", | ||
63 | + "create table " . $esquemaadmin . "i3geoestat_tipo_periodo(codigo_tipo_periodo INTEGER PRIMARY KEY,nome text,descricao text)", | ||
64 | + "create table " . $esquemaadmin . "i3geoestat_unidade_medida(codigo_unidade_medida INTEGER PRIMARY KEY,nome text,sigla text,permitesoma integer default 0,permitemedia integer default 0)", | ||
65 | + "create table " . $esquemaadmin . "i3geoestat_variavel(codigo_variavel INTEGER PRIMARY KEY,nome text,descricao text)", | ||
66 | + "create table " . $esquemaadmin . "i3geoestat_medida_variavel(id_medida_variavel INTEGER PRIMARY KEY,codigo_unidade_medida integer,codigo_tipo_periodo integer,codigo_variavel integer,codigo_tipo_regiao integer,codigo_estat_conexao integer,esquemadb text,tabela text,colunavalor text,colunaidgeo text,filtro text,nomemedida text,colunaidunico text)", | ||
67 | + "create table " . $esquemaadmin . "i3geoestat_classificacao(id_classificacao INTEGER PRIMARY KEY,nome text,id_medida_variavel integer,observacao text)", | ||
68 | + "create table " . $esquemaadmin . "i3geoestat_classes(id_classe INTEGER PRIMARY KEY,expressao text,titulo text,vermelho text,verde text,azul text,id_classificacao integer,tamanho text,simbolo text,overmelho text,overde text,oazul text,otamanho text)", | ||
69 | + "create table " . $esquemaadmin . "i3geoestat_fonteinfo(id_fonteinfo INTEGER PRIMARY KEY,titulo text unique,link text)", | ||
70 | + "create table " . $esquemaadmin . "i3geoestat_fonteinfo_medida(id_medida_variavel integer not null,id_fonteinfo integer not null)", | ||
71 | + "create table " . $esquemaadmin . "i3geoestat_medida_variavel_link(link text,id_medida_variavel integer,nome text,id_link INTEGER PRIMARY KEY)", | ||
72 | + "create table " . $esquemaadmin . "i3geoestat_parametro_medida(id_parametro_medida INTEGER PRIMARY KEY,coluna text,nome text,descricao text,id_pai integer default 0,id_medida_variavel integer, tipo integer default 0)", | ||
73 | + "create table " . $esquemaadmin . "i3geoestat_mapa(id_mapa INTEGER PRIMARY KEY,titulo text,template text,logoesquerdo text,logodireito text,publicado integer)", | ||
74 | + "create table " . $esquemaadmin . "i3geoestat_mapa_grupo(id_mapa_grupo INTEGER PRIMARY KEY,id_mapa integer,titulo text)", | ||
75 | + "create table " . $esquemaadmin . "i3geoestat_mapa_tema (id_mapa_tema INTEGER PRIMARY KEY,id_mapa_grupo integer,titulo text,id_medida_variavel integer)" | ||
76 | + ); | ||
77 | 77 | ||
78 | - if ($conexaoadmin == "") { | ||
79 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
80 | - if (file_exists ( "../../../admin/admin.db" )) { | ||
81 | - echo "<div class='well well-warning'>Arquivo admin/admin.db ja existe. Vc deve apagá-lo para poder criá-lo novamente caso precise</div>"; | ||
82 | - } else { | ||
83 | - // TODO verificar ao fechar versao - caso tenha havido alteracoes no banco, gerar banco vazio | ||
84 | - copy ( "../../../admin/admin_vazio.db", "../../../admin/admin.db" ); | ||
85 | - chmod ( "../../../admin/admin.db", 0777 ); | 78 | + if ($conexaoadmin == "") { |
79 | + if ($_POST ["mostraSoSQL"] != "on") { | ||
86 | if (file_exists ( "../../../admin/admin.db" )) { | 80 | if (file_exists ( "../../../admin/admin.db" )) { |
87 | - echo "Banco copiado ../../../admin/admin.db !!!"; | ||
88 | - $dbhw = new PDO ( 'sqlite:../../../admin/admin.db' ); | 81 | + echo "<div class='well well-warning'>Arquivo admin/admin.db ja existe. Vc deve apagá-lo para poder criá-lo novamente caso precise</div>"; |
89 | } else { | 82 | } else { |
90 | - echo "erro"; | 83 | + // TODO verificar ao fechar versao - caso tenha havido alteracoes no banco, gerar banco vazio |
84 | + copy ( "../../../admin/admin_vazio.db", "../../../admin/admin.db" ); | ||
85 | + chmod ( "../../../admin/admin.db", 0777 ); | ||
86 | + if (file_exists ( "../../../admin/admin.db" )) { | ||
87 | + echo "Banco copiado ../../../admin/admin.db !!!"; | ||
88 | + $dbhw = new PDO ( 'sqlite:../../../admin/admin.db' ); | ||
89 | + } else { | ||
90 | + echo "erro"; | ||
91 | + } | ||
91 | } | 92 | } |
93 | + } else { | ||
94 | + $dbhw = new PDO ( 'sqlite:../../../admin/admin.db' ); | ||
92 | } | 95 | } |
93 | } else { | 96 | } else { |
94 | - $dbhw = new PDO ( 'sqlite:../../../admin/admin.db' ); | 97 | + include ($conexaoadmin); |
98 | + } | ||
99 | + if (empty ( $dbhw )) { | ||
100 | + echo "<div class='well well-warning'>Conexao com o banco não pode ser estabelecida</div>"; | ||
101 | + exit (); | ||
95 | } | 102 | } |
96 | - } else { | ||
97 | - include ($conexaoadmin); | ||
98 | - } | ||
99 | - if (empty ( $dbhw )) { | ||
100 | - echo "<div class='well well-warning'>Conexao com o banco não pode ser estabelecida</div>"; | ||
101 | - exit (); | ||
102 | - } | ||
103 | - $drivename = $dbhw->getAttribute ( PDO::ATTR_DRIVER_NAME ); | ||
104 | - if ($_POST ["mostraSoSQL"] != "on") { | 103 | + $drivename = $dbhw->getAttribute ( PDO::ATTR_DRIVER_NAME ); |
104 | + if ($_POST ["mostraSoSQL"] != "on") { | ||
105 | + foreach ( $tabelas as $tabela ) { | ||
106 | + if ($drivename == "pgsql") { | ||
107 | + $tabela = str_replace ( "INTEGER PRIMARY KEY", "SERIAL PRIMARY KEY NOT NULL", $tabela ); | ||
108 | + } | ||
109 | + $q = $dbhw->query ( $tabela ); | ||
110 | + } | ||
111 | + } | ||
112 | + echo "<h4>Tabelas</h4>"; | ||
105 | foreach ( $tabelas as $tabela ) { | 113 | foreach ( $tabelas as $tabela ) { |
106 | if ($drivename == "pgsql") { | 114 | if ($drivename == "pgsql") { |
107 | $tabela = str_replace ( "INTEGER PRIMARY KEY", "SERIAL PRIMARY KEY NOT NULL", $tabela ); | 115 | $tabela = str_replace ( "INTEGER PRIMARY KEY", "SERIAL PRIMARY KEY NOT NULL", $tabela ); |
108 | } | 116 | } |
109 | - $q = $dbhw->query ( $tabela ); | 117 | + echo "<p>" . $tabela . ";</p>"; |
110 | } | 118 | } |
111 | - } | ||
112 | - echo "<h4>Tabelas</h4>"; | ||
113 | - foreach ( $tabelas as $tabela ) { | ||
114 | - if ($drivename == "pgsql") { | ||
115 | - $tabela = str_replace ( "INTEGER PRIMARY KEY", "SERIAL PRIMARY KEY NOT NULL", $tabela ); | 119 | + echo "<h4>Inserindo os registros default<h4>"; |
120 | + if ($_POST ["mostraSoSQL"] != "on") { | ||
121 | + $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_papeis", "id_papel" ); | ||
122 | + } else { | ||
123 | + $teste = array (); | ||
116 | } | 124 | } |
117 | - echo "<p>" . $tabela . ";</p>"; | ||
118 | - } | ||
119 | - echo "<h4>Inserindo os registros default<h4>"; | ||
120 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
121 | - $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_papeis", "id_papel" ); | ||
122 | - } else { | ||
123 | - $teste = array (); | ||
124 | - } | ||
125 | - $sql = array (); | ||
126 | - | ||
127 | - if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") { | ||
128 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem executar qualquer tarefa, inclusive cadastrar novos administradores',1,'admin')"; | ||
129 | - } | ||
130 | - if (! in_array ( 2, $teste ) || $_POST ["mostraSoSQL"] == "on") { | ||
131 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem criar/editar qualquer tema (mapfile) mas nao podem editar a arvore do catalogo de temas',2,'editores')"; | ||
132 | - } | ||
133 | - if (! in_array ( 3, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
134 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem alterar a arvore do catalogo e dos atlas',3,'publicadores')"; | ||
135 | - if (! in_array ( 4, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
136 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem editar dados geograficos',4,'editoresgeo')"; | ||
137 | - if (! in_array ( 5, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
138 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES ('Podem administrar o sistema METAESTAT','5', 'adminmetaestat')"; | ||
139 | - | ||
140 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
141 | - $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_usuarios", "id_usuario" ); | ||
142 | - } else { | ||
143 | - $teste = array (); | ||
144 | - } | 125 | + $sql = array (); |
145 | 126 | ||
146 | - if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
147 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_usuarios VALUES(1,'','',0,'admingeral','admingeral','admingeral')"; | 127 | + if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") { |
128 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem executar qualquer tarefa, inclusive cadastrar novos administradores',1,'admin')"; | ||
129 | + } | ||
130 | + if (! in_array ( 2, $teste ) || $_POST ["mostraSoSQL"] == "on") { | ||
131 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem criar/editar qualquer tema (mapfile) mas nao podem editar a arvore do catalogo de temas',2,'editores')"; | ||
132 | + } | ||
133 | + if (! in_array ( 3, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
134 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem alterar a arvore do catalogo e dos atlas',3,'publicadores')"; | ||
135 | + if (! in_array ( 4, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
136 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES('Podem editar dados geograficos',4,'editoresgeo')"; | ||
137 | + if (! in_array ( 5, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
138 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papeis VALUES ('Podem administrar o sistema METAESTAT','5', 'adminmetaestat')"; | ||
148 | 139 | ||
149 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
150 | - $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_papelusuario", "id_usuario", "id_papel" ); | ||
151 | - } else { | ||
152 | - $teste = array (); | ||
153 | - } | ||
154 | - if (! in_array ( "1-1", $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
155 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papelusuario VALUES(1,1)"; | 140 | + if ($_POST ["mostraSoSQL"] != "on") { |
141 | + $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_usuarios", "id_usuario" ); | ||
142 | + } else { | ||
143 | + $teste = array (); | ||
144 | + } | ||
156 | 145 | ||
157 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
158 | - $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_operacoes", "id_operacao" ); | ||
159 | - } else { | ||
160 | - $teste = array (); | ||
161 | - } | ||
162 | - if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
163 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(1,'admin/html/editormapfile','editor de mapfiles do sistema de administracao')"; | ||
164 | - if (! in_array ( 2, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
165 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(2,'admin/html/operacoes','abre o editor de operacoes')"; | ||
166 | - if (! in_array ( 3, $teste )) | ||
167 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(3,'teste/','teste')"; | ||
168 | - if (! in_array ( 4, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
169 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(4,'admin/html/arvore','edicao da arvore do catalogo de temas')"; | ||
170 | - if (! in_array ( 5, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
171 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(5,'admin/html/menus','edicao da lista de menus')"; | ||
172 | - if (! in_array ( 6, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
173 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(6,'admin/html/ogcws','edicao das preferencias do servico WMS')"; | ||
174 | - if (! in_array ( 7, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
175 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(7,'admin/html/atlas','edicao de atlas')"; | ||
176 | - if (! in_array ( 8, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
177 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(8,'admin/html/identifica','lista de sistemas incluidos na ferramenta de identificacao')"; | ||
178 | - if (! in_array ( 9, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
179 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(9,'admin/html/incluimap','adapta mapfiles antigos para versoes novas do Mapserver')"; | ||
180 | - if (! in_array ( 10, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
181 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(10,'admin/html/mapas','lista de links para mapas')"; | ||
182 | - if (! in_array ( 11, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
183 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(11,'admin/html/perfis','lista controlada de perfis')"; | ||
184 | - if (! in_array ( 12, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
185 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(12,'admin/html/sistemas','lista de sistemas complementares que sao mostrados no catalogo')"; | ||
186 | - if (! in_array ( 13, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
187 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(13,'admin/html/subirshapefile','upload de shapefile para uma pasta especifica no servidor')"; | ||
188 | - if (! in_array ( 14, $teste )) | ||
189 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(14,'admin/html/tags','edicao da lista controlada de tags')"; | ||
190 | - if (! in_array ( 15, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
191 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(15,'admin/html/webservices','cadastro de links para webservices')"; | ||
192 | - if (! in_array ( 16, $teste )) | ||
193 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(16,'admin/php/editortexto','editor de texto para mapfiles')"; | ||
194 | - if (! in_array ( 17, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
195 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('17', 'admin/html/usuarios', 'cadastro de usuarios')"; | ||
196 | - if (! in_array ( 18, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
197 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('18', 'admin/metaestat/geral', 'permite edicoes mais comuns do sistema de metadados estatisticos')"; | ||
198 | - if (! in_array ( 19, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
199 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('19', 'admin/metaestat/editorbanco', 'permite gerenciar as tabelas do banco')"; | 146 | + if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") |
147 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_usuarios VALUES(1,'','',0,'admingeral','admingeral','admingeral')"; | ||
200 | 148 | ||
201 | - if ($_POST ["mostraSoSQL"] != "on") { | ||
202 | - $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_operacoespapeis", "id_operacao", "id_papel" ); | ||
203 | - } else { | ||
204 | - $teste = array (); | ||
205 | - } | ||
206 | - if (! in_array ( '1-2', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
207 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(1,2)"; | ||
208 | - if (! in_array ( '1-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
209 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(1,3)"; | ||
210 | - if (! in_array ( '4-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
211 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(4,3)"; | ||
212 | - if (! in_array ( '5-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
213 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(5,3)"; | ||
214 | - if (! in_array ( '7-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
215 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(7,3)"; | ||
216 | - if (! in_array ( '10-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
217 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(10,3)"; | ||
218 | - if (! in_array ( '13-2', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
219 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(13,2)"; | ||
220 | - if (! in_array ( '13-4', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
221 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(13,4)"; | ||
222 | - if (! in_array ( '15-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
223 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(15,3)"; | ||
224 | - if (! in_array ( '16-2', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
225 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(16,2)"; | ||
226 | - if (! in_array ( '18-1', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
227 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(18,1)"; | ||
228 | - if (! in_array ( '18-5', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
229 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES (18,5)"; | 149 | + if ($_POST ["mostraSoSQL"] != "on") { |
150 | + $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_papelusuario", "id_usuario", "id_papel" ); | ||
151 | + } else { | ||
152 | + $teste = array (); | ||
153 | + } | ||
154 | + if (! in_array ( "1-1", $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
155 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_papelusuario VALUES(1,1)"; | ||
230 | 156 | ||
231 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('1', 'Anual', '')"; | ||
232 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('2', 'Mensal', '')"; | ||
233 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('3', 'Diário', '')"; | ||
234 | - $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('4', 'Horário', '')"; | 157 | + if ($_POST ["mostraSoSQL"] != "on") { |
158 | + $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_operacoes", "id_operacao" ); | ||
159 | + } else { | ||
160 | + $teste = array (); | ||
161 | + } | ||
162 | + if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
163 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(1,'admin/html/editormapfile','editor de mapfiles do sistema de administracao')"; | ||
164 | + if (! in_array ( 2, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
165 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(2,'admin/html/operacoes','abre o editor de operacoes')"; | ||
166 | + if (! in_array ( 3, $teste )) | ||
167 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(3,'teste/','teste')"; | ||
168 | + if (! in_array ( 4, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
169 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(4,'admin/html/arvore','edicao da arvore do catalogo de temas')"; | ||
170 | + if (! in_array ( 5, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
171 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(5,'admin/html/menus','edicao da lista de menus')"; | ||
172 | + if (! in_array ( 6, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
173 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(6,'admin/html/ogcws','edicao das preferencias do servico WMS')"; | ||
174 | + if (! in_array ( 7, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
175 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(7,'admin/html/atlas','edicao de atlas')"; | ||
176 | + if (! in_array ( 8, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
177 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(8,'admin/html/identifica','lista de sistemas incluidos na ferramenta de identificacao')"; | ||
178 | + if (! in_array ( 9, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
179 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(9,'admin/html/incluimap','adapta mapfiles antigos para versoes novas do Mapserver')"; | ||
180 | + if (! in_array ( 10, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
181 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(10,'admin/html/mapas','lista de links para mapas')"; | ||
182 | + if (! in_array ( 11, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
183 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(11,'admin/html/perfis','lista controlada de perfis')"; | ||
184 | + if (! in_array ( 12, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
185 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(12,'admin/html/sistemas','lista de sistemas complementares que sao mostrados no catalogo')"; | ||
186 | + if (! in_array ( 13, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
187 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(13,'admin/html/subirshapefile','upload de shapefile para uma pasta especifica no servidor')"; | ||
188 | + if (! in_array ( 14, $teste )) | ||
189 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(14,'admin/html/tags','edicao da lista controlada de tags')"; | ||
190 | + if (! in_array ( 15, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
191 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(15,'admin/html/webservices','cadastro de links para webservices')"; | ||
192 | + if (! in_array ( 16, $teste )) | ||
193 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES(16,'admin/php/editortexto','editor de texto para mapfiles')"; | ||
194 | + if (! in_array ( 17, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
195 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('17', 'admin/html/usuarios', 'cadastro de usuarios')"; | ||
196 | + if (! in_array ( 18, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
197 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('18', 'admin/metaestat/geral', 'permite edicoes mais comuns do sistema de metadados estatisticos')"; | ||
198 | + if (! in_array ( 19, $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
199 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoes VALUES('19', 'admin/metaestat/editorbanco', 'permite gerenciar as tabelas do banco')"; | ||
235 | 200 | ||
236 | - echo "<h4>Inserts:</h4>"; | ||
237 | - foreach ( $sql as $s ) { | ||
238 | if ($_POST ["mostraSoSQL"] != "on") { | 201 | if ($_POST ["mostraSoSQL"] != "on") { |
239 | - $dbhw->query ( $s ); | 202 | + $teste = lista ( "select * from " . $esquemaadmin . "i3geousr_operacoespapeis", "id_operacao", "id_papel" ); |
203 | + } else { | ||
204 | + $teste = array (); | ||
240 | } | 205 | } |
241 | - echo "<p>" . $s . ";<p>"; | ||
242 | - } | 206 | + if (! in_array ( '1-2', $teste ) || $_POST ["mostraSoSQL"] == "on") |
207 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(1,2)"; | ||
208 | + if (! in_array ( '1-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
209 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(1,3)"; | ||
210 | + if (! in_array ( '4-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
211 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(4,3)"; | ||
212 | + if (! in_array ( '5-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
213 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(5,3)"; | ||
214 | + if (! in_array ( '7-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
215 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(7,3)"; | ||
216 | + if (! in_array ( '10-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
217 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(10,3)"; | ||
218 | + if (! in_array ( '13-2', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
219 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(13,2)"; | ||
220 | + if (! in_array ( '13-4', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
221 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(13,4)"; | ||
222 | + if (! in_array ( '15-3', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
223 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(15,3)"; | ||
224 | + if (! in_array ( '16-2', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
225 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(16,2)"; | ||
226 | + if (! in_array ( '18-1', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
227 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES(18,1)"; | ||
228 | + if (! in_array ( '18-5', $teste ) || $_POST ["mostraSoSQL"] == "on") | ||
229 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_operacoespapeis VALUES (18,5)"; | ||
243 | 230 | ||
244 | - echo "<div class='well well-success'>Feito!</div>"; | 231 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('1', 'Anual', '')"; |
232 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('2', 'Mensal', '')"; | ||
233 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('3', 'Diário', '')"; | ||
234 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geoestat_tipo_periodo (codigo_tipo_periodo, nome, descricao) VALUES ('4', 'Horário', '')"; | ||
245 | 235 | ||
246 | - ?> | ||
247 | - </div> | 236 | + echo "<h4>Inserts:</h4>"; |
237 | + foreach ( $sql as $s ) { | ||
238 | + if ($_POST ["mostraSoSQL"] != "on") { | ||
239 | + $dbhw->query ( $s ); | ||
240 | + } | ||
241 | + echo "<p>" . $s . ";<p>"; | ||
242 | + } | ||
243 | + ?> | ||
248 | </div> | 244 | </div> |
245 | + <div class='well well-success'>Feito!</div> | ||
246 | + </div> | ||
249 | </div> | 247 | </div> |
250 | </div> | 248 | </div> |
251 | </div> | 249 | </div> |
252 | </div> | 250 | </div> |
253 | -<script> | ||
254 | - $(document).ready(function(){ | ||
255 | - //vem de admin1/index.js | ||
256 | - iniciaMenuPrincipal(); | ||
257 | - $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | ||
258 | - event.preventDefault(); | ||
259 | - event.stopPropagation(); | ||
260 | - $(this).parent().siblings().removeClass('open'); | ||
261 | - $(this).parent().toggleClass('open'); | ||
262 | - }); | ||
263 | - $.material.init(); | ||
264 | - }); | ||
265 | - </script> | ||
266 | </body> | 251 | </body> |
267 | </html> | 252 | </html> |
268 | <?php | 253 | <?php |
admin1/ferramentas/criabanco/index.php
@@ -23,21 +23,18 @@ include "../../head.php"; | @@ -23,21 +23,18 @@ include "../../head.php"; | ||
23 | <div class="well"> | 23 | <div class="well"> |
24 | <h3>Cria o banco de dados de administração conforme as | 24 | <h3>Cria o banco de dados de administração conforme as |
25 | configurações de conexão existentes em i3geo/ms_configura.php</h3> | 25 | configurações de conexão existentes em i3geo/ms_configura.php</h3> |
26 | + <h4>O usuário e a senha devem estar cadastrados em i3geo/ms_configura.php</h4> | ||
27 | + </div> | ||
28 | + <div class="well"> | ||
26 | <form class="form" role="form" method="post" action="exec.php"> | 29 | <form class="form" role="form" method="post" action="exec.php"> |
30 | + <?php include("../../templates/login.php");?> | ||
27 | <div class="form-group"> | 31 | <div class="form-group"> |
28 | - <label class="sr-only" for="i3geousuario">{{{usuario}}}</label> <input type="text" | ||
29 | - class="form-control" name="usuario" id="i3geousuario" placeholder="{{{usuario}}}" required> | ||
30 | - </div> | ||
31 | - <div class="form-group"> | ||
32 | - <label class="sr-only" for="i3geosenha">{{{senha}}}</label> <input type="password" | ||
33 | - class="form-control" name="senha" id="i3geosenha" placeholder="{{{senha}}}" required> | ||
34 | - </div> | ||
35 | - <div class="checkbox"> | ||
36 | - <label> <input type="checkbox" name="mostraSoSQL" /> Mostra apenas o SQL, sem criar o banco | ||
37 | - </label> | 32 | + <div class="checkbox"> |
33 | + <label> <input type="checkbox" name="mostraSoSQL" /> Mostra apenas o SQL, sem criar o banco | ||
34 | + </label> | ||
35 | + </div> | ||
36 | + <button type="submit" class="btn btn-primary">{{{enviar}}}</button> | ||
38 | </div> | 37 | </div> |
39 | - | ||
40 | - <button type="submit" class="btn btn-primary">{{{enviar}}}</button> | ||
41 | </form> | 38 | </form> |
42 | </div> | 39 | </div> |
43 | </div> | 40 | </div> |
admin1/ferramentas/estatisticas/index.php
@@ -150,10 +150,8 @@ include "../../head.php"; | @@ -150,10 +150,8 @@ include "../../head.php"; | ||
150 | echo "<li class='list-group-item'><label class='text-success'>".$temasacessos2[$i]." <span class='badge'> ".$temasacessos[$temasacessos2[$i]]."</span></li>"; | 150 | echo "<li class='list-group-item'><label class='text-success'>".$temasacessos2[$i]." <span class='badge'> ".$temasacessos[$temasacessos2[$i]]."</span></li>"; |
151 | } | 151 | } |
152 | } | 152 | } |
153 | - echo "</ul><div class='well well-info'>".date('l jS \of F Y h:i:s A')."</div>"; | 153 | + echo "</ul></div><div class='well well-info'>".date('l jS \of F Y h:i:s A')."</div>"; |
154 | ?> | 154 | ?> |
155 | - | ||
156 | - </div> | ||
157 | </div> | 155 | </div> |
158 | </div> | 156 | </div> |
159 | </div> | 157 | </div> |
@@ -0,0 +1,306 @@ | @@ -0,0 +1,306 @@ | ||
1 | +<?php | ||
2 | +include "index.php"; | ||
3 | +?> | ||
4 | +<div class="container"> | ||
5 | + <div class="row center-block"> | ||
6 | + <div class="col-sm-12"> | ||
7 | + <div class="row"> | ||
8 | + <div class="col-md-12"> | ||
9 | + <div class="well"> | ||
10 | + <?php | ||
11 | + error_reporting(0); | ||
12 | + // | ||
13 | + //carrega o phpmapscript | ||
14 | + // | ||
15 | + if (!function_exists('ms_GetVersion')){ | ||
16 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
17 | + if(!@dl('php_mapscript_48.dll')) | ||
18 | + dl('php_mapscript.dll'); | ||
19 | + } | ||
20 | + else{ | ||
21 | + dl('php_mapscript.so'); | ||
22 | + } | ||
23 | + } | ||
24 | + include_once (dirname(__FILE__)."/../../../admin/php/admin.php"); | ||
25 | + $versao = versao(); | ||
26 | + $versao = $versao["principal"]; | ||
27 | + // | ||
28 | + //no caso do programa ser utilizado via URL | ||
29 | + // | ||
30 | + if(empty($tipo)){ | ||
31 | + exit; | ||
32 | + } | ||
33 | + if($tipo == "mini" || $tipo == "todos" || $tipo == "grande"){ | ||
34 | + ms_ResetErrorList(); | ||
35 | + //verifica login | ||
36 | + if(empty($_POST["senha"]) || empty($_POST["usuario"])){ | ||
37 | + exit; | ||
38 | + } | ||
39 | + else{ | ||
40 | + $continua = verificaMaster($_POST["usuario"],$_POST["senha"],$i3geomaster); | ||
41 | + if($continua == false){ | ||
42 | + echo "<div class='well well-warning'>Usuário não registrado em i3geo/ms_configura.php na variável i3geomaster</div>"; | ||
43 | + exit; | ||
44 | + } | ||
45 | + } | ||
46 | + if (ob_get_level() == 0){ | ||
47 | + ob_start(); | ||
48 | + } | ||
49 | + error_reporting(0); | ||
50 | + $arqs = listaArquivos("../../../temas",true,array("map","gvp")); | ||
51 | + $arqs = $arqs["arquivos"]; | ||
52 | + sort($arqs); | ||
53 | + foreach ($arqs as $arq){ | ||
54 | + $arq = str_replace(" ","xxxx",$arq); | ||
55 | + $temp = explode(".",$arq); | ||
56 | + if(file_exists($locaplic.'/temas/'.$arq) && $temp[(count($temp) - 1)] == "map" && !(strpos($temp[0],"_") === 0) ){ | ||
57 | + echo "<div 'class=well'><h4>$arq</h4>"; | ||
58 | + if($tipo == "mini" || $tipo == "todos"){ | ||
59 | + if(!file_exists($locaplic.'/temas/miniaturas/'.$arq.'.mini.png')){ | ||
60 | + verificaMiniatura($arq,"mini"); | ||
61 | + } | ||
62 | + } | ||
63 | + if($tipo == "grande" || $tipo == "todos"){ | ||
64 | + if(!file_exists($locaplic.'/temas/miniaturas/'.$arq.'.grande.png')){ | ||
65 | + verificaMiniatura($arq,"grande"); | ||
66 | + } | ||
67 | + } | ||
68 | + echo "</div>"; | ||
69 | + } | ||
70 | + ob_flush(); | ||
71 | + flush(); | ||
72 | + } | ||
73 | + ob_end_flush(); | ||
74 | + } | ||
75 | + ?> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + </div> | ||
81 | +</div> | ||
82 | +</body> | ||
83 | +</html> | ||
84 | +<?php | ||
85 | +// | ||
86 | +//se tipo for igual a "admin", as imagens são gravadas em i3geo/temas/miniaturas | ||
87 | +// | ||
88 | +function verificaMiniatura($map,$tipo,$admin=false) | ||
89 | +{ | ||
90 | + global $locaplic,$versao,$base,$postgis_mapa; | ||
91 | + if($versao == ""){ | ||
92 | + $versao = versao(); | ||
93 | + $versao = $versao["principal"]; | ||
94 | + } | ||
95 | + ms_ResetErrorList(); | ||
96 | + $tema = ""; | ||
97 | + $map = str_replace("\\","/",$map); | ||
98 | + $map = basename($map); | ||
99 | + $extensao = ".map"; | ||
100 | + if (file_exists($locaplic.'/temas/'.$map)){ | ||
101 | + $tema = $locaplic.'/temas/'.$map; | ||
102 | + } | ||
103 | + else{ | ||
104 | + if (file_exists($locaplic.'/temas/'.$map.'.gvp')){ | ||
105 | + $extensao = ".gvp"; | ||
106 | + } | ||
107 | + $tema = $locaplic.'/temas/'.$map.$extensao; | ||
108 | + } | ||
109 | + if ($tema != ""){ | ||
110 | + if(isset($base) && $base != ""){ | ||
111 | + if(file_exists($base)) | ||
112 | + {$f = $base;} | ||
113 | + else | ||
114 | + {$f = $locaplic."/aplicmap/".$base.".map";} | ||
115 | + if(!file_exists($base)){ | ||
116 | + echo "<div class='well well-danger'>ARQUIVO $base NÂO FOI ENCONTRADO. CORRIJA ISSO EM ms_configura.php"; | ||
117 | + exit; | ||
118 | + } | ||
119 | + } | ||
120 | + else{ | ||
121 | + $f = ""; | ||
122 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
123 | + $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; | ||
124 | + } | ||
125 | + else{ | ||
126 | + if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ | ||
127 | + $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; | ||
128 | + } | ||
129 | + if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
130 | + $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; | ||
131 | + } | ||
132 | + if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
133 | + $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; | ||
134 | + } | ||
135 | + if($f == ""){ | ||
136 | + $f = $locaplic."/aplicmap/geral1v".$versao.".map"; | ||
137 | + } | ||
138 | + } | ||
139 | + } | ||
140 | + $mapa = ms_newMapObj($f); | ||
141 | + if($extensao == ".map"){ | ||
142 | + if(@ms_newMapObj($tema)){ | ||
143 | + $nmapa = ms_newMapObj($tema); | ||
144 | + } | ||
145 | + else{ | ||
146 | + echo "<div class='well well-danger'>erro no arquivo $tema </div>"; | ||
147 | + return; | ||
148 | + } | ||
149 | + $dados = ""; | ||
150 | + $numlayers = $nmapa->numlayers; | ||
151 | + for ($i=0;$i < $numlayers;$i++){ | ||
152 | + $layern = $nmapa->getlayer($i); | ||
153 | + $layern->set("status",MS_DEFAULT); | ||
154 | + cloneInlineSymbol($layern,$nmapa,$mapa); | ||
155 | + ms_newLayerObj($mapa, $layern); | ||
156 | + autoClasses($layern,$mapa,$locaplic); | ||
157 | + if ($layern->data == ""){ | ||
158 | + $dados = $layern->connection; | ||
159 | + } | ||
160 | + else{ | ||
161 | + $dados = $layern->data; | ||
162 | + } | ||
163 | + $pegarext = $teman->name; | ||
164 | + } | ||
165 | + | ||
166 | + if (isset($postgis_mapa)){ | ||
167 | + if ($postgis_mapa != ""){ | ||
168 | + $numlayers = $mapa->numlayers; | ||
169 | + for ($i=0;$i < $numlayers;$i++){ | ||
170 | + $layern = $mapa->getlayer($i); | ||
171 | + if (!empty($postgis_mapa)){ | ||
172 | + if ($layern->connectiontype == MS_POSTGIS){ | ||
173 | + $lcon = $layern->connection; | ||
174 | + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ | ||
175 | + if(($lcon == " ") || ($lcon == "")) //para efeitos de compatibilidade | ||
176 | + {$layern->set("connection",$postgis_mapa);} | ||
177 | + else{ | ||
178 | + $layern->set("connection",$postgis_mapa[$lcon]); | ||
179 | + } | ||
180 | + } | ||
181 | + } | ||
182 | + } | ||
183 | + } | ||
184 | + } | ||
185 | + } | ||
186 | + zoomTemaMiniatura($pegarext,$mapa); | ||
187 | + } | ||
188 | + if($extensao == ".gvp"){ | ||
189 | + include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); | ||
190 | + $gm = new gvsig2mapfile($tema); | ||
191 | + $gvsigview = $gm->getViewsNames(); | ||
192 | + foreach($gvsigview as $v){ | ||
193 | + $dataView = $gm->getViewData($v); | ||
194 | + $mapa = $gm->addLayers($mapa,$v,$dataView["layerNames"]); | ||
195 | + } | ||
196 | + $next = $dataView["extent"]; | ||
197 | + $ext = $mapa->extent; | ||
198 | + $ext->setextent($next[0],$next[1],$next[2],$next[3]); | ||
199 | + } | ||
200 | + if ($tipo == "mini" || $tipo == "todos"){ | ||
201 | + $mapa->setsize(50,50); | ||
202 | + $sca = $mapa->scalebar; | ||
203 | + $sca->set("status",MS_OFF); | ||
204 | + $objImagemM = @$mapa->draw(); | ||
205 | + //if ($objImagemM == "" || $objImagemM == MS_FAILURE) | ||
206 | + //{echo "Problemas ao gerar o mapa<br>";return;} | ||
207 | + $weboM = $mapa->web; | ||
208 | + $urlM = $weboM->imageurl."/".$map; | ||
209 | + } | ||
210 | + if ($tipo == "grande" || $tipo == "todos"){ | ||
211 | + $mapa->setsize(300,300); | ||
212 | + $sca = $mapa->scalebar; | ||
213 | + $sca->set("status",MS_OFF); | ||
214 | + $objImagemG = @$mapa->draw(); | ||
215 | + //if ($objImagemG == "" || $objImagemG == MS_FAILURE) | ||
216 | + //{echo "Problemas ao gerar o mapa<br>";return;} | ||
217 | + $weboG = $mapa->web; | ||
218 | + $urlG = $weboG->imageurl."/".$map; | ||
219 | + } | ||
220 | + if($tipo=="mini" || $tipo == "todos"){ | ||
221 | + if (!$objImagemM){ | ||
222 | + echo "Problemas ao gerar o mapa<br>"; | ||
223 | + $error = ""; | ||
224 | + $error = ms_GetErrorObj(); | ||
225 | + while($error && $error->code != MS_NOERR){ | ||
226 | + echo "<div class='well well-danger'>Error in %s: %s</div>", $error->routine, $error->message; | ||
227 | + $error = $error->next(); | ||
228 | + } | ||
229 | + return; | ||
230 | + } | ||
231 | + if($objImagemM->imagepath == ""){ | ||
232 | + echo "<div class='well well-danger'>Erro IMAGEPATH vazio</div>";return; | ||
233 | + } | ||
234 | + $nomecM = ($objImagemM->imagepath).$map.".mini.png"; | ||
235 | + $objImagemM->saveImage($nomecM); | ||
236 | + } | ||
237 | + if($tipo=="grande" || $tipo == "todos"){ | ||
238 | + if (!$objImagemG){ | ||
239 | + echo "<div class='well well-danger'>Problemas ao gerar o mapa</div>"; | ||
240 | + $error = ""; | ||
241 | + $error = ms_GetErrorObj(); | ||
242 | + while($error && $error->code != MS_NOERR){ | ||
243 | + echo "<div class='well well-danger'>Error in %s: %s</div>", $error->routine, $error->message; | ||
244 | + $error = $error->next(); | ||
245 | + } | ||
246 | + return; | ||
247 | + } | ||
248 | + if($objImagemG->imagepath == ""){ | ||
249 | + echo "<div class='well well-danger'>Erro IMAGEPATH vazio</div>";return; | ||
250 | + } | ||
251 | + $nomecG = ($objImagemG->imagepath).$map.".grande.png"; | ||
252 | + $objImagemG->saveImage($nomecG); | ||
253 | + } | ||
254 | + if($admin == false){ | ||
255 | + if($tipo=="mini" || $tipo == "todos") | ||
256 | + {echo "<img class='img-thumbnail' src='".$urlM.".mini.png' />";} | ||
257 | + if($tipo=="grande" || $tipo == "todos") | ||
258 | + {echo "<img class='img-thumbnail' src='".$urlG.".grande.png' />";} | ||
259 | + } | ||
260 | + // | ||
261 | + //copia a imagem | ||
262 | + // | ||
263 | + if($admin == true){ | ||
264 | + $dir = $locaplic."/temas/miniaturas"; | ||
265 | + $mini = $dir."/".$map.".map.mini.png"; | ||
266 | + $grande = $dir."/".$map.".map.grande.png"; | ||
267 | + if(file_exists($mini)) | ||
268 | + {unlink($mini);} | ||
269 | + if(file_exists($grande)) | ||
270 | + {unlink($grande);} | ||
271 | + copy(($objImagemG->imagepath).$map.".grande.png",$grande); | ||
272 | + copy(($objImagemM->imagepath).$map.".mini.png",$mini); | ||
273 | + } | ||
274 | + } | ||
275 | +} | ||
276 | +function zoomTemaMiniatura($nomelayer,&$mapa) | ||
277 | +{ | ||
278 | + $layer = $mapa->getlayerbyname($nomelayer); | ||
279 | + if($layer->data == "" && $layer->connection == "") | ||
280 | + {return;} | ||
281 | + $prjMapa = $mapa->getProjection(); | ||
282 | + $prjTema = $layer->getProjection(); | ||
283 | + $extatual = $mapa->extent; | ||
284 | + $ret = $layer->getmetadata("extensao"); | ||
285 | + if($layer->type > 2 && $ret == "") | ||
286 | + {return;} | ||
287 | + $ct = $layer->connectiontype; | ||
288 | + if(($ret == "") && ($ct != 1)) | ||
289 | + {return;} | ||
290 | + if ($ret == ""){ | ||
291 | + $ret = $layer->getextent(); | ||
292 | + //reprojeta o retangulo | ||
293 | + if (($prjTema != "") && ($prjMapa != $prjTema)){ | ||
294 | + $projInObj = ms_newprojectionobj($prjTema); | ||
295 | + $projOutObj = ms_newprojectionobj($prjMapa); | ||
296 | + $ret->project($projInObj, $projOutObj); | ||
297 | + } | ||
298 | + $extatual->setextent($ret->minx,$ret->miny,$ret->maxx,$ret->maxy); | ||
299 | + } | ||
300 | + else{ | ||
301 | + $ret = explode(" ",$ret); | ||
302 | + $extatual->setextent($ret[0],$ret[1],$ret[2],$ret[3]); | ||
303 | + } | ||
304 | +} | ||
305 | + | ||
306 | +?> |
@@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
1 | +<?php | ||
2 | +define ( ONDEI3GEO, "../../.." ); | ||
3 | +include (dirname ( __FILE__ ) . "/../../../ms_configura.php"); | ||
4 | +error_reporting ( 0 ); | ||
5 | +include "../../head.php"; | ||
6 | +?> | ||
7 | +<!--admin1/index.php --> | ||
8 | +<div class="container-fluid"> | ||
9 | + <div class="row"> | ||
10 | + <ol class="breadcrumb"> | ||
11 | + <li><a href="../../init/index.php">i3Geo</a></li> | ||
12 | + <li><a href="../../index.php">Admin</a></li> | ||
13 | + <li>Ferramentas</li> | ||
14 | + <li class="active">Miniaturas</li> | ||
15 | + </ol> | ||
16 | + </div> | ||
17 | +</div> | ||
18 | +<div class="container"> | ||
19 | + <div class="row center-block"> | ||
20 | + <div class="col-sm-12 template hidden"> | ||
21 | + <div class="row"> | ||
22 | + <div class="col-md-12"> | ||
23 | + <div class="well"> | ||
24 | + <h3>Gera imagens miniaturas de cada tema para abastecer a pasta i3geo/temas/miniaturas</h3> | ||
25 | + <h4>O usuário e a senha devem estar cadastrados em i3geo/ms_configura.php</h4> | ||
26 | + </div> | ||
27 | + <div class="well"> | ||
28 | + <form class="form" role="form" method="post" action="exec.php"> | ||
29 | + <?php include("../../templates/login.php");?> | ||
30 | + <div class="form-group"> | ||
31 | + <div class="radio"> | ||
32 | + <label> <input name="tipo" value="todos" type="radio" required>todas as miniaturas | ||
33 | + </label> | ||
34 | + </div> | ||
35 | + <div class="radio"> | ||
36 | + <label> <input name="tipo" value="mini" type="radio" required>apenas as pequenas | ||
37 | + </label> | ||
38 | + </div> | ||
39 | + <div class="radio"> | ||
40 | + <label> <input name="tipo" value="grande" type="radio" required>apenas as grandes | ||
41 | + </label> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + <button type="submit" class="btn btn-primary">{{{enviar}}}</button> | ||
45 | + </form> | ||
46 | + </div> | ||
47 | + <div class="well well-info"> | ||
48 | + As miniaturas são geradas na pasta temporária do servidor (ms_tmp). Depois de criadas, é necessário copiá-las para a pasta i3geo/temas/miniaturas. Apenas são processados os temas cujas miniaturas ainda não existirem. | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | + </div> | ||
53 | + </div> | ||
54 | +</div> | ||
55 | +<script> | ||
56 | + $(document).ready(function(){ | ||
57 | + //vem de admin1/index.js | ||
58 | + iniciaMenuPrincipal(); | ||
59 | + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | ||
60 | + event.preventDefault(); | ||
61 | + event.stopPropagation(); | ||
62 | + $(this).parent().siblings().removeClass('open'); | ||
63 | + $(this).parent().toggleClass('open'); | ||
64 | + }); | ||
65 | + //traducao | ||
66 | + var t = $(".template"); | ||
67 | + t.html( | ||
68 | + Mustache.to_html( | ||
69 | + t.html(), | ||
70 | + i3GEO.idioma.objetoIdioma(i3GEOadmin.core.dicionario) | ||
71 | + ) | ||
72 | + ); | ||
73 | + t.removeClass('hidden'); | ||
74 | + $.material.init(); | ||
75 | + }); | ||
76 | + </script> | ||
77 | +</body> | ||
78 | +</html> |
admin1/head.php
@@ -158,7 +158,7 @@ body{ | @@ -158,7 +158,7 @@ body{ | ||
158 | <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span | 158 | <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span |
159 | class="icon-bar"></span> | 159 | class="icon-bar"></span> |
160 | </button> | 160 | </button> |
161 | - <a class="navbar-brand" href="../init/index.php"><?php echo $mensagemInicia;?> <i | 161 | + <a class="navbar-brand" href="<?php echo ONDEI3GEO; ?>/init/index.php"><?php echo $mensagemInicia;?> <i |
162 | class="fa fa-home fa-1x"></i></a> | 162 | class="fa fa-home fa-1x"></i></a> |
163 | </div> | 163 | </div> |
164 | <div id="navbar" class="navbar-collapse collapse navbar-responsive-collapse"> | 164 | <div id="navbar" class="navbar-collapse collapse navbar-responsive-collapse"> |
admin1/index.js
@@ -24,42 +24,42 @@ menuPrincipal = [ | @@ -24,42 +24,42 @@ menuPrincipal = [ | ||
24 | },{ | 24 | },{ |
25 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/ferramentas/criabanco/index.php' >"+$trad("criaBd",i3GEOadmin.menup.dicionario)+"</a>" | 25 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/ferramentas/criabanco/index.php' >"+$trad("criaBd",i3GEOadmin.menup.dicionario)+"</a>" |
26 | },{ | 26 | },{ |
27 | - html: "<a href='" + i3GEO.configura.locaplic + "/geraminiatura.php' >"+$trad("geraMiniatura",i3GEOadmin.menup.dicionario)+"</a>" | 27 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin1/ferramentas/miniaturas/index.php' >"+$trad("geraMiniatura",i3GEOadmin.menup.dicionario)+"</a>" |
28 | } | 28 | } |
29 | ] | 29 | ] |
30 | },{ | 30 | },{ |
31 | html: "RSS, JSON, XML", | 31 | html: "RSS, JSON, XML", |
32 | children:[ | 32 | children:[ |
33 | { | 33 | { |
34 | - html: "<a href='xmlmetaestatogc.php' >"+$trad("xmlWmsMetaestat",i3GEOadmin.menup.dicionario)+"</a>" | 34 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlmetaestatogc.php' >"+$trad("xmlWmsMetaestat",i3GEOadmin.menup.dicionario)+"</a>" |
35 | },{ | 35 | },{ |
36 | - html: "<a href='rssmapas.php' >"+$trad("verRss",i3GEOadmin.menup.dicionario)+"</a>" | 36 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rssmapas.php' >"+$trad("verRss",i3GEOadmin.menup.dicionario)+"</a>" |
37 | },{ | 37 | },{ |
38 | - html: "<a href='rssgrupos.php?output=xml' >"+$trad("rssArvore",i3GEOadmin.menup.dicionario)+"</a>" | 38 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rssgrupos.php?output=xml' >"+$trad("rssArvore",i3GEOadmin.menup.dicionario)+"</a>" |
39 | },{ | 39 | },{ |
40 | - html: "<a href='rssgrupos.php?output=json' >"+$trad("rssArvoreJson",i3GEOadmin.menup.dicionario)+"</a>" | 40 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rssgrupos.php?output=json' >"+$trad("rssArvoreJson",i3GEOadmin.menup.dicionario)+"</a>" |
41 | },{ | 41 | },{ |
42 | - html: "<a href='rsscomentariostemas.php' >"+$trad("rssComentarios",i3GEOadmin.menup.dicionario)+"</a>" | 42 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rsscomentariostemas.php' >"+$trad("rssComentarios",i3GEOadmin.menup.dicionario)+"</a>" |
43 | },{ | 43 | },{ |
44 | - html: "<a href='xmlservicosws.php' >"+$trad("xmlWebServ",i3GEOadmin.menup.dicionario)+"</a>" | 44 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlservicosws.php' >"+$trad("xmlWebServ",i3GEOadmin.menup.dicionario)+"</a>" |
45 | },{ | 45 | },{ |
46 | - html: "<a href='xmlservicosws.php?output=json' >"+$trad("xmlWebServJson",i3GEOadmin.menup.dicionario)+"</a>" | 46 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlservicosws.php?output=json' >"+$trad("xmlWebServJson",i3GEOadmin.menup.dicionario)+"</a>" |
47 | },{ | 47 | },{ |
48 | - html: "<a href='xmlservicoswms.php' >"+$trad("xmlWms",i3GEOadmin.menup.dicionario)+"</a>" | 48 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlservicoswms.php' >"+$trad("xmlWms",i3GEOadmin.menup.dicionario)+"</a>" |
49 | },{ | 49 | },{ |
50 | - html: "<a href='xmlservicoswms.php?output=json' >"+$trad("xmlWmsJson",i3GEOadmin.menup.dicionario)+"</a>" | 50 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlservicoswms.php?output=json' >"+$trad("xmlWmsJson",i3GEOadmin.menup.dicionario)+"</a>" |
51 | },{ | 51 | },{ |
52 | - html: "<a href='xmlgeorss.php?output=json' >"+$trad("xmlGeoRssJson",i3GEOadmin.menup.dicionario)+"</a>" | 52 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlgeorss.php?output=json' >"+$trad("xmlGeoRssJson",i3GEOadmin.menup.dicionario)+"</a>" |
53 | },{ | 53 | },{ |
54 | - html: "<a href='xmlmapas.php' >"+$trad("xmlMapas",i3GEOadmin.menup.dicionario)+"</a>" | 54 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlmapas.php' >"+$trad("xmlMapas",i3GEOadmin.menup.dicionario)+"</a>" |
55 | },{ | 55 | },{ |
56 | - html: "<a href='rssmapas.php' >"+$trad("rssMapas",i3GEOadmin.menup.dicionario)+"</a>" | 56 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rssmapas.php' >"+$trad("rssMapas",i3GEOadmin.menup.dicionario)+"</a>" |
57 | },{ | 57 | },{ |
58 | - html: "<a href='rssmapas.php?output=json' >"+$trad("rssMapasJson",i3GEOadmin.menup.dicionario)+"</a>" | 58 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/rssmapas.php?output=json' >"+$trad("rssMapasJson",i3GEOadmin.menup.dicionario)+"</a>" |
59 | },{ | 59 | },{ |
60 | - html: "<a href='xmlsistemas.php' >"+$trad("xmlSistAdiciona",i3GEOadmin.menup.dicionario)+"</a>" | 60 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlsistemas.php' >"+$trad("xmlSistAdiciona",i3GEOadmin.menup.dicionario)+"</a>" |
61 | },{ | 61 | },{ |
62 | - html: "<a href='xmlgeorss.php' >"+$trad("xmlGeoRss",i3GEOadmin.menup.dicionario)+"</a>" | 62 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin/xmlgeorss.php' >"+$trad("xmlGeoRss",i3GEOadmin.menup.dicionario)+"</a>" |
63 | } | 63 | } |
64 | ] | 64 | ] |
65 | } | 65 | } |
admin1/index.php
@@ -15,7 +15,7 @@ include "head.php"; | @@ -15,7 +15,7 @@ include "head.php"; | ||
15 | </div> | 15 | </div> |
16 | <div class="container"> | 16 | <div class="container"> |
17 | <div class="row center-block"> | 17 | <div class="row center-block"> |
18 | - <div class="col-sm-12"> | 18 | + <div class="col-sm-12 hidden"> |
19 | 19 | ||
20 | <div class="well"> | 20 | <div class="well"> |
21 | <h1>{{adminI3geo}}</h1> | 21 | <h1>{{adminI3geo}}</h1> |
@@ -61,6 +61,7 @@ include "head.php"; | @@ -61,6 +61,7 @@ include "head.php"; | ||
61 | $(this).parent().siblings().removeClass('open'); | 61 | $(this).parent().siblings().removeClass('open'); |
62 | $(this).parent().toggleClass('open'); | 62 | $(this).parent().toggleClass('open'); |
63 | }); | 63 | }); |
64 | + $(".hidden").removeClass('hidden'); | ||
64 | $.material.init(); | 65 | $.material.init(); |
65 | }); | 66 | }); |
66 | </script> | 67 | </script> |
@@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
1 | +<h3>Login</h3> | ||
2 | +<div class="form-group"> | ||
3 | + <label for="i3geousuario"></label> <input type="text" class="form-control" name="usuario" | ||
4 | + id="i3geousuario" placeholder="{{{usuario}}}" required> | ||
5 | +</div> | ||
6 | +<div class="form-group"> | ||
7 | + <label for="i3geosenha"></label> <input type="password" class="form-control" name="senha" | ||
8 | + id="i3geosenha" placeholder="{{{senha}}}" required> | ||
9 | +</div> | ||
0 | \ No newline at end of file | 10 | \ No newline at end of file |
symbols/fontes.txt
temas/miniaturas/_lbiomashp.map.grande.png
14.7 KB
temas/miniaturas/_lbiomashp.map.mini.png
1.66 KB
temas/miniaturas/_lcbersgeo.map.grande.png
14.6 KB
temas/miniaturas/_lcbersgeo.map.mini.png
1.53 KB
temas/miniaturas/_llocalirestrito.map.grande.png
14.5 KB
temas/miniaturas/_llocalirestrito.map.mini.png
1.51 KB
temas/miniaturas/_ltestegml.map.grande.png
15 KB
temas/miniaturas/_ltestegml.map.mini.png
1.66 KB
temas/miniaturas/_ltesteibge.map.grande.png
14.6 KB
temas/miniaturas/_ltesteibge.map.mini.png
1.64 KB
temas/miniaturas/_ltestepttemplatekml.map.grande.png
15.3 KB
temas/miniaturas/_ltestepttemplatekml.map.mini.png
1.86 KB
temas/miniaturas/_ltestetms.map.grande.png
14.6 KB
temas/miniaturas/_ltestetms.map.mini.png
1.52 KB
temas/miniaturas/_ucsfwms.map.grande.png
15 KB
temas/miniaturas/_ucsfwms.map.mini.png
1.55 KB
temas/miniaturas/_wbairros.map.grande.png
14.6 KB
temas/miniaturas/_wbairros.map.mini.png
1.52 KB
temas/miniaturas/_wtesteibge.map.grande.png
14.6 KB
temas/miniaturas/_wtesteibge.map.mini.png
1.64 KB
temas/miniaturas/_wtestetms.map.grande.png
14.6 KB
temas/miniaturas/_wtestetms.map.mini.png
1.52 KB