|
红色部分为数据循环,也即从第一行开始交替出现,不是点歌人那一行开始变色!
<!--#include file="inc.asp"-->
<!--#include file="qq_dgconn.asp"-->
<script language="JavaScript" type="text/JavaScript">
function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}
</script>
<script language="JavaScript" type="text/javascript" for="checkbox" event="onclick">
tr_bgcolor(this);
</script>
<script language="JavaScript" type="text/javascript">
<!--
function tr_bgcolor(c){
var tr = c.parentNode.parentNode;
tr.rowIndex % 2 == 0 ? tr.style.backgroundColor = c.checked ? '#eee' : '' : tr.style.backgroundColor = c.checked ? '#eee' : '';
}
function selall(obj){
for (var i=0; i<obj.form.elements.length; i++)
if (obj.form.elements[i].type == 'checkbox' && obj.form.elements[i] != obj){
obj.form.elements[i].checked = obj.checked;
tr_bgcolor(obj.form.elements[i]);
}
}
//-->
</script>
<%
If bbs94kk.myadmin<>9 Then
Response.Write"<script>alert('对不起,您不是管理员,不能进入!');history.go(-1);</script>"
end if
bbs94kk.head("管理点歌列表")
dim sql,rs,i,page_count,Pcount,totalrec,mytotalrec,currentPage,Content
totalrec=connDG.execute("select count(id) from media")(0)
mytotalrec=connDG.execute("select count(id) from media where incept='"&bbs94kk.myname&"' or incept='全体会员'")(0)
Content=Content&"<table border='0' cellpadding=0 cellspacing=0 align=center width='100%'><tr height='25'><td width='33.3%' align=center><a href=qq_dglistall.asp>所有点歌列表</a></td><td width='33.3%' align=center><a href=qq_dglistme.asp>我的点歌列表</a></td><td width='33.3%' align=center><a href=qq_dgwrite.asp>我要点歌</a></td></tr>"&_
"<tr><td align=center valign=middle colspan='3'><a href=qq_dglistall.asp><b>论坛总点歌列表</b></a>清单共有[<font color=red><b>"&totalrec&"</b></font>]个,其中<a href=qq_dglistme.asp>[<b>"&bbs94kk.myname&"</b>]</a>的祝福清单共有[<font color=red><b>"&mytotalrec&"</b></font>]个。<font color=green><直接点击歌名欣赏></font></td></tr></table><br>"&_
"<form name='kk' method='POST' action='qq_dgdel.asp?Action=DelOptFile'><table border='1' cellpadding=0 cellspacing=0 align=center width='100%'><tr height='25'><td colspan=7 style='border-top:1px #cccccc;' align=center>--== 论坛点歌台-管理点歌列表 ==--</td></tr><tr><td width='10%' height='22' align=center>点歌人</td><td width='10%' height='22' align=center>对方姓名</td><td width='15%' height='22' align=center>歌名</td><td width='16%' height='22' align=center>时间</td><td width=* height='22' align='center'>祝福语</td><td width='10%' height='22' align=center colspan='2'>操作</td></tr>"
set rs=server.createobject("adodb.recordset")
sql="select * from media Order By sendtime Desc"
rs.open sql,connDG,1,1
if rs.eof and rs.bof then
currentpage=0
Content=Content&"<tr><td valign=middle colspan=7>当前没有点歌列表</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)
Content=Content&"<tr><td align=center valign=middle><a href='userinfo.asp?name="&rs("sender")&"'><font color=blue>"&rs("sender")&"</font></a></td><td align=center valign=middle>"
if trim(rs("incept"))<>"全体会员" then
Content=Content&"<a href='userinfo.asp?name="&rs("incept")&"')><font color=#CC66FF>"&rs("incept")&"</font></a>"
else
Content=Content&"<font color=olive>"&rs("incept")&"</font>"
end if
Content=Content&"</td><td align=center valign=middle><a href='qq_dgplay.asp?url="&replace(rs("url"),chr(32),"%20",1)&"&medianame="&replace(rs("medianame"),chr(32),"%20")&"' target=_blank>"&rs("medianame")&"</a></td><td align=center valign=middle>"&rs("sendtime")&"</td><td align=left valign=middle>"&rs("content")&"</td><td align=center valign=middle><a href=qq_admindgedit.asp?id="&rs("id")&">[编辑]</a></td><td align=center valign=middle><input type=checkbox name='checkbox' value="&rs("id")&"></td></tr>"
page_count = page_count + 1
rs.movenext
wend
end if
Content=Content&"</table>"
Content=Content&"<table border='0' cellpadding='0' cellspacing='0' align=center width='100%'><tr height='25'><td align=center><input type=checkbox name='selectall' onclick='selall(this)'> 全选 <input class='button' value='删除所选' type='button' onclick=""if(confirm('删除后将不能恢复!您确定要删除吗?'))form.submit()"" /></FORM></td></tr></table>"
dim endpage
Pcount=rs.PageCount
Content=Content&"<table border=0 cellpadding=0 cellspacing=0 Width='100%' align=center><tr><td valign=middle nowrap>页次:<b>"¤tpage&"</b>/<b>"&Pcount&"</b>页每页<b>10</b>条共有<b>"&totalrec&"</b>条点歌</td><td valign=middle nowrap><div align=right><p>分页:"
if currentpage > 4 then
Content=Content&"<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
Content=Content&"<font color=red>["&i&"]</font>"
else
Content=Content&"<a href=""?page="&i&""">["&i&"]</a>"
end if
end if
next
if currentpage+3 < Pcount then
Content=Content&"... <a href=""?page="&Pcount&""">["&Pcount&"]</a>"
end if
Content=Content&"</p></div></font></td></tr></table>"
Call BBS94KK.ShowTable("管理点歌列表",Content)
rs.close
set rs=nothing
call CloseDB()
bbs94kk.footer()
%> |
|