<!--#include file="chklogin.asp"-->
<!--#include file="../conn.asp"-->
<!--#include file="datafunction.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快问我知道 - 数据库处理</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FF9999">
<br><br><br><br>
<%
if session("userflag")="编辑管理员" then
response.Write("&nbsp;&nbsp;&nbsp;&nbsp;你没有权限进行此项操作！")
response.End()
end if
closedb
%>
<br><br><br><br><br><br>
<%
dim dbpath,action
dim ObjInstalled
action=request("action")
dbpath=server.mappath(db)
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")

if action="backup" or action="BackupData" then
call backup()
elseif action="Compact" or action="CompactData" then
call Compact()
elseif action="Restore" or action="RestoreData" then
call Restore()
elseif action="ShowSpace" then
call ShowSpace()
end if
%>

<%sub backup()%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
<form method="post" action="database.asp?action=BackupData">
  <tr> 
      <td height="22" align="center" bgcolor="#ff6666" class="font_bt">备 份 数 据 库</td>
  </tr>
  <tr> 
    <td height="150" align="center" bgcolor="#FFFFFF">
<%    
if request("action")="BackupData" then
	call backupdata()
else
%>
        <table cellpadding="3" cellspacing="1" border="0" width="100%">
          <tr> 
            <td width="78" height="33" align="right">备份目录：</td>
            <td width="129"><input type="text" size="20" name="bkfolder" value="Databackup"></td>
            <td width="269">相对路径目录，如目录不存在，将自动创建</td>
          </tr>
          <tr> 
            <td width="78" height="34" align="right">备份名称：</td>
            <td height="34"><input type="text" size="20" name="bkDBname" value="<%=date()%>"></td>
            <td height="34">不用输入文件名后缀（默认为“.asa”）。</td>
          </tr>
          <tr align="center"> 
            <td height="40" colspan="3"><input name="submit" type="submit" value=" 开始备份 " <%If ObjInstalled=false Then response.Write "disabled"%>></td>
          </tr>
        </table>
<%
	If ObjInstalled=false Then
		Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
	end if
end if
%>
    </td>
 </tr>
 </form>
</table>
<%end sub%>


<%sub Compact()%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
<form method="post" action="database.asp?action=CompactData">
  <tr> 
    <td height="22" align="center" bgcolor="#ff6666" class="font_bt">数 据 库 在 线 压 缩</td>
  </tr>
  <tr> 
    <td height="120" bgcolor="#FFFFFF"> 
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="40" align="center">压缩前，建议先<font color="#FF0000">备份</font>数据库，以免发生意外错误。 </td>
  </tr>
  <tr>
    <td height="40" align="center"><%    
if request("action")="CompactData" then
	call CompactData()
else%><input name="submit2" type=submit value=" 压缩数据库 " <%If ObjInstalled=false Then response.Write "disabled"%>><%end if%></td>
  <%If ObjInstalled=false Then
	Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if%>
  </tr>
</table>
    </td>
  </tr>
  </form>
</table>
<%end sub%>


<%sub Restore()%>
	<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
	<form method="post" action="database.asp?action=RestoreData">
        <tr> 
      		<td height="22" align="center" bgcolor="#ff6666" class="font_bt">数 据 库 恢 复</td>
        </tr>
        <tr>
            <td height="150" align="center" bgcolor="#FFFFFF"> 
        <%
if request("action")="RestoreData" then
	call RestoreData()
else
%>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="200" height="30" align="right">备份数据库路径（相对）：</td>
            <td height="30"><input name=backpath type=text id="backpath" value="DataBackup\" size=40 maxlength="200"></td>
          </tr>
          <tr align="center"> 
            <td height="40" colspan="2"><input name="submit" type=submit value=" 恢复数据 " <%If ObjInstalled=false Then response.Write "disabled"%>></td>
          </tr>
        </table>
<%
	If ObjInstalled=false Then
		Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
	end if
end if
%>
          </td>
        </tr>
	  </form>
</table>
<%end sub%>


<%sub ShowSpace()%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
	<tr> 
		<td height="22" align="center" bgcolor="#ff6666" class="font_bt">系 统 空 间 占 用 情 况</td>
	</tr>
  <tr bgcolor="#FFFFFF">
    <td height="160" align="right">
	  <table width="92%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>系统数据占用空间：&nbsp;&nbsp; <%showSpaceinfo("../data")%></td>
  </tr>
  <tr>
    <td>程序文件占用空间：&nbsp;&nbsp; <%showSpecialSpaceinfo("Program")%></td>
  </tr>
  <tr>
    <td>管理程序占用空间：&nbsp;&nbsp; <%showSpaceinfo("../coco")%></td>
  </tr>
  <tr>
    <td>系统图片占用空间：&nbsp;&nbsp; <%showSpaceinfo("../images")%></td>
  </tr>
  <tr>
    <td>备份数据占用空间：&nbsp;&nbsp; <%showSpaceinfo("Databackup")%></td>
  </tr>
  <tr>
    <td>系统占用空间总计：&nbsp;&nbsp; <%showspecialspaceinfo("All")%></td>
  </tr>
</table>
	</td>
  </tr>
</table>
<%end sub%>
</body>
</html>