<% '##### UTILITÁRIO 'Sub UtilASP If Request("acaba") = "sim" Then Session("adm_descprod") = "" Session("adm_email") = "" End If Select Case strAcao case "atendimentoon" '##### A.O.L IMPLEMENTADO POR ROGÉRIO SILVA strTextoHtml = strTextoHtml & " Utilitários (Atendimento Online)
" strTextoHtml = strTextoHtml & "

Abra o link abaixo para iniciar o seu atendimento on-line

Iniciar atendimento

" strTextoHtml = strTextoHtml & "



Voltar para Página Inicial

" case "ftp" strTextoHtml = strTextoHtml & " Utilitários (Gerenciador de Arquivos)
" '######################################################################### '######################################################################### Server.ScriptTimeout = 60 If Request("metodo") = "1" Then Response.Expires = 0 byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin 'variaveis Set fso = Server.CreateObject("Scripting.FileSystemObject") Path = Replace(Trim(UploadRequest.Item("Pasta").Item("Value")), "~barra~", "\") If CStr(Path) = CStr("") Then Path = Replace(Server.MapPath("administrador.asp"), "administrador.asp", "") End If arq = Trim(UploadRequest.Item("arq").Item("Value")) ContentType = UploadRequest.Item("arq").Item("ContentType") filepathname = UploadRequest.Item("arq").Item("FileName") FileName = Right(filepathname, Len(filepathname) - InStrRev(filepathname, "\")) If CStr(FileName) = CStr("") Or InStr(FileName, """") <> 0 Or InStr(FileName, "'") <> 0 Or InStr(FileName, "%") <> 0 Or InStr(FileName, "@") <> 0 Or InStr(FileName, "¨") <> 0 Or InStr(FileName, "=") <> 0 Or InStr(FileName, "+") <> 0 Or InStr(FileName, "!") <> 0 Or InStr(FileName, "$") <> 0 Or InStr(FileName, "#") <> 0 Or InStr(FileName, "&") <> 0 Or InStr(FileName, "/") <> 0 Or InStr(FileName, "\") <> 0 Or InStr(FileName, ":") <> 0 Or InStr(FileName, "*") <> 0 Or InStr(FileName, "?") <> 0 Or InStr(FileName, "|") <> 0 Or InStr(FileName, "<") <> 0 Or InStr(FileName, ">") <> 0 Then Response.Redirect "administrador.asp?link=util&acao=ftp&acaba=sim&Pasta=" & Path & "&erroarq=sim" Exit Sub End If Set ts = fso.GetFolder(Path) For Each Arquiv In ts.Files If CStr(Arquiv.Name) = CStr(FileName) Then Response.Redirect "administrador.asp?link=util&acao=ftp&acaba=sim&Pasta=" & Path & "&erroarq=mesmo" Exit For End If Next Set ts = Nothing Set fso = Nothing Value = UploadRequest.Item("arq").Item("Value") Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") If CStr(Path) = CStr(Replace(Server.MapPath("administrador.asp"), "administrador.asp", "")) Then Set MyFile = ScriptObject.CreateTextFile(Path & FileName) Else Set MyFile = ScriptObject.CreateTextFile(Path & "\" & FileName) End If For I = 1 To LenB(Value) MyFile.Write Chr(AscB(MidB(Value, I, 1))) Next MyFile.Close Set MyFile = Nothing Set ScriptObject = Nothing Set UploadRequest = Nothing Response.Redirect "administrador.asp?link=util&acao=ftp&acaba=sim&Pasta=" & Path Else Path = Replace(Request("Pasta"), "~barra~", "\") If Path = "" Then Path = Replace(Server.MapPath("administrador.asp"), "administrador.asp", "") End If strTextoHtml = strTextoHtml & "
" '######################################################################### '######################################################################### Set fso = Server.CreateObject("Scripting.FileSystemObject") Set ts = fso.GetFolder(Path) If CStr(Request("action")) = CStr("createfolder") Then For Each Pasta In ts.Subfolders If CStr(Pasta.Name) = CStr(Request("novapasta")) Then ErroUPasta = "sim" Response.Write "" End If Next End If If CStr(Request("action")) = CStr("createfolder") And ErroUPasta <> "sim" Then If CStr(Request("novapasta")) = CStr("") Or InStr(Request("novapasta"), """") <> 0 Or InStr(Request("novapasta"), "'") <> 0 Or InStr(Request("novapasta"), "%") <> 0 Or InStr(Request("novapasta"), "@") <> 0 Or InStr(Request("novapasta"), "¨") <> 0 Or InStr(Request("novapasta"), "=") <> 0 Or InStr(Request("novapasta"), "+") <> 0 Or InStr(Request("novapasta"), "!") <> 0 Or InStr(Request("novapasta"), "$") <> 0 Or InStr(Request("novapasta"), "#") <> 0 Or InStr(Request("novapasta"), "#") <> 0 Or InStr(Request("novapasta"), "&") <> 0 Or InStr(Request("novapasta"), "/") <> 0 Or InStr(Request("novapasta"), "\") <> 0 Or InStr(Request("novapasta"), ":") <> 0 Or InStr(Request("novapasta"), "*") <> 0 Or InStr(Request("novapasta"), "?") <> 0 Or InStr(Request("novapasta"), "|") <> 0 Or InStr(Request("novapasta"), "<") <> 0 Or InStr(Request("novapasta"), ">") <> 0 Then Response.Write "" Else If CStr(Path) = CStr(Replace(Server.MapPath("administrador.asp"), "administrador.asp", "")) Then fso.CreateFolder (Path & Request("novapasta")) Else fso.CreateFolder (Path & "/" & Request("novapasta")) End If End If End If If Request.QueryString("action") = "delete" Then Nomedoarquivo = Replace(Replace(Request.QueryString("filename"), "~ponto~", "."), "~barra~", "\") If Request.QueryString("type") = "file" Then fso.DeleteFile (Nomedoarquivo) End If If Request.QueryString("type") = "folder" Then fso.DeleteFolder (Replace(Replace(Request.QueryString("folder"), "~ponto~", "."), "~barra~", "\")) End If End If If Right(Path, 1) = "\" Then Path = Mid(Path, 1, Len(Path) - 1) End If pos = InStrRev(Path, "\") Vstr = Left(Path, pos) If CStr(Request("erroarq")) = CStr("sim") Then Response.Write "" End If If CStr(Request("erroarq")) = CStr("mesmo") Then Response.Write "" End If If CStr(Request("erroarq")) = CStr("tamanho") Then Response.Write "" End If parentdirectory = Vstr strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
  Listagem de arquivos de...
  " & Path & "\
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "  " If Not CStr(Path & "\") = CStr(Replace(Server.MapPath("administrador.asp"), "administrador.asp", "")) Then strTextoHtml = strTextoHtml & " " Else strTextoHtml = strTextoHtml & " " End If strTextoHtml = strTextoHtml & " Diretório Acima       
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
 Nome Tamanho Tipo Opções
" strTextoHtml = strTextoHtml & "" I = 0 For Each SubF In ts.Subfolders I = I + 1 If Right(Path, 1) = "\" Then FolderPath = Path & SubF.Name Else FolderPath = Path & "\" & SubF.Name End If Pathz = Replace(FolderPath, "\", "~barra~") strTextoHtml = strTextoHtml & "" & vbNewLine strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " Next If CStr(I) = CStr("0") Then ifzao = "sim" Else ifzao = "nao" End If I = 0 For Each File In ts.Files I = I + 1 If Right(Path, 1) = "\" Then WholeFile = Path & File.Name Else WholeFile = Path & "\" & File.Name End If NomeArquivo = "Arquivo " & UCase(Right(File.Name, 3)) fileSize = FormatNumber(File.Size / 1024, 0) If File.Size > 0 And fileSize = 0 Then fileSize = 1 End If TipoArquivoImg = "file.gif" WholeFile = Replace(Replace(WholeFile, ".", "~ponto~"), "\", "~barra~") Pathz = Replace(Path, "\", "~barra~") strTextoHtml = strTextoHtml & "" & vbNewLine WholeFile = Replace(WholeFile, "~ponto~", ".") strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " Next If CStr(I) = CStr("0") And ifzao = "sim" Then strTextoHtml = strTextoHtml & "" End If strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
" & SubF.Name & "
 Pasta de Arquivos Excluír
" & File.Name & "
" & fileSize & " Kb    " & NomeArquivo & " Download Excluír
Nenhum arquivo encontrado
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
  " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " Nova pasta:  " strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "  Novo Arquivo:  " strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" '######################################################################### '######################################################################### End If strTextoHtml = strTextoHtml & "

Voltar para Página Inicial

" '######################################################################### '######################################################################### case "exclui" set rs = conexao.execute("select idcompra from compras where status='Compra em Aberto'") if rs.eof then else do while not rs.eof 'Sem as 2 rotina, aparece "carrinhos-fantasmas" ... conexao.execute("delete * from pedidos where idcompra='" & rs("idcompra") & "'") conexao.Execute("delete * from compras where idcompra=" & rs("idcompra") & ";") rs.movenext loop end if rs.close set rs = nothing conexao.execute("delete from compras where status='Compra em Aberto'") response.redirect "administrador.asp?link=util&acao=limpar&sucesso=sim&acaba=sim" Case "limpar" strTextoHtml = strTextoHtml & " Utilitários (Otimizar banco de dados)
" set rs = conexao.execute("select count(idcompra) as total from compras where status='Compra em Aberto'") total_de_compras = rs("total") rs.close set rs = nothing if Request.QueryString("sucesso") = "sim" then strSucesso = UCASE("Banco de Dados otimizado com Sucesso!") else strSucesso = "" end if strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Clique no Botão 'Otimizar Agora!' para Efetuar a Operação.
Realize esta operação no minímo a cada 15 dias!
" & strSucesso & "


Voltar para Página Inicial
" case "executa" strSql = Request.QueryString("comando") strArea_transferencia = Request.QueryString("area_transferencia") 'grava a area de transferencia em cookies if strArea_transferencia<>"" then response.cookies("AreaTransferenciaSql")= strArea_transferencia response.cookies("AreaTransferenciaSql").Expires= #January 01, 2010# end if on error resume next conexao.execute(strSql) if err.number = 0 Then response.redirect "administrador.asp?link=util&acao=sql&sucesso=sim" else response.redirect "administrador.asp?link=util&acao=sql&erro=" & err.description end if case "stats" '#################################################### ' ESTATISTICAS DA LOJA VIRTUA STORE ' RESPONSÁVEL ROGÉRIO SILVA ' WEBMASTER_WB@BRFREE.COM.BR ' ICQ: 72674360 ' MSN: WORLDBILY@HOTMAIL.COM (SEG A SEX) '#################################################### strTextoHtml = strTextoHtml & " Utilitários (Estatísticas de acesso)
" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" '#################################################### strTextoHtml = strTextoHtml & "
 Estatísticas     Exportar? - Resetar Contadores?



" '#################################################### strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Navegadores Utilizados
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" 'Recupera informações sobre os browsers SQL_Navegador = "select * from browsers order by id desc" Set RS_Navegador = abredb.Execute(SQL_Navegador) total = 1 'Utiliza um contador para verificar o total -> isso para todos os ítens que são "pontuados" Do Until RS_Navegador.EOF total = total + RS_Navegador("acessos") RS_Navegador.MoveNext Loop RS_Navegador.MoveFirst '#################################################### Response.Cookies("VSOpenNavegador").Expires=#May 10,2010# '#################################################### Do Until RS_Navegador.EOF '#################################################### Response.Cookies("VSOpenNavegador")(RS_Navegador("browser")) = RS_Navegador("acessos") '#################################################### strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" RS_Navegador.MoveNext Loop strTextoHtml = strTextoHtml & "
NavegadoresHits
"&RS_Navegador("browser")&"
"&RS_Navegador("acessos")&"
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Hosts dos usuários
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" if VersaoDb = 1 then SQL_Host = "select * from hosts LIMIT 0,20" else SQL_Host = "select top 20 * from hosts order by id desc" end if Set RS_Host = abredb.Execute(SQL_Host) cont = 1 Do Until RS_Host.EOF strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" RS_Host.MoveNext cont =cont +1 Loop strTextoHtml = strTextoHtml & "
Origem (Últimos 20 acessos)
"&right("00"&cont,2)&""&RS_Host("host")&"
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
Referências ao site
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" if VersaoDb = 1 then SQL_Referencia = "select * from referencias LIMIT 0,20" else SQL_Referencia = "select top 20 * from referencias order by id desc" end if Set RS_Referencia = abredb.Execute(SQL_Referencia) Do Until RS_Referencia.EOF strTextoHtml = strTextoHtml & "" RS_Referencia.MoveNext Loop strTextoHtml = strTextoHtml & "
Páginas utilizadas como link (Últimos 20 acessos)
"&RS_Referencia("referencia")&"
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
Visualização por Meses
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" SQL_Mes = "select * from meses order by id desc" Set RS_Mes = abredb.Execute(SQL_Mes) total = 1 Do Until RS_Mes.EOF total = total + RS_Mes("acessos") RS_Mes.MoveNext Loop RS_Mes.MoveFirst Do Until RS_Mes.EOF strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" RS_Mes.MoveNext Loop strTextoHtml = strTextoHtml & "
MêsHits
"&MonthName(RS_Mes("mes"))&"
"&RS_Mes("acessos")&"
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "
Visualização por Dias da Semana
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" SQL_Semana = "select * from semana order by id desc" Set RS_Semana = abredb.Execute(SQL_Semana) total = 1 Do Until RS_Semana.EOF total = total + RS_Semana("acessos") RS_Semana.MoveNext Loop RS_Semana.MoveFirst Do Until RS_Semana.EOF strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" RS_Semana.MoveNext Loop strTextoHtml = strTextoHtml & "
Dia da SemanaHits
"& WeekdayName(Weekday(RS_Semana("dia_semana"),1))&"
"&RS_Semana("acessos")&"
" strTextoHtml = strTextoHtml & "

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
Visualização por Horários
" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & " " strTextoHtml = strTextoHtml & "" SQL_Hora = "select * from horas order by id desc" Set RS_Hora = abredb.Execute(SQL_Hora) total = 1 Do Until RS_Hora.EOF total = total + RS_Hora("acessos") RS_Hora.MoveNext Loop RS_Hora.MoveFirst Do Until RS_Hora.EOF strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" RS_Hora.MoveNext Loop strTextoHtml = strTextoHtml & "
HoráriosHits
"&RS_Hora("hora")&"
"&RS_Hora("acessos")&"
©Rogério Silva
" case "sql" strTextoHtml = strTextoHtml & " Utilitários (SQL Manager)
" if Request.QueryString("sucesso") = "sim" then strSucesso = UCASE("O Comando Foi Executado Com Sucesso!") else strSucesso = "" end if erro = Request.QueryString("erro") if erro <> "" then strSucesso = "Ocorreu o Seguinte Erro ao Executar:
" & erro & "
" end if area_transferencia = Request.Cookies("AreaTransferenciaSql") strTextoHtml = strTextoHtml & "
" strTextoHtml = strTextoHtml & "Utilize o SQL Manager Para Executar Comandos SQL Como: INSERT, UPDATE, DELETE, etc...
ATENÇÃO!! Qualquer Comando acima Executado no SQL Manager é Irreversível!!

   Para executar comandos SELECT clique aqui para abrir uma nova janela para melhor visualização

" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "
" & strSucesso &"
Comando SQL
Área de Transferência


Voltar para Página Inicial
" '######################################################## case "export" '######################################################## strTextoHtml = strTextoHtml & " Utilitários (Estatísticas de acesso - Exportação)
" strTextoHtml = strTextoHtml & "
Estatísticas     Exportar - Resetar Contadores


" '######################################################## Response.Buffer = true '------------------------------------------------- '------ DECLARANDO AS VARIAVEIS NO SERVIDOR ------ '------------------------------------------------- Dim Fso,ArqLog,Caminho,Gravar,Arquivo '-------------------------------------------------------------------------------- '------ DECLARANDO AS CONSTANTES ------ '-------------------------------------- Const ForReading = 1,ForAppending = 8, tristateTrue = -1, tristateFalse = 0 '-------------------------------------- Set Fso = Server.CreateObject("Scripting.FileSystemObject") '-------------------------------------- Gravar = Mid(Request.ServerVariables("PATH_TRANSLATED"),1,(Len(Request.ServerVariables("PATH_TRANSLATED"))-17) ) Gravar = Gravar &"database\estatisticas.dat" '-------------------------------------- Caminho = Fso.GetAbsolutePathName(Gravar) Arquivo = Fso.GetFileName(Caminho) '-------------------------------------- IF Fso.FileExists(Caminho) Then Fso.DeleteFile Arquivo,True END IF '-------------------------------------- Set ArqLog = Fso.CreateTextFile(Gravar,True) '-------------------------------------- ArqLog.WriteLine ("#----------------------------------------------#") ArqLog.WriteLine ("# ESTATÍSTICAS DA LOJA VIRTUA STORE #") ArqLog.WriteLine ("# GERADO EM: "&now()&" hs #") ArqLog.WriteLine ("# Copyright: Rogério Silva #") ArqLog.WriteLine ("# http://worldbily.cjb.net #") ArqLog.WriteLine ("#----------------------------------------------#") ArqLog.WriteBlankLines 1 '-------------------------------------------------------------------------------------------------------------------- '##### NAVEGADORES UTILIZADOS '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ("# Navegadores Utilizados") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ("# Navegadores|Hits ") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- 'Recupera informações sobre os browsers SQL_Navegador = "select * from browsers" Set RS_Navegador = abredb.Execute(SQL_Navegador) '-------------------------------------------------------------------------------------------------------------------- total = 1 '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Navegador.EOF total = total + RS_Navegador("acessos") RS_Navegador.MoveNext Loop '-------------------------------------------------------------------------------------------------------------------- RS_Navegador.MoveFirst '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Navegador.EOF '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ( RS_Navegador("browser")&"|"&RS_Navegador("acessos")) '-------------------------------------------------------------------------------------------------------------------- RS_Navegador.MoveNext Loop ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") '-------------------------------------------------------------------------------------------------------------------- '##### HOSTS UTILIZADOS '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ("# Hosts dos usuários ") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Origem (Últimos 20 acessos)") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- if VersaoDb = 1 then SQL_Host = "select * from hosts LIMIT 0,20" else SQL_Host = "select top 20 * from hosts" end if Set RS_Host = abredb.Execute(SQL_Host) cont = 1 '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Host.EOF ArqLog.WriteLine ( right("00"&cont,2)&"|"&RS_Host("host")) '-------------------------------------------------------------------------------------------------------------------- RS_Host.MoveNext cont =cont +1 Loop ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") '-------------------------------------------------------------------------------------------------------------------- '##### REFERENCIAS DE ENTRADA '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Referências ao site ") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "#Páginas utilizadas como link (Últimos 20 acessos)") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- if VersaoDb = 1 then SQL_Referencia = "select * from referencias LIMIT 0,20" else SQL_Referencia = "select top 20 * from referencias" end if Set RS_Referencia = abredb.Execute(SQL_Referencia) '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Referencia.EOF '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ( RS_Referencia("referencia")) RS_Referencia.MoveNext Loop ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") '-------------------------------------------------------------------------------------------------------------------- '##### VISUALIZAÇOES POR MESES '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Visualização por Meses ") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Mês|Hits") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- SQL_Mes = "select * from meses" Set RS_Mes = abredb.Execute(SQL_Mes) '-------------------------------------------------------------------------------------------------------------------- total = 1 '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Mes.EOF total = total + RS_Mes("acessos") RS_Mes.MoveNext Loop '-------------------------------------------------------------------------------------------------------------------- RS_Mes.MoveFirst '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Mes.EOF '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ( MonthName(RS_Mes("mes"))&"|"&RS_Mes("acessos")) '-------------------------------------------------------------------------------------------------------------------- RS_Mes.MoveNext Loop ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") '-------------------------------------------------------------------------------------------------------------------- '##### VISUALIZAÇOES POR SEMANA '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Visualização por Dias da Semana") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Dia da Semana|Hits ") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- SQL_Semana = "select * from semana" Set RS_Semana = abredb.Execute(SQL_Semana) '-------------------------------------------------------------------------------------------------------------------- total = 1 '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Semana.EOF total = total + RS_Semana("acessos") RS_Semana.MoveNext Loop '-------------------------------------------------------------------------------------------------------------------- RS_Semana.MoveFirst '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Semana.EOF ArqLog.WriteLine ( WeekdayName(Weekday(RS_Semana("dia_semana"),1))&"|"&RS_Semana("acessos")) '-------------------------------------------------------------------------------------------------------------------- RS_Semana.MoveNext Loop ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") '-------------------------------------------------------------------------------------------------------------------- '##### VISUALIZAÇOES POR HORA '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Visualização por Horários") ArqLog.WriteLine ("#------------------------") ArqLog.WriteLine ( "# Horários|Hits ") ArqLog.WriteLine ("#------------------------") '-------------------------------------------------------------------------------------------------------------------- SQL_Hora = "select * from horas" Set RS_Hora = abredb.Execute(SQL_Hora) '-------------------------------------------------------------------------------------------------------------------- total = 1 '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Hora.EOF total = total + RS_Hora("acessos") RS_Hora.MoveNext Loop '-------------------------------------------------------------------------------------------------------------------- RS_Hora.MoveFirst '-------------------------------------------------------------------------------------------------------------------- Do Until RS_Hora.EOF '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteLine ( RS_Hora("hora")&"|"&RS_Hora("acessos")) '-------------------------------------------------------------------------------------------------------------------- RS_Hora.MoveNext Loop '-------------------------------------------------------------------------------------------------------------------- ArqLog.WriteBlankLines 1 ArqLog.WriteLine ("**************************************************") ArqLog.WriteLine ("http://worldbily.cjb.net - © Rogério Silva") ArqLog.WriteLine ("**************************************************") '-------------------------------------- ArqLog.close IF Fso.FileExists(Caminho) Then strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "" strTextoHtml = strTextoHtml & "

Arquivo gerado com sucesso, aguarde 5 segundos para iniciar o download.

Caso o download não inicie, clique aqui para iniciar o download." END IF strTextoHtml = strTextoHtml & "

" Response.Clear Response.Flush '######################################################## case "down" Response.Buffer = true '######################################################## strTextoHtml = strTextoHtml & " Utilitários (Estatísticas de acesso - Exportação)
" strTextoHtml = strTextoHtml & " Estatísticas - Exportar - Resetar Contadores
" '######################################################## response.AddHeader "Content-Type","application/x-msdownload" response.AddHeader "Content-Disposition","attachment; filename=estatisticas.dat" Response.Flush Const adTypeBinary = 1 Dim strFilePath Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = adTypeBinary objStream.LoadFromFile Server.MapPath("database/estatisticas.dat") Response.BinaryWrite objStream.Read objStream.Close Set objStream = Nothing Response.Flush Response.Clear '######################################################## case "zero" '######################################################## strTextoHtml = strTextoHtml & " Utilitários (Estatísticas de acesso - Resetar contadores)
" strTextoHtml = strTextoHtml & " Estatísticas - Exportar - Resetar Contadores
" '######################################################## strTextoHtml = strTextoHtml & "" '######################################################## case "vendas" '######################################################## Set zera_vendas = conexao.Execute("UPDATE produtos SET vendas = 0;") response.redirect "administrador.asp?link=produtos&acao=estoque&acaba=sim" '######################################################## case "contador" '######################################################## strTextoHtml = strTextoHtml & " Utilitários (Zerar Contador)
" '######################################################## '-------------------------------------- Set Fso = Server.CreateObject("Scripting.FileSystemObject") '-------------------------------------- Arquivo = Mid(Request.ServerVariables("PATH_TRANSLATED"),1,(Len(Request.ServerVariables("PATH_TRANSLATED"))-17) ) Arquivo = Arquivo &"contador.log" Caminho = Fso.GetAbsolutePathName(Arquivo) '-------------------------------------- IF Fso.FileExists(Caminho) Then Fso.DeleteFile Arquivo,True END IF '-------------------------------------- strTextoHtml = strTextoHtml & " 
  • Contador zerado com sucesso!
  • " '######################################################## case "banner" response.redirect "banner/admin" case "manut" response.redirect "manutencao/index.asp" end select 'End Sub %>