<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html12")%>
<table width="84%" height="67" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td><table width="100%" height="37" border="0" cellpadding="0" cellspacing="1">
      <tr bgcolor="#FFFFFF">
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=0">标准型主机</a></div></td>
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=1">标准双线主机</a></div></td>
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=2">商务型主机</a></div></td>
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=3">商务双线主机</a></div></td>
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=4">企业型主机</a></div></td>
        <td width="108"><div align="center"><a href="/style/info/host.asp?typeid=5">企业双线主机</a></div></td>
      </tr>
     </table></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%=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
%>


<%
'在这以前请打开数据库
'按照查询条件查询出数据,对象为Rs
Dim i
i = 0        
iF dsHostlist.eof or dsHostlist.bof then 
response.Write "<td align='center'>&nbsp;</td>"
Else
Dim PageSize,Tpage,CountSize,MyPageCount
PageSize = 10 '可以在其它地方定义一个变量,在此直接取这个变量的值为pagesize
iF Trim(Request("page"))="" then
    Tpage=1
Else
    on Error resume next
    Tpage=Trim(Request("page"))
    Tpage=Clng(Tpage)
    iF err.number<>0 then
        err.clear
        Tpage=1
    End iF
End iF
CountSize=dsHostlist.recordcount
dsHostlist.pagesize=pagesize
MyPageCount=dsHostlist.pagecount
iF Clng(Tpage) > 1 then
    iF Clng(Tpage) > Clng(MyPageCount) then 
        dsHostlist.absolutepage=Clng(MyPageCount)
        Tpage=Clng(MyPageCount)
    Else
        dsHostlist.absolutepage=Tpage
    End iF
Else
    dsHostlist.absolutepage=1 
    Tpage=1
End iF
'数据总数：CountSize
'每页显示：PaGeSize
'页面总数：MyPageCount
'当前显示：TPaGe
Do while Not(dsHostlist.eof) and Not(dsHostlist.bof) and i < pagesize

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

%>    
<td width="100%">
<table width="370"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr bgcolor="EBF5F8">
    <td width="13%" rowspan="3" bgcolor="#FFFFFF">　<img src="/style/img/host/xnzj.jpg">
    <td height="34" colspan="3" align="center" valign="middle" bgcolor="#E8FFFF">　
      <%
	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> <font color="#FF0000">价格:<%=usermoney%>元</font>      <%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%>    <a href="hostmore.asp?id=<%=dsHostlist("id")%>" target="_blank"></a></td>
  </tr>
  <tr>
    <td height="37" colspan="3" bgcolor="#FFFFFF">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="4%" scope="col">　</th>
        <td width="92%" align="left" scope="col"><%=info%></td>
        <th width="4%" scope="col">　</th>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="26%" height="37" bgcolor="#FFFFFF"><div align="center"><a href="hostmore.asp?id=<%=dsHostlist("id")%>" target="_blank"><img src="/style/img/host/103.jpg" width="60" height="21" border="0"></a></div></td>
    <td width="25%" bgcolor="#FFFFFF"><div align="center"><a href="/netpay/" target="_blank"><img src="/style/img/host/buy.gif" width="60" height="21" border="0"></a></div></td>
    <td width="36%" bgcolor="#FFFFFF"><div align="center"><A href="/user/selfhost.asp?id=<%=dsHostlist("id")%>"></A><a href="/user/selfhost.asp?id=<%=dsHostlist("id")%>" target="_blank"><img src="/style/img/host/kt.gif" width="90" height="21" border="0"></a></div></td>
  </tr>
</table> 
<table border="0" width="100%">
	<tr>
		<td height=2></td>
	</tr>
</table>      
</td>
<%    
dsHostlist.movenext
i = i + 1    
iF i mod 2 = 0 and Not(dsHostlist.eof) and Not(dsHostlist.bof) then response.Write "</tr><tr>" '如果满了2个就换行.
Loop
'避免未换行前已经显示完产品,补上相应的单元格.
Do while i mod 2 =0
    response.Write "<td width='33%'>&nbsp;</td>"
i = i + 1
Loop
Set dsHostlist = Nothing
%>
</tr>    
<tr>
<td style="border-top:1px solid #666666; line-height:20px;" colspan="3" height="30">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="product.asp" method="get" name="pageForm">
<tr> 
<td class="Font03">
页次：<font color="#FF0000"><%=tpage%>/<%=mypagecount%></font>&nbsp;每页显示信息数：<%=Pagesize%>&nbsp;共有信息<%=countsize%>条</font></td>
<td class="Font03" width="250">
分页：
<a href="?page=1" title="第一页.."><font face="Webdings">9</font></a>
<a href="?page=<%=tpage-1%>" title="上一页.."><font face="Webdings">7</font></a>
<a href="?page=<%=tpage+1%>" title="下一页.."><font face="Webdings">8</font></a> 
<a href="?page=<%=mypagecount%>" title="最后页.."><font face="Webdings">:</font></a>&nbsp; 
<input name="page" type="text" class="inputFace" value="<%=tpage%>" size="3" maxlength="5">
<input name="submit" type="submit" value="转 到" class="ButtonFace">             
</td>                  
</tr>
</form>
</table>    
</td>
<%
End iF
%>
</tr>
</table>
<%=htmlwrite("html14")%>
