<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->
<%call chksunzom()
if instr(quanxs,"x8t")<=0 then call sunzomqx()
%>
<!-- #include file="../inc/md5.asp" -->

<html>
<head>
<title><%=dianming%> - 数据库还原</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">

</HEAD>
<BODY>
<%if request("hid1")="" then%> 
<form name="form1" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;数据还原   <input onclick="location.href='backup.asp'" value="数据备份"  type="button">  <input onclick="location.href='backup2.asp'" value="数据还原"  type="button">  <input onclick="location.href='backup3.asp'" value="压缩数据库"  type="button"></td>
	  <td align="right">　</td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
      <tr>
        <td height="30" colspan="2" align="center" class="category">你的空间只有支持fso才可以进行如下操作，否则你只能手动还原</td>
	  </tr>
      <tr class="a3">
        <td width="25%" height="30" align="right">当前数据库路径：</td>
        <td width="75%" class="category">
		  <input type="text" name="currf" size="30" value="data/sunzom_mcs.mdb" readonly="true">
		</td>	
	  </tr>	
	  <tr>
        <td height="30" align="right">备份数据库路径：</td>
        <td class="category">
		  <input type="text" name="backf" size="30" value="backup/back.mdb">
		</td>	
	  </tr> 	  
      <tr class="a3">
        <td align="center" colspan="2" class="category">
		  <input type="submit" value=" 确认还原 " class="button">
		  <input type="hidden" name="hid1" value="ok"></td>
      </tr>	    
</table>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</form>
<%
else
currf="../"&request.form("currf")
currf=server.mappath(currf)
backf="../"&request.form("backf")
if request.form("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
%>
</body>
</html>