<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>

<!-- #include file="sysconfig.asp" -->
<!--#include file="check.asp"-->


<%
if session("admin")="" or session("flag")<>"1" then
   response.write"<script language=javascript>alert('对不起，您的管理登陆方式出现异常，请重新尝试');top.location.href='admin_login.asp';</script>"
   response.end
end if

'定义数据库备份目录地址
backdbdir="../databackup"
function fsodbback()
on error resume next
dim obj_fso,backdbpath
backdbpath=server.mappath(backdbdir & "/bak_"&right(server.mappath(db),len(server.mappath(db))-instrrev(server.mappath(db),"\")))
set obj_fso=server.createobject("scripting.filesystemobject")
obj_fso.copyfile server.mappath(db),backdbpath,true
set obj_fso=nothing
if err.number<>0 then
fsodbback="<font color='#000000'><b>备份失败，请确保服务器支持fso，且 "&backdbdir&" 目录可写！</b></font>"
else
fsodbback="<font color='#000000'><b>备份数据库成功，数据库已成功备份到 "&backdbdir&" 目录中！</b></font>"
end if
end function

function htmlencode(byval s_string)
if isNULL(s_string) then
htmlencode=""
else
s_string=replace(s_string,"&","&amp;")
s_string=replace(s_string," ","&nbsp;")
s_string=replace(s_string,chr(34),"&quot;")
s_string=replace(s_string,"<","&lt;")
htmlencode=replace(s_string,">","&gt;")
end if
end function
function textencode(byval s_string)
if isNULL(s_string) then
textencode=""
else
s_string=replace(s_string,"&","&amp;")
s_string=replace(s_string,"<","&lt;")
textencode=replace(s_string,">","&gt;")
end if
end function
%>


<table cellpadding=0 cellspacing=0 align="center" class="noborder" height="14">
<tr>
<td style="height:6px;font-size:1px">&nbsp;</td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 align="center" style="border-top:0px;" class="tableborder">
<tr class="forumlead">
<td colspan=2 style="padding-left:12px;">系统数据库管理</td>
</tr>
<tr>
<td style="text-align:center"><br><br><br>
<table cellspacing="0" cellpadding="0" align="center" style="width:80%;#ffffff;border:solid #000000;border-width:1px 0 0 1px;">
<tr class="rowbg2">
<td style="padding:12px 12px 12px 40px;line-height:20px;"><font color="#000000"><b>数据库备份说明：</b></font><br>　　本操作将备份系统数据库到系统所在目录的 databackup 子目录中，必要时可进行恢复。但仍推荐将数据库备份到本地硬盘上。<br><br><font color="#000000"><b>注意：</b></font>本次操作需要服务器支持fso才能顺利完成！</td>
</tr>
<tr class="rowbg2">
<td style="#ffffff);height:28px;text-align:center"><%if request.form("act")="backupdb" then%><%=fsodbback()%><%else%><form method="post" action="<%=selfname%>" onsubmit="if(confirm('您现在就要备份系统数据库吗？')){return true}else{return false}"><input type="hidden" name="act" value="backupdb"><input type="submit" value="备份数据库" style="width:96px" class="button"></form><%end if%></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right;padding-right:24px;#ffffff);height:28px;">&nbsp;</td>
</tr>
</table>
