<!--#include file="../common/conn.asp"-->
<%
'检查用户权限
call checkuser("数据库管理")
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE>
BODY {
	FONT-SIZE: 9pt
}
TABLE {
	FONT-SIZE: 9pt
}
TH {
	FONT-WEIGHT: 500; FONT-SIZE: 9pt
}
A:link {
	COLOR: #ff0000; TEXT-DECORATION: none
}
A:visited {
	TEXT-DECORATION: none
}
A:active {
	TEXT-DECORATION: none
}
A:hover {
	COLOR: #9933ff; TEXT-DECORATION: underline
}

</STYLE>
<title>数据库管理</title></head>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
<%
Dim Atcion
Atcion=Request.QueryString ("atcion")
if Atcion="res" then
	dbpath=server.MapPath ("../../data/#data.mdb")
	resdbname=server.MapPath("../Databackup")&"/"&Request.QueryString ("fid")
	Set Fso=server.createobject("scripting.filesystemobject")
	If fso.fileexists(dbpath) and fso.fileexists(resdbname) Then
		Fso.copyfile resdbname,dbpath
	response.write("数据库成功恢复")
	response.end
	else
	response.write("错误，原文件或目录文件不存在")
	end if
	set fso=nothing
end if
if Atcion="del" then
	deldbname=server.MapPath("../Databackup")&"/"&Request.QueryString ("fid")
	Set Fso=server.createobject("scripting.filesystemobject")
	If fso.fileexists(deldbname) Then
		Fso.deletefile deldbname
	else
	response.write("错误，原文件或目录文件不存在")
	end if
	set fso=nothing
end if
%> 
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
set objfolder=fs.getfolder(server.MapPath("../Databackup"))
set colfiles=objfolder.files%> 
<table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#336600">
  <tr> 
    <td height="26" bgcolor="#669900"> <font color="#FFFFFF"><strong>::数据库管理－数据恢复</strong></font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td height="100%" valign="top"> 
      <table width="98%" border="1" align="center" cellpadding="5" cellspacing="0">
        <tr bgcolor="#669900"> 
          <td height="25" bgcolor="#669900"><strong><font color="#FFFFFF">备份名称</font></strong></td>
          <td><strong><font color="#FFFFFF">备份日期</font></strong></td>
          <td><strong><font color="#FFFFFF">大小</font></strong></td>
          <td><strong><font color="#FFFFFF">操作</font></strong></td>
        </tr>
        <%for each objfile in colfiles %>
        <tr> 
          <td height="25"><a href=><B><%=objfile.name%></B></a></td>
          <td><%=objfile.datecreated%></td>
          <td><%=objfile.size/1024%>KB</td>
          <td>[<a href="?atcion=res&fid=<%=objfile.name%>"><font color="#000000">恢复</font></a>][<a href="?atcion=del&fid=<%=objfile.name%>"><font color="#000000">删除</font></a>]</td>
        </tr>
        <%next%>
      </table> 
    </td>
  </tr>
</table>
</body>
</html>