<!-- #include file="setup.asp" -->
<!--#include file="z_dgconn.asp"-->
<%

	dim page_count,Pcount,totalrec,mytotalrec,totalPages,currentPage
	dim abgcolor,username
if Request.Cookies("username")="" then
error("<li>您还还未<a href=login.asp>登陆</a>社区")
end if

if instr(Request.Cookies("username")," ")>0 then:error("<li>非法操作"):end if

sql="select * from [user] where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3

if Request.Cookies("userpass")<>rs("userpass") then
error2("密码错误！")
end if	
totalrec=connDG.execute("select count(id) from [media]")(0)
mytotalrec=connDG.execute("select count(id) from [media] where incept='"&Request.Cookies("username")&"' or incept='全体会员' or sender='"&Request.Cookies("username")&"' ")(0)
%>	
<%
top
%>
<title>点播祝福</title>

<table border=0 width=97% align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → <a href="shop.asp">点播祝福</a></td>
</tr>
</table><br><html><head>
<title>所有点播列表</title>

<table width="97%" border=0 align=center cellpadding=3 cellspacing=1 class=a2>
  <tr class=a1 align=center> 
				<td><a href=z_dglistall.asp><font color=red><b>所有点播列表</b></font></a></td>
				<td><a href=z_dglistme.asp><font color=red><b>我的点播列表</b></font></a></td>
				<td><a href=z_dgwrite.asp><font color=red><b>我要点播</b></font></a></td>
			</tr>
			<tr>
				<td width=97% class=a3 align=center valign=middle colspan="3"><a href=z_dglistall.asp><b>论坛总点播列表</b></a>清单共有[<font color=red><b><%=totalrec%></b></font>]个,其中<a href=z_dglistme.asp><font color=green>[<b><%=Request.Cookies("username")%></b>]</font></a>的祝福清单共有[<font color=red><b><%=mytotalrec%></b></font>]个。<font color=green><直接点击点播内容欣赏></font></td>
			</tr>
		</table>	
		<br>
<table width="97%" border=0 align=center cellpadding=3 cellspacing=1 class=a2>
  <tr class=a1 align=center> 
					<td width=80>点播人</td><td width=80>对方姓名</td><td width=220>点播内容</td><td width=120>时间</td><td width=*>祝福语</td><td width=50>操作</td> 
				</tr>	
			
	<%	
		set rs=server.createobject("adodb.recordset")
		sql="select * from [media] Order By sendtime Desc"
		rs.open sql,connDG,3,3				
		if rs.eof and rs.bof then
			currentpage=0
	%>	
				
			<tr><td class=a3 valign=middle colspan=6>当前没有点播列表</td></tr>
	<%		
		else

			currentPage=1
			if currentpage="" then
				currentpage=1
			else
				currentpage=clng(currentpage)
				if err then
					currentpage=1
					err.clear
				end if
			end if

		rs.PageSize = 10
		rs.AbsolutePage=currentpage
		page_count=0
      	totalrec=rs.recordcount
		while (not rs.eof) and (not page_count = rs.PageSize)
			if trim(rs("incept"))=Request.Cookies("username") or trim(rs("incept"))="全体会员" then
%>
				<tr width=97% >
					<td class=a3 align=center valign=middle><a href=profile.asp?username=<%=rs("sender")%> target=_blank ><font color=blue><%=rs("sender")%></font></a></td>
					<td class=a3 align=center valign=middle><%if trim(rs("incept"))=Request.Cookies("username") then%><a href=profile.asp?username=<%=rs("incept")%> target=_blank ><font color=#CC66FF><%=rs("incept")%></font></a><%else%><font color=olive><%=rs("incept")%></font><%end if%></td>
					<td class=a3 align=center valign=middle><a href='z_dgplay.asp?url=<%=replace(rs("url"),chr(32),"%20",1)%>&medianame=<%=replace(rs("medianame"),chr(32),"%20")%>' target=_blank><%=rs("medianame")%></a></td>
					<td class=a3 align=center valign=middle><%=rs("sendtime")%></td>
					<td class=a3 align=left valign=middle><font color=navy><%=rs("content")%></font></td>
					<td class=a3 align=center valign=middle><a href=z_dgdel.asp?id=<%=rs("id")%> onclick="javascript:{if(confirm('您确定执行删除操作吗?')){return true;}return false;}">[删除]</a></td>
				</tr>		
<%		
			else
%>
				<tr>
					<td class=a3 align=center valign=middle><a href=profile.asp?username=<%=rs("sender")%> target=_blank ><font color=blue><%=rs("sender")%></font></a></td>
					<td class=a3 align=center valign=middle><a href=profile.asp?username=<%=rs("incept")%> target=_blank ><font color=green><%=rs("incept")%></font></a></td>
					<td class=a3 align=center valign=middle><a href='Z_dgplay.asp?url=<%=replace(rs("url"),chr(32),"%20",1)%>&medianame=<%=replace(rs("medianame"),chr(32),"%20")%>' target=_blank><%=rs("medianame")%></a></td>
					<td class=a3 align=center valign=middle><%=rs("sendtime")%></td>
					<td class=a3 align=left valign=middle><font color=gray>******已经隐藏******</font></td>
					<td class=a3 align=center valign=middle><a href=z_dgdel.asp?id=<%=rs("id")%> onclick="javascript:{if(confirm('您确定执行删除操作吗?')){return true;}return false;}">[删除]</a></td>
				</tr>
<%
			end if
	  	page_count = page_count + 1
		rs.movenext
		wend
	end if
%>
</table>
<%
	dim endpage
	Pcount=rs.PageCount
	response.write "<table border=0 cellpadding=0 cellspacing=3 width=97% align=center>"&_
			"<tr><td valign=middle nowrap>"&_
			"<font color='#000000'>页次：<b>"&currentpage&"</b>/<b>"&Pcount&"</b>页"&_
			" 每页<b>10</b>条 共有<b>"&totalrec&"</b>条点播</td>"&_
			"<td valign=middle nowrap><div align=right><p>分页： "

	if currentpage > 4 then
		response.write "<a href=""?page=1"">[1]</a> ..."
	end if
	if Pcount>currentpage+3 then
		endpage=currentpage+3
	else
		endpage=Pcount
	end if
	for i=currentpage-3 to endpage
		if not i<1 then
			if i = clng(currentpage) then
			response.write " <font color=red>["&i&"]</font>"
			else
			response.write " <a href=""?page="&i&""">["&i&"]</a>"
			end if
		end if
	next
	if currentpage+3 < Pcount then 
		response.write "... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
	end if
		response.write "</p></div></font></td></tr></table>"
	rs.close
	set rs=nothing
%>	
		<table cellpadding=3 cellspacing=1 border=0 align=center class=a1>
			<tr>
				<td><font color=red>--== 论坛点播台-所有点播列表 ==--</font></td>
			</tr>
		</table>		
<%
	call CloseDB()
%>
<%
htmlend
%>
