<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.QueryString ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request.QueryString ("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&session("HOSTAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then

username=dsph("Ftpname")
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->　空间使用

<%
returnstr = ShowUser2(URL,FreeHostsharekey,username)
if (instr(1,returnstr,"用户不存在！")>0) then 
Response.Write returnstr
Response.End 
end If
if Not instr(returnstr,"用户名：")>1 then 
Response.Write "这台受控服务器自检没有通过，请在站点管理，虚拟主机中自检来分析原因。"
Response.End 
end if 
'usrname=GETvalue(returnstr,"FTP用户名：",";FTP密码：")
'getpass=GETvalue(returnstr,";FTP密码：",";用户所在目录：")
'homedir=GETvalue(returnstr,";用户所在目录：",";磁盘配额上限为:")
spacelimit=GETvalue(returnstr,";磁盘配额上限为:",";磁盘配额已使用:")
spacelimit=replace(spacelimit," MB","")
spaceused=GETvalue(returnstr,";磁盘配额已使用:",";网站标识为：")
'siteid=GETvalue(returnstr,";网站标识为：",";网站名：")
'sitename=GETvalue(returnstr,";网站名：",";日志目录：")
'LogFileDirectory=GETvalue(returnstr,";日志目录：",";IIS连接数：")
'MaxConnections=GETvalue(returnstr,";IIS连接数：",";主机头名：")
'serverbind=GETvalue(returnstr,";主机头名：",",;应用程序池名：")
'PoolName=GETvalue(returnstr,",;应用程序池名：",";默认首页：")
'AppPoolnum=replace(PoolName,mid(PoolName,instr(1,PoolName,"_")),"")

'DefaultDoc=GETvalue(returnstr,";默认首页：",";脚本权限：")
'AccessFlags=GETvalue(returnstr,";脚本权限：",";应用程序影射：")

'ScriptMaps=GETvalue(returnstr,";应用程序影射：",";自定义出错信息：")

'HttpErrors=GETvalue(returnstr,";自定义出错信息：",";用户描述为：")


'about=GETvalue(returnstr,";用户描述为：",";FreeHostEnd")
'about=about&";FreeHostEnd"

'type1=GETvalue(about,"FHA:",",FHB:")
'type2=GETvalue(about,"FHB:",",FHC:")
'type3=GETvalue(about,"FHC:",",FHD:")

'starttime=GETvalue(about,",FHD:",",FHE:")
'endttime=GETvalue(about,",FHE:",",FHF:")
'email=GETvalue(about,",FHF:",",FHG:")
'usrinfo=GETvalue(about,",FHI:",";FreeHostEnd")

'Response.Write "用户名:"&usrname&"<br>"
'Response.Write "密　码:"&getpass&"<br>"
'Response.Write "用户所在目录："&homedir&"<br>"
'Response.Write "建立时间："&starttime&"<br>"
'Response.Write "到期时间："&endttime&"<br>"
'Response.Write "邮箱："&email&"<br>"
'Response.Write "网站标识为："&siteid&"<br>"
'Response.Write "网站名："&sitename&"<br>"
'Response.Write "IIS连接数:"&MaxConnections&"<br>"
'Response.Write "应用程序池名："&PoolName&"<br>"
'Response.Write "多少用户共用一个应用程序池:"&AppPoolnum&"<br>"
'Response.Write "主机头名："&serverbind&"<br>"
'Response.Write "默认首页为："&DefaultDoc&"<br>"
'Response.Write "脚本权限为："&AccessFlags&"<br>"
'Response.Write "用户说明："&usrinfo&"<br>"
'Response.Write "用户分类一："&type1&"<br>"
'Response.Write "用户分类二："&type2&"<br>"
'Response.Write "用户分类三："&type3&"<br>"
spaceused=replace(spaceused,"位元組","")

if (instr(1,spaceused,"KB")>0) then
spaceused=int(trim(replace(spaceused,"KB",""))/1024)
end if
if (instr(1,spacelimit,"KB")>0) then
spacelimit=int(trim(replace(spacelimit,"KB",""))/1024)
end if

if (instr(1,spaceused,"字节")>0) then
spaceused=int(trim(replace(spaceused,"字节",""))/1024)
end if
if (instr(1,spacelimit,"字节")>0) then
spacelimit=int(trim(replace(spacelimit,"字节",""))/1024)
end if

if (instr(1,spaceused,"MB")>0) then
spaceused=trim(replace(spaceused,"MB",""))
end if
if (instr(1,spacelimit,"MB")>0) then
spacelimit=trim(replace(spacelimit,"MB",""))
end if

if (instr(1,spaceused,"GB")>0) then
spaceused=trim(replace(spaceused,"GB","")*1024)
end if
if (instr(1,spacelimit,"GB")>0) then
spacelimit=trim(replace(spacelimit,"GB","")*1024)
end if

Response.Write "<br><br>已用空间数量:"&spaceused&" M<br><br>"
Response.Write "空间大小上限:"&spacelimit&" M<br><br>"
if spacelimit=0 then spacelimit=-1
%>
<br>
<%=int(Clng(spaceused)*100/int(spacelimit))%>%<table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td height="30">
	<table width="<%=int(Clng(spaceused)*100/int(spacelimit))%>%" height="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

	</td>
  </tr>
</table>
<br>
<br>
　<a href="selfhostmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-hostadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>