Skip to content

Commit

Permalink
Update conexao.asp
Browse files Browse the repository at this point in the history
  • Loading branch information
Didox committed Aug 16, 2016
1 parent 8466873 commit 10b4070
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions asp/ASP Orientado a Objetos/conexao.asp
Expand Up @@ -8,7 +8,7 @@ conexao.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\home\bigsolutions-
set conn= server.createobject("adodb.connection")
'conn.Open "Driver={SQL SERVER};Server=bigapp01;Database=imobiliaria_plena;Uid=sa;PWD="
conn.Open "Driver={SQL SERVER};Server=200.170.214.123;Database=imobiliaria_plena;Uid=sa;PWD=bigbig"
conn.Open "Driver={SQL SERVER};Server=localhost;Database=imobiliaria_plena;Uid=sa;PWD=123"
Function f_email(byVal msg)
Expand All @@ -24,17 +24,17 @@ function iif(condicao, iifTrue, iifFalse)
End function
'Função para mostrar o caminho da página onde o internauta está
'Função para mostrar o caminho da página onde o internauta está
Function mostracaminho(cod_pagina)
Set rsT = server.createobject("ADODB.Recordset")
rsT.open "select site_caminho from tab_geral", conexao, 3, 3
If rsT("site_caminho")="S" then
'verificar se o administrador selecionou em Gerenciamento / Configurações da Pagina, a opção
'de mostrar o caminho onde o usuário está
'verificar se o administrador selecionou em Gerenciamento / Configurações da Pagina, a opção
'de mostrar o caminho onde o usuário está
msg_retorno = "<font face=Verdana size=1>Você está em: "
msg_retorno = "<font face=Verdana size=1>Você está em: "
Set rsPag = server.createobject("ADODB.Recordset")
rsPag.open "select cod_pai,cod_pagina,titulo_item,item_menu from menu_site where cod_pagina = " & cod_pagina, conexao, 3, 3
If not rsPag.eof then
Expand Down Expand Up @@ -63,15 +63,15 @@ End If
mostracaminho = msg_retorno
End If 'verificação se deve exibir o caminho...
End If 'verificação se deve exibir o caminho...
rsT.Close
Set rsT=nothing
End Function
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'Função que joga na lixeira os itens deletados.
'Função que joga na lixeira os itens deletados.
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sub SetDelete( Byval TABELA, ByVal CAMPO, ByVal COD, ByVal NOME, ByVal codUser )
Expand Down Expand Up @@ -103,7 +103,7 @@ Sub SetDelete( Byval TABELA, ByVal CAMPO, ByVal COD, ByVal NOME, ByVal codUser )
End Sub
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
' Função para restaurar o Objeto
' Função para restaurar o Objeto
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sub SetRestaurar( ByVal codLixo )
Expand All @@ -112,14 +112,14 @@ Sub SetRestaurar( ByVal codLixo )
sql1 = "Update "&rsL("Tabela")&" SET flg_del = 'N' where "&rsL("campo")&" = "& rsL("cod")&""
If trim(rsL("Tabela"))="menu_site" then 'colocar a pagina na ultima posição
If trim(rsL("Tabela"))="menu_site" then 'colocar a pagina na ultima posição
Set rsMSite = server.createobject("ADODB.Recordset")
rsMSite.open "select item_menu,cod_pai from menu_site where cod_pagina = " & rsL("cod"), conexao, 3, 3
If rsMSite("item_menu")="S" and rsMSite("cod_pai")="0" then 'pagina na raiz, mexer na posição
If rsMSite("item_menu")="S" and rsMSite("cod_pai")="0" then 'pagina na raiz, mexer na posição
Set rsTot = conexao.execute("Select max(menu_pos) as tot_menu from menu_site ")
If rsTot.eof then
menu_pos = 1
Expand All @@ -130,7 +130,7 @@ Sub SetRestaurar( ByVal codLixo )
End If
If rsMSite("cod_pai")<>"0" then 'subsecao, mexer na posição
If rsMSite("cod_pai")<>"0" then 'subsecao, mexer na posição
Set rsTot = conexao.execute("Select max(sub_menu_pos) as tot_menu from menu_site where cod_pai="&rsMSite("cod_pai"))
If rsTot.eof then
Expand All @@ -153,18 +153,18 @@ Sub SetRestaurar( ByVal codLixo )
End sub
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
' Função para excluir o objeto da lixeira
' Função para excluir o objeto da lixeira
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sub SetDelLixo( ByVal codLixo )
Set rsL = conexao.execute("Select * from LIXEIRA where cod_lixo = "& codLixo &"")
vTitulo = rsL("nome")
If not rsL.EOF then
If Ucase(rsL("tabela")) = "MENU_SITE" then 'verificações
If Ucase(rsL("tabela")) = "MENU_SITE" then 'verificações
Set rsF = server.createobject("ADODB.Recordset")
rsF.open "select cod_pagina from menu_site where cod_pagina="&rsL("cod")&" or cod_pai="&rsL("cod")&" ", conexao, 3, 3
'Remove o redirecionamento, caso necessário
'Remove o redirecionamento, caso necessário
Call RemRedir(rsL("cod"))
'deletar as paginas filho
Expand All @@ -185,15 +185,15 @@ Sub SetDelLixo( ByVal codLixo )
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
'Apaga as tabelas auxiliares da tabela TAB_PROPRIEDADES, são elas.: TAB_REGISTROS, TAB_TITULOS
'Apaga as tabelas auxiliares da tabela TAB_PROPRIEDADES, são elas.: TAB_REGISTROS, TAB_TITULOS
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If Ucase(rsL("tabela")) = "TBL_PROPRIEDADES" then
conexao.execute("drop table [TBL_"&vTitulo&"]")
conexao.execute("delete from tbl_titulos where cod_tbl="&rsL("cod")&"")
End if
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
'Apaga as tabelas auxiliares da tabela TAB_FORM_CONFIGURACAO são elas.: tab_form_registros, tab_form_campos,
'Apaga as tabelas auxiliares da tabela TAB_FORM_CONFIGURACAO são elas.: tab_form_registros, tab_form_campos,
' tab_form_campos_nome, tab_form_combo e ainda apaga a tabela criada para o form.
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If Ucase(rsL("tabela")) = "TAB_FORM_CONFIGURACAO" then
Expand Down Expand Up @@ -233,7 +233,7 @@ End Sub
Sub DelPagForever(int_cod_pag)
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' Apaga os registrso das tabelas auxiliares da tabela MENU_SITE são elas.: institucional_textos, forum_configuracao,
' Apaga os registrso das tabelas auxiliares da tabela MENU_SITE são elas.: institucional_textos, forum_configuracao,
' forum_msg, modelo2_faq, modelo1_links, modelo1_links_SubCat, MODELO_LINK_CONFIG.
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Expand Down Expand Up @@ -270,7 +270,7 @@ Sub DelPagForever(int_cod_pag)
'Deletando as Categorias
conexao.execute("delete from modelo1_links_cat where cod_pagina="&int_cod_pag&"")
'Deletando confugurações avançadas
'Deletando confugurações avançadas
conexao.execute("delete from MODELO_LINK_CONFIG where cod_pagina="&int_cod_pag&"")
'M9
Expand Down Expand Up @@ -299,18 +299,18 @@ Sub DelPagForever(int_cod_pag)
End Sub
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
' Função para dizer o tipo de objeto que esta na lixeira
' Função para dizer o tipo de objeto que esta na lixeira
' Pega o nome da tabela e atravez dela eu retorno o nome do objeto
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function vTipoObj( byVal TABELA )
Select case Ucase(TABELA)
case "MENU_SITE"
vTipoObj = "Páginas"
vTipoObj = "Páginas"
case "TBL_PROPRIEDADES"
vTipoObj = "Tabelas"
case "TAB_FORM_CONFIGURACAO"
vTipoObj = "Formulários"
vTipoObj = "Formulários"
End Select
End function
Expand Down Expand Up @@ -471,7 +471,7 @@ Class CapturaCep
End If
if prNome_bairro = "" then
retCep = "<script language='javascript'>alert('Número de cep não encontrado')</script>"
retCep = "<script language='javascript'>alert('Número de cep não encontrado')</script>"
end if
Expand All @@ -481,11 +481,11 @@ Class CapturaCep
Set objRS_localidade = Nothing
Else
retCep = "<script language='javascript'>alert('Número de cep inválido')</script>"
retCep = "<script language='javascript'>alert('Número de cep inválido')</script>"
End If
If Err.Number Then
retCep = "<script language='javascript'>alert('Erro ao executar evento retCep n° " & Err.Number & " descricao : " & replace( Err.Description,"'","" ) & "')< /script>"
retCep = "<script language='javascript'>alert('Erro ao executar evento retCep n° " & Err.Number & " descricao : " & replace( Err.Description,"'","" ) & "')< /script>"
End If
End Function
Expand Down

0 comments on commit 10b4070

Please sign in to comment.