<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="checklogin.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我推广的会员</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.width100{width:100%;}

-->
</style>
</head>

<body>
<!--#include file="top.asp"-->
<%
dim sql,csql,totalpage,totalnum,pagesizes,currentpage,carr,j,vby
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if
pagesizes=15

sql="select top "&pagesizes&" id,UserId,UserName,HomePage,RegDate,Hits from t_member where id<=(select min(id) from (select top "&((currentpage-1)*pagesizes+1)&" id from t_member where UnionId='"&checkusername&"' order by id desc) as t) and UnionId='"&checkusername&"' order by id desc"
csql="select count(*) from t_member where UnionId='"&checkusername&"'"
totalnum=conn.execute(csql)(0)
totalpage=int((totalnum-1+pagesizes)/pagesizes)
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,1
if not rs.eof then
	carr=rs.GetRows()
end if
rs.close
set rs=nothing
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="35"><div align="center">您总共推广会员数：<span class="th_title"><%=totalnum%></span> ！您将获得<span class="th_title"><%=totalnum%></span>天的免费置顶！</div></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr>
    <td height="28" colspan="6" class="th_title">我的推广会员列表</td>
  </tr>
  <tr>
    <td width="14%" class="td_row"><strong>会员ID</strong></td>
    <td width="25%" class="td_row"><strong>公司名称</strong></td>
    <td width="28%" class="td_row"><strong>公司网址</strong></td>
    <td width="14%" class="td_row"><strong>注册日期</strong></td>
    <td width="9%" class="td_row"><strong>点击</strong></td>
    <td width="10%" class="td_row"><strong>查看详细</strong></td>
  </tr>
  <%
  if(isarray(carr)) then
	for j=0 to ubound(carr,2)
  %>
  <tr>
    <td class="td_row"><%=carr(1,j)%></td>
    <td class="td_row"><%=carr(2,j)%></td>
    <td class="td_row"><a href="<%=carr(3,j)%>" target="_blank"><%=carr(3,j)%></a></td>
    <td class="td_row"><%=carr(4,j)%></td>
    <td class="td_row"><%=carr(5,j)%></td>
    <td class="td_row"><a href="/detail_<%=carr(0,j)%>.html">查看详细</a></td>
  </tr>
  <%
	next
  else
	response.Write("<tr><td colspan=""5"">暂时没有记录</td></tr>")
  end if
  set carr=nothing
  %>
  <tr>
    <td colspan="6" class="td_row">
	<div align="center">
	<%
	dim n,p,startpage,endpage
	n=currentpage+1
	p=currentpage-1
	startpage=currentpage-5
	if(startpage<=0) then
		startpage=1
	end if
	endpage=currentpage+5
	if(endpage>totalpage) then
		endpage=totalpage
	end if
	response.write("&nbsp;共"&totalnum&"条&nbsp;")
	if p>0then
		response.write("["&"<a href='?vby="&vby&"&page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
	else 
		response.write("上一页&nbsp;&nbsp;&nbsp;")
	end if 
	'''''''''''''''''
	for j=startpage to endpage
			if(j=currentpage) then
				response.write(j&"&nbsp;")
			else
				response.write("<a href=""?vby="&vby&"&page="&j&""">["&j&"]</a>&nbsp;")
			end if
			if(j>(startPage+10)) then
				exit for
			end if
	next
	'''''''''''''''''''''''''''''''''''''
	if currentpage>=totalpage then 
		response.write("下一页" )
	else
		response.Write("["&"<a href='?vby="&vby&"&page="&cstr(n)&"'>下一页</a>]")
	end if
	response.Write("&nbsp;共"&totalpage&"页&nbsp;")
	response.Write("&nbsp;第"&currentpage&"页&nbsp;")
	%>              
	</div>	</td>
  </tr>  
</table>
</body>
</html>
<%
call connclose()
%>