Commit dc4a34d57735798c0c97771c5b3e517aa7431c1a
1 parent
0eb0e8e9
Exists in
master
and in
7 other branches
Atualização do admin1
Showing
9 changed files
with
366 additions
and
9 deletions
Show diff stats
admin1/dicionario/core.js
| ... | ... | @@ -326,13 +326,13 @@ i3GEOadmin.core.dicionario = { |
| 326 | 326 | en : "", |
| 327 | 327 | es : "" |
| 328 | 328 | } ], |
| 329 | - '' : [ { | |
| 330 | - pt : "", | |
| 329 | + 'usuario' : [ { | |
| 330 | + pt : "Usuário", | |
| 331 | 331 | en : "", |
| 332 | 332 | es : "" |
| 333 | 333 | } ], |
| 334 | - '' : [ { | |
| 335 | - pt : "", | |
| 334 | + 'senha' : [ { | |
| 335 | + pt : "Senha", | |
| 336 | 336 | en : "", |
| 337 | 337 | es : "" |
| 338 | 338 | } ], | ... | ... |
admin1/ferramentas/banco/index.php
| 1 | 1 | <?php |
| 2 | 2 | define ( ONDEI3GEO, "../../.." ); |
| 3 | -include (dirname ( __FILE__ ) . "/../../ms_configura.php"); | |
| 3 | +include (dirname ( __FILE__ ) . "/../../../ms_configura.php"); | |
| 4 | 4 | error_reporting ( 0 ); |
| 5 | 5 | include "../../head.php"; |
| 6 | 6 | ?> |
| ... | ... | @@ -19,6 +19,7 @@ include "../../head.php"; |
| 19 | 19 | <div class="row center-block"> |
| 20 | 20 | <div class="col-sm-12"> |
| 21 | 21 | <div class="well"> |
| 22 | + <h2>Descrição da estrutura do banco de dados de administração</h2> | |
| 22 | 23 | <?php |
| 23 | 24 | if(!file_exists("../../../admin/admin.db")){ |
| 24 | 25 | echo "<div class='well well-danger'>O arquivo menutemas/admin.db não existe. Utilize a opção existente no menu de administração para criar o banco de dados SQLITE.</div>"; | ... | ... |
| ... | ... | @@ -0,0 +1,284 @@ |
| 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 | + $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>"; | |
| 24 | + exit (); | |
| 25 | + } | |
| 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 | + ); | |
| 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 ); | |
| 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 | + } | |
| 92 | + } | |
| 93 | + } else { | |
| 94 | + $dbhw = new PDO ( 'sqlite:../../../admin/admin.db' ); | |
| 95 | + } | |
| 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") { | |
| 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>"; | |
| 113 | + foreach ( $tabelas as $tabela ) { | |
| 114 | + if ($drivename == "pgsql") { | |
| 115 | + $tabela = str_replace ( "INTEGER PRIMARY KEY", "SERIAL PRIMARY KEY NOT NULL", $tabela ); | |
| 116 | + } | |
| 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 | + } | |
| 145 | + | |
| 146 | + if (! in_array ( 1, $teste ) || $_POST ["mostraSoSQL"] == "on") | |
| 147 | + $sql [] = "INSERT INTO " . $esquemaadmin . "i3geousr_usuarios VALUES(1,'','',0,'admingeral','admingeral','admingeral')"; | |
| 148 | + | |
| 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)"; | |
| 156 | + | |
| 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')"; | |
| 200 | + | |
| 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)"; | |
| 230 | + | |
| 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', '')"; | |
| 235 | + | |
| 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 | + | |
| 244 | + echo "<div class='well well-success'>Feito!</div>"; | |
| 245 | + | |
| 246 | + ?> | |
| 247 | + </div> | |
| 248 | + </div> | |
| 249 | + </div> | |
| 250 | + </div> | |
| 251 | + </div> | |
| 252 | +</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> | |
| 267 | +</html> | |
| 268 | +<?php | |
| 269 | +function lista($sql, $coluna, $coluna1 = "") { | |
| 270 | + global $dbh; | |
| 271 | + $lista = array (); | |
| 272 | + $q = $dbh->query ( $sql, PDO::FETCH_ASSOC ); | |
| 273 | + if ($q) { | |
| 274 | + $resultado = $q->fetchAll (); | |
| 275 | + foreach ( $resultado as $r ) { | |
| 276 | + if ($coluna1 == "") | |
| 277 | + $lista [] = $r [$coluna]; | |
| 278 | + else | |
| 279 | + $lista [] = $r [$coluna] . "-" . $r [$coluna1]; | |
| 280 | + } | |
| 281 | + } | |
| 282 | + return $lista; | |
| 283 | +} | |
| 284 | +?> | ... | ... |
| ... | ... | @@ -0,0 +1,71 @@ |
| 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">Cria banco</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>Cria o banco de dados de administração conforme as | |
| 25 | + configurações de conexão existentes em i3geo/ms_configura.php</h3> | |
| 26 | + <form class="form" role="form" method="post" action="exec.php"> | |
| 27 | + <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> | |
| 38 | + </div> | |
| 39 | + | |
| 40 | + <button type="submit" class="btn btn-primary">{{{enviar}}}</button> | |
| 41 | + </form> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | +</div> | |
| 48 | +<script> | |
| 49 | + $(document).ready(function(){ | |
| 50 | + //vem de admin1/index.js | |
| 51 | + iniciaMenuPrincipal(); | |
| 52 | + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | |
| 53 | + event.preventDefault(); | |
| 54 | + event.stopPropagation(); | |
| 55 | + $(this).parent().siblings().removeClass('open'); | |
| 56 | + $(this).parent().toggleClass('open'); | |
| 57 | + }); | |
| 58 | + //traducao | |
| 59 | + var t = $(".template"); | |
| 60 | + t.html( | |
| 61 | + Mustache.to_html( | |
| 62 | + t.html(), | |
| 63 | + i3GEO.idioma.objetoIdioma(i3GEOadmin.core.dicionario) | |
| 64 | + ) | |
| 65 | + ); | |
| 66 | + t.removeClass('hidden'); | |
| 67 | + $.material.init(); | |
| 68 | + }); | |
| 69 | + </script> | |
| 70 | +</body> | |
| 71 | +</html> | ... | ... |
admin1/ferramentas/estatisticas/index.php
admin1/head.php
| ... | ... | @@ -51,6 +51,7 @@ echo " |
| 51 | 51 | <script src='" . ONDEI3GEO . "/classesjs/compactados/classe_php_compacto.js'></script> |
| 52 | 52 | <script src='" . ONDEI3GEO . "/classesjs/compactados/mustache.js'></script> |
| 53 | 53 | <script src='" . ONDEI3GEO . "/admin1/index.js'></script> |
| 54 | + <script src='" . ONDEI3GEO . "/admin1/dicionario/core.js'></script> | |
| 54 | 55 | <script src='" . ONDEI3GEO . "/admin1/dicionario/menup.js'></script> |
| 55 | 56 | "; |
| 56 | 57 | ?> | ... | ... |
admin1/index.js
| ... | ... | @@ -18,11 +18,11 @@ menuPrincipal = [ |
| 18 | 18 | html: $trad("outrasOpc",i3GEOadmin.menup.dicionario), |
| 19 | 19 | children:[ |
| 20 | 20 | { |
| 21 | - html: "<a href='ferramentas/estatisticas/index.php' >"+$trad("estat",i3GEOadmin.menup.dicionario)+"</a>" | |
| 21 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin1/ferramentas/estatisticas/index.php' >"+$trad("estat",i3GEOadmin.menup.dicionario)+"</a>" | |
| 22 | 22 | },{ |
| 23 | - html: "<a href='ferramentas/banco/index.php' >"+$trad("descricaoBd",i3GEOadmin.menup.dicionario)+"</a>" | |
| 23 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin1/ferramentas/banco/index.php' >"+$trad("descricaoBd",i3GEOadmin.menup.dicionario)+"</a>" | |
| 24 | 24 | },{ |
| 25 | - html: "<a href='php/criabanco.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 | 27 | html: "<a href='" + i3GEO.configura.locaplic + "/geraminiatura.php' >"+$trad("geraMiniatura",i3GEOadmin.menup.dicionario)+"</a>" |
| 28 | 28 | } | ... | ... |
pacotes/bootstrap/css/bootstrap-dropdown-multilevel.css
100644 → 100755
pacotes/bootstrap/js/bootstrap-dropdown-multilevel.js
100644 → 100755