<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
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
if dsph("istest")="y" then
	ef=True
	ec="很抱歉,试用期的主机不能绑子目录！"
end if
end if

if not ef then
if not dsph("allowsub")="y" then
	ef=True
	ec="很抱歉,这个主机不允许绑子目录！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品不存在！"
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
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
　资源分配

<br>
<br>
<%
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&session("HOSTAUID")&"' or allowsubbyid='"&session("HOSTAUID")&"' order by id desc"
			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
%>
<form name="form1" method="post" action="useper2.asp">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <tr bgcolor="#C1BFBF" align="center">
    <td width="31%" height="35" bgcolor="#7B7D7B"><font color="#FFFFFF">目录名</font></td>
    <td width="41%" bgcolor="#7B7D7B"><font color="#FFFFFF">已绑定域名</font></td>
    <td width="28%" bgcolor="#7B7D7B"><font color="#FFFFFF">占用资源</font></td>
    </tr>
<%
while not dsph.Eof
%><tr align="center" bgcolor="#FFFFFF">
    <td height="35"><%if dsph("Hosttype")="子目录绑定" then%><%=dsph("dirname")%><%else%>主网站<%end if%></td>
    <td><%=replace(replace(dsph("hostname"),":80:",""),",","<br>")%></td>
    <td><%if dsph("Hosttype")="子目录绑定" then%><input name="<%=dsph("id")%>" type="text" value="<%=dsph("useper")%>" size="2" maxlength="2">
%<%else%>余下的所有资源<%end if%></td>
    </tr>
<%
dsph.movenext
wend%>
<tr align="center" bgcolor="#FFFFFF">
    <td height="35" colspan="3"><input type="submit" name="Submit" value="提交"></td>
    </tr>
</table>
        </form>
<%dsph.close
set dsph=nothing
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>