📄 admin.asp
字号:
<!--#include file="top.asp" -->
<%
'******************************
'
' 『头发乱了』单用户统计系统
' 张金义 2001_jinge@sohu.com
' http://www.99321.com
'
' 版权所有: 哈哈大侠
'
'******************************
%>
<% if Request.Cookies(feiyue)("Username")="" then
response.Redirect("login.asp?action=error")
end if%>
<%if Request.QueryString("action")="del" then
sql="delete fid from fcount"
conn.execute(sql)
response.write "<script>alert(""删除完毕"");</script>"
end if
if Request.QueryString("action")="del1" then
sql="delete fid from fcount"
conn.execute(sql)
sql="update vcount set vtoday=0,vyestaday=0,vtotal=0,vtotal1=0,vnowmonth=0,vpremonth=0,vnowyear=0,vweek=0,vstarttime='"&now()&"',vdate='"&date()&"'"
conn.execute(sql)
response.write "<script>alert(""清空完毕"");</script>"
end if
if Request.QueryString("action")="back" then
currf=request.form("currf")
currf=server.mappath(currf)
backf=request.form("backf")
backf=server.mappath(backf)
backfy=request.form("backfy")
on error resume next
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
response.end
end if
if objfso.Folderexists(backf) then
else
Set fy=objfso.CreateFolder(backf)
end if
objfso.copyfile currf,backf& "\"& backfy
response.write "<script>alert(""备份数据库成功"");history.back();</script>"
end if
if Request.QueryString("action")="ys" then
currf=request.form("currf")
currf = server.mappath(currf)
ys=request.form("ys")
Const JET_3X = 4
strDBPath = left(currf,instrrev(currf,"\"))
on error resume next
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
response.end
end if
if objfso.fileexists(currf) then
Set Engine = CreateObject("JRO.JetEngine")
on error resume next
If ys = 1 Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "fytemp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "fytemp.mdb"
End If
objfso.CopyFile strDBPath & "fytemp.mdb",currf
objfso.DeleteFile(strDBPath & "fytemp.mdb")
Set objfso = nothing
Set Engine = nothing
if err then
err.clear
response.write "<script>alert(""错误:很抱歉,由于系统错误,压缩失败:!"");history.back();</script>"
response.end
end if
response.write "<script>alert(""压缩数据库成功"");history.back();</script>"
response.end
Else
response.write "<script>alert(""错误:找不到数据库文件!"");history.back();</script>"
response.end
End If
end if
if Request.QueryString("action")="reload" then
currf=request.form("currf")
currf=server.mappath(currf)
backf=request.form("backf")
if backf="" then
response.write "<script>alert(""请输入您要恢复的数据库全名"");history.back();</script>"
else
backf=server.mappath(backf)
end if
on error resume next
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
response.end
end if
if objfso.fileexists(backf) then
objfso.copyfile ""&backf&"",""&currf&""
response.write "<script>alert(""恢复数据库成功"");history.back();</script>"
response.end
else
response.write "<script>alert(""错误:备份目录下无您的备份文件!"");history.back();</script>"
response.end
end if
end if
%>
<div align="center">
<center>
<table border=1 borderColor=<%=tdc2%> cellPadding=4 cellSpacing=1 width=<%=tdc3%> style="border-collapse: collapse" align=center>
<form name="form2" method="POST" action="admin.asp?action=del" >
<tr align="center">
<td colspan="2" class=tdc1 height=22 <%=hColor2%>>删除统计系统下的所有详细资料 | <a href=adminadmin.asp>管理资料更改</a> </td>
</tr>
<tr>
<td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc colspan="2">
<p align="center"> <input type="submit" name="Submit" value="删除" class=bdtj><br>
(为了数据库的执行速度,建议你隔段时间就执行此操作,此操作并不会将你的统计资料归零,只是删除了详细记录,但为了安全,建议你最好先备份)
</td>
</tr>
</form>
<form name="form2" method="POST" action="admin.asp?action=del1" >
<tr align="center">
<td colspan="2" <%=hColor2%> class=tdc1 height=22>
将所有统计归零</td>
</tr>
<tr align="center">
<td align="right" width="10%" bgcolor=<%=tColor2%> class=tdc colspan="2">
<p align="center"> <input type="submit" name="Submit" value="清空" class=bdtj><br>
(此操作将会将所有统计资料归零,请慎重使用)
</td>
</tr>
</form>
<form name="form1" method="POST" action="?action=back">
<tr align="center">
<td colspan="2" <%=hColor2%> class=tdc1 height=22>
备份数据库</td>
</tr>
<tr align="center">
<td bgcolor=<%=tColor2%> class=tdc height=22 colspan="2">你的空间只有支持fso才可以进行如下操作,否则你只能手动备份</td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>数据库路径:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="currf" size="20" value="<%=feiyuedbq%>"> </td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>备份数据目录:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="backf" size="20" value="back"> </td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>数据库名称:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="backfy" size="20" value="backcount.mdb"> </td>
</tr>
<tr>
<td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> </td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="Submit" value="提交" class=bdtj>
<input type="reset" name="Submit2" value="重置" class=bdtj>
</td>
</tr>
</form>
<form name="form1" method="POST" action="?action=ys">
<tr align="center">
<td colspan="2" <%=hColor2%> class=tdc1 height=22>
压缩数据库</td>
</tr>
<tr align="center">
<td bgcolor=<%=tColor2%> class=tdc height=22 colspan="2">你的空间只有支持fso才可以进行如下操作,否则你只能手动压缩</td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>数据库路径:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="currf" size="20" value="back/backcount.mdb">
</td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc colspan="2">
<p align="left"><input type="radio" value="1" name="ys">使用 Access 97 数据库<input type="radio" value="2" checked name="ys">使用
Access 2000 数据库</td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc colspan="2">
<p align="left">(为了安全,请注意用备份的数据库文件来压缩,不要用当前正在运行的数据库文件)</td>
</tr>
<tr>
<td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> </td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="Submit" value="提交" class=bdtj>
<input type="reset" name="Submit2" value="重置" class=bdtj>
</td>
</tr>
</form>
<form name="form1" method="POST" action="?action=reload">
<tr align="center">
<td colspan="2" <%=hColor2%> class=tdc1 height=22>
恢复数据库</td>
</tr>
<tr align="center">
<td bgcolor=<%=tColor2%> class=tdc height=22 colspan="2">你的空间只有支持fso才可以进行如下操作,否则你只能手动恢复</td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>当前数据库路径:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="currf" size="20" value="<%=feiyuedbq%>"> </td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>备份数据路径:</td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="text" name="backf" size="20" value="back/backcount.mdb"> </td>
</tr>
<tr>
<td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> </td>
<td bgcolor=<%=tColor2%> class=tdc>
<input type="submit" name="Submit" value="提交" class=bdtj>
<input type="reset" name="Submit2" value="重置" class=bdtj>
</td>
</tr>
</form>
</table>
</center>
</div>
<!--#include file="bq.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -