
<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/classDbPager.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->



<html>
<head>
<title>后台管理-网站基本参数恢复</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css">
</head>

<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
Function Filehaveno(FileName)
set ffso=server.createobject("Scripting.FileSystemObject")
Filehaveno=ffso.FileExists(server.mappath(Filename))
set ffso=nothing
End Function
%>
<%
if request("action")="" then
	call main()
elseif request("action")="restore" then
	call restore()
else

end if
%>
<%
sub main()
%>
<script language="javascript" type="text/javascript">

function check_n()
{
if(document.form_n.dbname_n.value=="")
{
alert("请输入数据库备份的名字")
return
}
document.form_n.next_n.value='正在恢复，请稍等....'
document.form_n.submit()
}
</script>
<form name="form_n" method="POST" action="?action=restore"> 
  <TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder"> 
    <tr> 
      <th height=25 colspan="2" class="tableHeaderText">网站基本参数恢复</th> 
    </tr> 
    <TR ALIGN="center"> 
      <TD> <TABLE width="100%" border="0" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse"> 
          <TR> 
            <TD width="210" align="right" class="Forumrow"><b>恢复的文件：</b></TD> 
            <TD width="729" class="Forumrow"> 
			  <font color="#F4FAFF"> 
			  <select name="dbname_n" size="1">
			  <%
			  set file1=server.CreateObject("scripting.FileSystemObject")
			  set folder1=file1.GetFolder(""&server.mappath("../../backup")&"")
			  for each thing in folder1.Files
			 ' dbname_1=split(thing,"backup\")
			  dbname_2=thing.name	  
			  %>            
			  <option value="<%=dbname_2%>"><%=dbname_2%></option>
			  
			  <%next%>
			  </select>
<input type="button" name="next_n" value="立刻恢复" class="smallInput"  onclick="check_n()">
			  </font></TD> 
          </TR>		


          
      </TABLE></TD> 
    </TR> 
  </TABLE> 
</FORM>

  <%
  end sub
  %>  
<%
sub restore()
	dbname=request("dbname_n")
	Pa="../../p_inc"
	Set d_file1=server.CreateObject(G_FSO)
	set d_folder1=d_file1.GetFolder(""&server.mappath(Pa)&"")
	d_file1.CopyFile server.MapPath("../../backup/"&dbname),server.MapPath(Pa&"/config.asp")	
	response.Write "<script>alert('基本设置恢复成功恢复成功');history.back(-1)</script>"
	response.End()
end sub
%>
</body>
</html>

