<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html12")%>
　虚拟主机
<%=htmlwrite("html13")%>
<br>
<%
'/style/info/host.asp?typeid=分类号
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")

agentname=session("agentname")
if session("agentusername")<>"" Or session("AgnRunasUser")=True then 
if session("agentusername")<>"" Then agentname=session("agentusername")
	Set dsagent = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent where username='"&agentname&"'"
		dsagent.Open Sql,conn,1,1
if Not dsagent.eof then
Set dsagnettype = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Agent_pers where agenttype='"&dsagent("agenttype")&"'" 
		dsagnettype.Open Sql,conn,1,1
if Not dsagnettype.eof Then
canshowagnpric=True
Else
canshowagnpric=false
End if
end If
dsagent.close
end If



	Set dsHostlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist where canbyenduser='y' and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc"
if agentname<>"n" then Sql="Select * from FreeHost.FreeHost_HostProductlist where canbyagnenduser='y' and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc"
if Request.QueryString ("typeid")<>"" and  IsNumeric(Request.QueryString("typeid")) then Sql="Select * from FreeHost.FreeHost_HostProductlist where canbyenduser='y' and typeid='"&Request.QueryString("typeid")&"'   and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc"

if Request.QueryString ("typeid")<>"" and  IsNumeric(Request.QueryString("typeid")) and agentname<>"n" then Sql="Select * from FreeHost.FreeHost_HostProductlist where canbyagnenduser='y' and typeid='"&Request.QueryString("typeid")&"'  and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc"
if Request.QueryString ("pagesize")<>"" and  IsNumeric(Request.QueryString("pagesize")) then
dsHostlist.PageSize = Request.QueryString ("pagesize")'每页显示的数量
else
dsHostlist.PageSize = 10'每页显示的数量
end if
		dsHostlist.Open Sql,conn,1,1
If dsHostlist.Eof Then%>
产品列表为空.
<%else

Set dsHostlistcount = Server.CreateObject("ADODB.Recordset")	
		Sql=replace(replace(sql,"Select *","Select count(*)"),"order by orderbyid desc","")
		dsHostlistcount.Open Sql,conn,1,1
hostcount=dsHostlistcount(0)
dsHostlistcount.close
set dsHostlistcount=nothing

if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsHostlist.RecordCount <> 0 Then dsHostlist.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsHostlist.PageCount<=10 then
       endini=dsHostlist.PageCount 
       else
       endini=10
      end if
    end if
%>
共<font color=red><%=hostcount%></font>个产品　<%if clng(pn)<=10 then%> <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsHostlist.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>|<%If Clng(pn)<dsHostlist.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<%
For N=1 To dsHostlist.PageSize 
					If dsHostlist.RecordCount=0 Then Exit For

usermoney=dsHostlist("usermoney")
if agentname<>"n" then 
	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='虚拟主机' and username='"&agentname&"' and id="&dsHostlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if not dsendmoney.eof then
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
end if

%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="37%" rowspan="2" bgcolor="#FFFFFF">　<img src="/style/img/host/<%=dsHostlist("id")%>.jpg">　
      <%
	info=dsHostlist("info")
	Hosttype=dsHostlist("Hosttype")
isAgnHostSer=false
	Set newname_host = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_HostProductlist_AGN where agent1='"&agentname&"' and id='"&dsHostlist("id")&"'"
		newname_host.Open Sql,conn,1,1
if not newname_host.eof then
info=newname_host("info")
Hosttype=newname_host("Hosttype")
if newname_host ("ServerlistID")<>0 Then isAgnHostSer=True '这是独立模板的产品
newname_host.close
end if

%>
      <font size="3"><strong><%=Hosttype%></strong></font>      <td width="47%" height="34" align="center" valign="middle" bgcolor="#EEEEEE">价格:<%=usermoney%>元
<%if canshowagnpric then%>(<font color=red>代理成本价格:
<%

	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and username='"&agentname&"' and id="&dsHostlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsHostlist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
%>元)</font><%
If isAgnHostSer then%>
(<font color=red>当前此产品为独立模式产品，成本价为0元</font>)
<%End if
End if%>
</td>
        <td width="16%" align="center" bgcolor="#EEEEEE"><a href="hostmore.asp?id=<%=dsHostlist("id")%>" target="_blank"><font color="#000000">详细介绍&gt;&gt;&gt;&gt;</font></a></td>
  </tr>
  <tr>
    <td height="75" bgcolor="#FFFFFF">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="4%" scope="col">&nbsp;</th>
        <td width="92%" align="left" scope="col"><%=info%></td>
        <th width="4%" scope="col">&nbsp;</th>
      </tr>
    </table></td>
    <td width="16%" align="center" bgcolor="#FAFAFA"><P><A href="/netpay/"><FONT color=#006600>现在付款开通</FONT></A></P>
    <P><A href="/user/selfhost.asp?id=<%=dsHostlist("id")%>"><FONT color=#000000>实时在线开通</FONT></A></P></td>
  </tr>
</table>
<br>
<%
If clng(pn)=dsHostlist.PageCount Then
I = dsHostlist.RecordCount - (dsHostlist.PageCount-1) * dsHostlist.PageSize
If N=I Then Exit For
End If
dsHostlist.movenext
Next%>
<%dsHostlist.close
set dsHostlist=nothing
end if%>
<%=htmlwrite("html14")%>
