<%@language=vbscript codepage=936 %>
<%path="../basedata"%>
<!--#include file="../inc/function.asp"-->
<%call Loginpower%>
<%call legalpower%>
<!--#include file="../conn/conn_data.asp"-->

<!-- #include file="../Inc/Head.asp" -->
<%
if request.querystring("action")="R e s e t o r e" then
call backupdata
else
%>
<br/><br/><br/><br/>
<div style="text-align:center;">
<table width="560" align="center" border="1" bordercolor="#A5B6D6" cellpadding="0" cellspacing="2" class="center">
        <tr> 
          <td class="southidc" height="25"> <div align="center"><strong>恢复数据库</strong></div>
</td>
        </tr>
        <tr class="tr_southidc"> 
          <form method="post" action="?action=R e s e t o r e">
            <td><br> 
              <table width="91%" border="0" align="center" cellpadding="0" cellspacing="2">
                <tr> 
                  <td height="25"><strong>恢复数据库文件</strong>[需要FSO权限]</td>
                </tr>
                <tr> 
                  <td height="22"> 当前数据库路径</td>
                </tr>
                <tr> 
                  <td height="22"><input type="text" size="50" name="DBpath" value="data/data.mdb"></td>
                </tr>
                <tr> 
                  <td height="22">恢复数据库名称[如恢复目录有该文件，将覆盖，如没有，将自动创建]</td>
                </tr>
                <tr> 
                  <td height="22"><input type="text" size="30" name="hfdbname" value="<%=date()%>"></td>
                </tr>
                  <tr> 
                  <td height="22">请入指定恢复的日期数据，如：<%=date()%></td>
                </tr>
                <tr> 
                  <td height="22"><div align="center"> 
                      <input type="submit" value="确定">
                    </div></td>
                </tr>
                <tr> 
                  <td height="22"><br> <br>
                    本程序的默认数据库文件为data/data.mdb<br>
                    您可以用这个功能来恢复您的法规数据，以保证您的数据安全！<br>
                    注意：所有路径都是相对与程序空间根目录的相对路径</td>
                </tr>
                <tr> 
                  <td height="22">&nbsp;</td>
                </tr>
              </table></td>
          </form>
        </tr>
      </table></div>
      <%end if%>
      <% 
sub backupdata() 
hffolder="../../backupdata/"
datename=request.form("hfdbname")
hfdbname=server.mappath(hffolder)&"/"&datename&".备份数据库"
bdata=server.mappath(db_data)
Set Fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(hfdbname) then 
fso.copyfile hfdbname,bdata
response.write errorback(datename&"数据恢复成功")
response.end
Else
response.write errorback("找不到您所需要恢复的文件。" )
response.end
End if
end sub
%>
<!-- #include file="../Inc/Foot.asp" -->