<% '##### ADMINISTRADOR' If Request("acaba") = "sim" Then Session("adm_email") = "" Session("adm_descprod") = "" End If Select Case strAcao Case "inserir" strTextoHtml = strTextoHtml & " Incluir novo administrador na loja
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" varimg = " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Data:" & dia & "/" & mez & "/" & Year(Date) & "
Login: "sim" Then strTextoHtml = strTextoHtml & Request.QueryString("erro1") End If strTextoHtml = strTextoHtml & """ size=50 maxlenght=50 style=font-size:11px;font-family:tahoma>" If Request.QueryString("erro1") = "sim" Then strTextoHtml = strTextoHtml & varimg End If strTextoHtml = strTextoHtml & "
Senha: "sim" Then strTextoHtml = strTextoHtml & Request.QueryString("erro2") End If strTextoHtml = strTextoHtml & """ style=font-size:11px;font-family:tahoma>" If Request.QueryString("erro2") = "sim" Then strTextoHtml = strTextoHtml & varimg End If strTextoHtml = strTextoHtml & "
Email: "sim" Then strTextoHtml = strTextoHtml & Request.QueryString("erro3") End If strTextoHtml = strTextoHtml & """ style=font-size:11px;font-family:tahoma>" If Request.QueryString("erro3") = "sim" Then strTextoHtml = strTextoHtml & varimg End If strTextoHtml = strTextoHtml & "
 
    


Voltar para página inicial

" Case "gravanovo" login = Trim(Request.Form("login")) senha = Trim(Request.Form("senha")) email = Trim(Request.Form("email")) textosql = "SELECT * FROM ACESSO WHERE LOGIN='"&Cripto(login,true)&"' AND SENHA= '"&Cripto(senha,true)&"' AND EMAIL= '"&Cripto(email,true)&"'" Set pesqadm = conexao.Execute(textosql) IF NOT pesqadm.EOF THEN strTextoHtml = strTextoHtml & " Administrador já está cadastrado
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Data:" & dia & "/" & mez & "/" & Year(Date) & "
Nome do administrador:" & login & "

Voltar para página inicial


" ELSE If login = "" Or senha = "" OR email = "" Then If login = "" Then erro1 = "sim" Else erro1 = login End If If senha = "" Then erro2 = "sim" Else erro2 = senha End If If email = "" Then erro3 = "sim" Else erro3 = email End If Response.Redirect "?link=admin&acao=inserir&erro1=" & erro1 & "&erro2=" & erro2&"&erro3="&erro3 End If textosql = "INSERT INTO ACESSO (LOGIN,SENHA,EMAIL) VALUES ('"& Cripto(login,true) &"','"& Cripto(senha,true) &"','"& Cripto(email,true) &"')" Set gravaadm = conexao.Execute(textosql) strTextoHtml = strTextoHtml & " Administrador cadastrado com sucesso
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Data:" & dia & "/" & mez & "/" & Year(Date) & "
Nome do administrador:" & login & "

Voltar para página inicial


" END IF Case "editar" SQL = "SELECT * FROM ACESSO WHERE IDACESSO="&Session("IdAdm") Set Rs = conexao.Execute(SQL) IF NOT Rs.eof Then strTextoHtml = strTextoHtml & " Alteraração de senha
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" varimg = " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Data:" & dia & "/" & mez & "/" & Year(Date) & "
Login:" strTextoHtml = strTextoHtml & "
Senha:" If Request.QueryString("erro1") = "sim" Then strTextoHtml = strTextoHtml & varimg End If strTextoHtml = strTextoHtml & "
Email:" If Request.QueryString("erro2") = "sim" Then strTextoHtml = strTextoHtml & varimg End If strTextoHtml = strTextoHtml & "
 
    


Voltar para página inicial

" ELSE strTextoHtml = strTextoHtml & " Alteraração de senha
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja


" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "Não foi encontrado o seus dados na base.
Contate o WebMaster responsável." strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Voltar para página inicial
" END IF Case "final" senha = Trim(Request.Form("senha")) email = Trim(Request.Form("email")) If senha = "" or email = "" Then If senha = "" Then erro1 = "sim" Else erro1 = senha End If If email = "" Then erro2 = "sim" Else erro2 = email End If Response.Redirect "?link=adm&acao=editar&erro1=" & erro1 &"&erro2=" & erro2 End If textosql = "UPDATE ACESSO SET SENHA='"& Cripto(senha,true) &"', EMAIL='"& Cripto(email,true) &"' WHERE IDACESSO="&Session("IdAdm") Set gravaadm = conexao.Execute(textosql) strTextoHtml = strTextoHtml & " Senha alterada com sucesso
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Data:" & dia & "/" & mez & "/" & Year(Date) & "
Nome do administrador:" & Ucase(Session("nome")) & "
Email do administrador:" & email & "

Voltar para página inicial


" Case "excluir" IF Request.QueryString("Adm") = "" THEN SQL = "SELECT * FROM ACESSO WHERE IDACESSO <> 1" SET RS = conexao.Execute(SQL) IF NOT Rs.EOF THEN strTextoHtml = strTextoHtml & " Exclusão de administradores
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja


" cont = 1 do while not rs.eof strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
"&Cont&")  "&DecodeBase64(Rs("LOGIN"))&"Ação: " strTextoHtml = strTextoHtml & "Excluir 
" strTextoHtml = strTextoHtml & "
" Rs.MoveNext cont = cont + 1 Loop strTextoHtml = strTextoHtml & "
Voltar para página inicial
" ELSE strTextoHtml = strTextoHtml & " Exclusão de administradores
" strTextoHtml = strTextoHtml & "
Inserir um novo administrador na loja


" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "Não existem administradores cadastrados, além do default" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
Voltar para página inicial
" END IF ELSE SQL = "DELETE FROM ACESSO WHERE IDACESSO = "&Request.QueryString("Adm") SET RS = conexao.Execute(SQL) Response.Redirect "?link=adm&acao=excluir&acaba=sim" END IF End Select %>