<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="13"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/filesystem.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<%
 
'修改空间大小^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 modisi=Replace_Text(request("modisi"))
 modisize=Replace_Text(request("modisize"))
 modiid =Replace_Text(request("modiid"))

 if modisi<>"" then 
 if not isnumeric(modisize) then
 response.Write("<script >alert('请输入数字!');history.back(-1);</script>")
 response.End()
  end if
 set rsm=server.CreateObject("adodb.recordset")
sqlm="select * from Websen_corporation where id="&modiid
rsm.open sqlm,conn,1,3
if  not rsm.eof then
 conn.execute "update Websen_corporation set foldersize="&modisize&" where id="&modiid
 rsm.close
end if
 end if

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

%>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<SCRIPT language=javascript>  
<!-- Hide  
function killErrors() {  
return true;  
}  
window.onerror = killErrors;  
 // -->  
</SCRIPT>
</head>
 <body>
 <%
  username=Replace_Text(request("username"))
  searchgo=Replace_Text(request("searchgo"))
  searchname=Replace_Text(request("searchname"))
  kind=Replace_Text(request("kind"))
 sql="select  [user],qymc,id,foldersize,gradeid from Websen_corporation  where id<>0"
 
  if searchgo<>"" then 
  if searchname<>""  then
  sql=sql&" and [user] like '%"&searchname&"%'"
  end if
   if kind<>"" then
   if kind<>"all" then 
   sql=sql&" and gradeid="&kind
   end if
   end if
  end if
  
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 
msg_per_page=20 '定义每页显示记录条数
%>
<!--#include file="../../inc/headpage.asp"-->
<table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder">
<tr> 
<th class="tableHeaderText" colspan=2 height=25>会员空间管理</th>
</tr>
<tr>
<td   colspan=2><font color="#666666">温馨提示：请根据自己的网站空间而定进行分配!
 <br />统计信息：本站会员空间一共已占用<font color="red"><%=FunFolderSize(HOPE_InstallDir&"vipcom")%></font>KB=<font color="red">
<%if FunFolderSize(HOPE_InstallDir&"vipcom")<>0 then%><%=round(FunFolderSize(HOPE_InstallDir&"vipcom")/1024,2)%><%end if%></font>MB;已审核的会员分配的总空间为：
<%
set rstu=server.CreateObject("adodb.recordset")
sqltu="select sum(foldersize) as totalf from Websen_corporation where flag=1 "
rstu.open sqltu,conn,1,1
if not rstu.eof then 
if rstu("totalf")<>0 then
tnum=round(rstu("totalf")/1024,2)
 response.Write("<font color=red>"&rstu("totalf")&"</font>KB=<font color=red>"&tnum&"</font>MB")
end if
rstu.close
end if
%></font>
</td>
</tr></table>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="98%">
<form method="post" action="modispace.asp" name="searchform">
<tr  bgcolor="#B6C5DC" align="center"  > 
<td  height=25 colspan="2" >会员查询：登录名:<input  type="text" name="searchname" value="<%=request("searchname")%>" maxlength="30" />&nbsp; &nbsp;所属等级:
<select size="1" name="kind" >
 <option value="all" >所有等级</option>
 <%
set rss=server.CreateObject("adodb.recordset")
sqls="select * from Websen_vipgrade order by roleid desc"
rss.open sqls,conn,1,1
if not rss.eof then 
do while not rss.eof 
%>
<option value="<%=rss("roleid")%>"><%=rss("gradename")%></option>
<%
rss.movenext
loop
rss.close
end if
%>
</select>
&nbsp;<input type="submit" name="searchgo" value="搜索" />
</td>
</tr>
</form>
</table>
<table  border="1" bordercolor="#81A0DF" cellpadding="0" cellspacing="0" align="center" width="98%"><tr><td>
<%
if Replace_Text(request("ac"))="modi" then
 usern=Replace_Text(request("usern"))
id=Replace_Text(request("id"))

 %>
<table  border="1" bordercolor="#81A0DF" cellpadding="0" cellspacing="0" align="center" width="100%">
<form name="modif" method="post" action="modispace.asp?username=<%=username%>&page=<%=request("page")%>">
<%
fsize=200
set rsuf=server.CreateObject("adodb.recordset")
sqluf="select * from Websen_corporation where id="&id
rsuf.open sqluf,conn,1,1
if not rsuf.eof then 
 fsize=rsuf("foldersize")
 rsuf.close
end if
%>
<tr><td align="center"   height="30">
修改用户【<font color="red"><b><%=usern%></b></font>】的空间大小:<input  type="hidden" name="modiid" value="<%=id%>" /><input type="text" name="modisize" maxlength="10" value="<%=fsize%>"   />&nbsp;<input type="submit" value="修改"   name="modisi"/>
 </td></tr>
 </form>
 </table>
 <%
 end if
 %>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
<tr    bgcolor="#AFBED8"><td height="25"><font color="#FFFFFF"><b>&nbsp;登陆名</b></font></td><td><font color="#FFFFFF"><b>公司名</b></font></td><td><font  color="#FFFFFF"><b>总空间</b>(<font  color="#0099CC">KB</font>)</font></td><td><font  color="#FFFFFF"><b>已用空间</b>(<font  color="#0099CC">KB</font>)</font></td><td><font  color="#FFFFFF"><b>剩余空间</b>(<font  color="#0099CC">KB</font>)</font></td><td><font color="#FFFFFF"><b>操作</b></font></td></tr>
<%
if rs.eof then
response.Write"<tr><td colspan=6><br><br><div align='center'>暂无数据信息</div><br><br></td></tr>"
else
jk=1 
do while not rs.eof and rowcount > 0
%>
<tr <%if jk mod 2=0 then response.Write("bgcolor=#EEF0F2") end if%>><td height="25">&nbsp;<a href="useredit.asp?id=<%=rs("id")%>"><%
if username<>"" then
%>
<%=replace(rs("user"),username,"<font color=red>"&username&"</font>")%>
<%
else
%>
<%=rs("user")%>
<%
end if
 %></a></td><td><a href="edit.asp?id=<%=rs("id")%>"><%=rs("qymc")%></a> 
 <%
   set rsk=server.CreateObject("adodb.recordset")
 sqlk="select gradename from Websen_vipgrade  where roleid="&rs("gradeid")
 rsk.open sqlk,conn,1,1 
 if not rsk.eof then 
 response.Write("<a href=modispace.asp?searchgo=a&kind="&rs("gradeid")&"><font color=#666666>("&rsk("gradename")&")</font></a>")
 else
 response.Write("不详")
 rsk.close
 end if
 %>
  </td><td><%=rs("foldersize")%></td>
 <td>
 <%
 if FunFolderSize(HOPE_InstallDir&"vipcom/"&rs("user"))>=rs("foldersize") then
 response.Write(rs("foldersize"))
 else
 response.Write(FunFolderSize(HOPE_InstallDir&"vipcom/"&rs("user")))
 end if 
 %>
 </td> 
 <td>
 <%
 if rs("foldersize")-FunFolderSize(HOPE_InstallDir&"vipcom/"&rs("user"))<=0 then
 response.Write("0")
 else
 response.Write(rs("foldersize")-FunFolderSize(HOPE_InstallDir&"vipcom/"&rs("user")))
 end if 
 %>
 </td> 
 <td><a href="modispace.asp?ac=modi&id=<%=rs("id")%>&fsize=<%=rs("foldersize")%>&usern=<%=rs("user")%>&page=<%=request("page")%>&username=<%=username%>">修改</a></td></tr>
<%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
jk=jk+1
rs.movenext
loop
end if
%>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="99%">
<tr><td class=forumrowHighLight align="center"><b><%=listPages("modispace.asp?username="&username)%></b></td>
</tr></table></td></tr></table>
 </body>
</html>
