<!--#include file="conn.asp"-->
<!--#include file="z_dgconn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/dv_ubbcode.asp"--> 
<!--#include file="inc/dv_loadcache.asp"-->
<%
If Not IsObject(Conn) Then ConnectionDatabase
dim sql,rs,founderr,i,errmsg
founderr=false
Dvbbs.LoadTemplates("")

'---------------------
' write by 绿水青山
' 本插件经由 cyp2 修改适应DVBBS7.0.0
'---------------------
	
	dim abgcolor,username

	dvbbs.stats="我的祝福列表"
	dvbbs.nav()
	Dvbbs.Head_var 2,0,"",""

	if dvbbs.userid=0 then
		errmsg=errmsg+"<br>"+"<li>客人不可以查阅点歌列表"
		errmsg=errmsg+"<br>"+"<li>请先<a href=login.asp><font color=blue>登录</font></a>,还没有<a href=reg.asp><font color=blue>注册</font></a>"
		dvbbs.FoundIsChallenge=true
	end if
	
	If dvbbs.userid=0 Then
	Dvbbs.AddErrCode(6)
	Dvbbs.Showerr()
	
	else

		dim page_count,Pcount,totalrec,mytotalrec,totalPages,currentPage	
		
		set rs=server.createobject("adodb.recordset")
		set rs=connDG.execute("select count(sender) from media")
			totalrec=rs(0)
		rs.close	
		set rs=connDG.execute("select count(sender) from media where incept='"&dvbbs.membername&"' or incept='全体会员'")
			mytotalrec=rs(0)
		rs.close		
	%>	
		<table cellpadding=3 cellspacing=1 border=0 align=center class=tableborder1>
			<tr>
				<th><a href=z_dglistall.asp><font color=white><b>所有点歌列表</b></font></a></th>
				<th><a href=z_dglistme.asp><font color=white><b>我的点歌列表</b></font></a></th>
				<th><a href=z_dgwrite.asp><font color=white><b>我要点歌</b></font></a></th>
			</tr>
			<tr>
				<td class=tablebody2 align=center valign=middle colspan="3">你的祝福清单共有[<font color=red><b><%=mytotalrec%></b></font>]个，<a href=z_dglistall.asp><b>论坛总点歌列表</b></a>清单共有[<font color=red><b><%=totalrec%></b></font>]个。<font color=green><直接点击歌名欣赏></font></td>
			</tr>			
		</table>
		<br>
		<table cellpadding=3 cellspacing=1 border=0 align=center class=tableborder1>
			<tr>
				<th width=80>点歌人</th><th width=80>对方姓名</th>
    <th width=120>歌名</th>
    <th width=120>时间</th><th width=*>祝福语</th><th width=40>操作</th> 
			</tr>	
	<%
		sql="select * from media where incept='"&dvbbs.membername&"' or incept='全体会员' Order By sendtime Desc"
		rs.open sql,connDG,3,3				
		if rs.eof and rs.bof then
			currentpage=0
	%>		
			<tr><td class=tablebody2 valign=middle colspan=6>当前没有点歌列表</td></tr>
	<%		
		else

			currentPage=request.querystring("page")
			if currentpage="" or isNumeric(currentpage) = 0 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)
%>
				<tr>
					<td class=tablebody2 align=center valign=middle><a href=javascript:openScript('dispuser.asp?name=<%=rs("sender")%>',650,500)><font color=blue><%=rs("sender")%></font></a></td>
					<td class=tablebody1 align=center valign=middle><%if trim(rs("incept"))<>"全体会员" then%><a href=javascript:openScript('dispuser.asp?name=<%=rs("incept")%>',650,500)><font color=green><%=rs("incept")%></font></a><%else%><font color=olive><%=rs("incept")%></font><%end if%></td>
					<td class=tablebody2 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=tablebody1 align=center valign=middle><%=rs("sendtime")%></td>
					<td class=tablebody1 align=left valign=middle><font color=red><%=rs("content")%></font></td>
					<td class=tablebody2 align=center valign=middle><a href=z_dgdel.asp?id=<%=rs("id")%> onclick="javascript:{if(confirm('您确定执行删除操作吗?')){return true;}return false;}">[删除]</a></td>					
				</tr>
<%
	  	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=&dvbbs.Forum_body(12)& align=center><tr><td valign=middle nowrap>页次：<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=&dvbbs.Forum_body(8)&>["&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=tableborder1>
			<tr>
				<th><font color=white>--== 论坛点歌台-我的祝福列表 ==--</font></th>
			</tr>
		</table>
<%		
	call CloseDB()
	call dvbbs.activeonline()
	end if
	call dvbbs.footer()
%>