<!--#include file="../siteconfig/conn.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<HTML>
<HEAD>
<TITLE>分类管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />
</HEAD>
<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<%dim BakDbPath,Site_Url
BakDbPath=Request("BakDbPath")
Site_Url=Request("Site_Url")
Site_Copyright=Request("Site_Copyright")
Menu=Request("Menu")
if Menu="BakDbPath" then
   Set MyFileObject=Server.CreateOBject("Scripting.FileSystemObject")
		MyFileObject.CopyFile ""&Server.MapPath(SiteDb)&"",""&Server.MapPath(Request.Form("BakDbPath"))&""
		Response.Write("<script language=javascript>alert('备份成功！');javascript:history.go(-1)</script>")
end if
if Menu="bakhf" then
   Set MyFileObject=Server.CreateOBject("Scripting.FileSystemObject")
   if MyFileObject.FileExists(Server.MapPath(Request.Form("BakDbPath"))) then
		MyFileObject.CopyFile ""&Server.MapPath(Request.Form("BakDbPath"))&"",""&Server.MapPath(SiteDb)&""
		Response.Write("<script language=javascript>alert('恢复成功！');javascript:history.go(-1)</script>")
	else
	    Response.Write("<script language=javascript>alert('备份数据库不存在！');javascript:history.go(-1)</script>")
	end if
end if
%>
<h3>数据库管理</h3>
<form name="BakDbFrom" method="post" action="?Menu=BakDbPath" id="BakDbFrom">
<table width="96%" border="0" align="center" cellpadding="5" cellspacing="1" class="tb tb2 fixpadding">
  <tr>
    <td width="34%" class="vtop lineheight">数据库地址：</td>
    <td width="66%" class="vtop lineheight"><%=SiteDb%></td>
  </tr>
  <tr>
    <td class="vtop lineheight">备份的数据库路径：<br /></td>
    <td class="vtop lineheight"><input size="30" value="<%=replace(""&SiteDb&"",".mdb","("&Date()&").mdb")%>" name="BakDbPath"></td>
  </tr>
  <tr>
    <td class="vtop lineheight">&nbsp;</td>
    <td><input name="Submit" type="submit" class="SubmitCss" value="备 份"></td>
  </tr>
</table>
</form>
<br />
<form name="bakhfDbFrom" method="post" action="?Menu=bakhf" id="bakhfDbFrom">
<table width="96%" border="0" align="center" cellpadding="5" cellspacing="1" class="tb tb2 fixpadding">
  <tr>
    <td class="vtop lineheight">备份的数据库路径：<br /></td>
    <td class="vtop lineheight"><input size="30" value="<%=replace(""&SiteDb&"",".mdb","("&Date()&").mdb")%>" name="BakDbPath"></td>
  </tr>
  <tr>
    <td width="34%" class="vtop lineheight">数据库地址：</td>
    <td width="66%" class="vtop lineheight"><%=SiteDb%></td>
  </tr>
  <tr>
    <td class="vtop lineheight">&nbsp;</td>
    <td class="vtop lineheight"><input name="Submit" type="submit" class="SubmitCss" value="恢 复" onClick='javascript:return confirm("确定要恢复数据库吗?");'></td>
  </tr>
</table>
</form>
</BODY>
</HTML>

