<!-- #include file="conn.asp"-->
<%
zhbg_grade=session("zhbg_grade")
if session("zhbg_name")=""  then Response.Redirect "../../error.asp?id=440"
%>
<html>
<head>
<title><%=Application("zhbg_chatroomname")%> - 点歌列表</title>
<link href="../../games/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #E2EDFE;
}
-->
</style>
</head>

<%

sql="select * from music order by dateandtime desc"

%>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<body oncontextmenu=self.event.returnValue=false>
<table width="99%"align="center" cellPadding="6"  border="0" bordercolorlight="#FFFFFF"cellspacing="0" >
  <tr>
<td bgcolor="#CCCCCC" colspan="6">
<%
mypage=request.QueryString("whichpage")
if mypage="" then
mypage=1
end if 
mypagesize=request.QueryString("pagesize")
if mypagesize="" then 
mypagesize=10
end if 
set rs = Server.CreateObject("adodb.recordset")
rs.cursorlocation=aduseclient
rs.cachesize=8
rs.open sql,conn,1,1
rs.movefirst
rs.pagesize=mypagesize
maxcount=cint(rs.pagecount)
rs.absolutepage=mypage
howmanyfields=rs.fields.count-1
tal=rs.RecordCount
response.Write"第"&mypage&"页，总共（"&maxcount&"）页总共有（"&tal&"）份祝福<br>"
%></td>
</tr>
<tr align="center">
<td bgcolor="#9AC1FC">点歌人</td>
<td bgcolor="#9AC1FC">赠给</td>
<td bgcolor="#9AC1FC">祝福</td>
<td bgcolor="#9AC1FC">歌曲</td>
<td bgcolor="#9AC1FC">日期</td>
<%if zhbg_grade>7 then%>
<td bgcolor="#9AC1FC">操作</td>
<%end if%>
</tr>
<%
tn=0
do while not rs.eof and tn < rs.pagesize %>
<tr align="center">
<td><%=rs("name")%></td>
<td><%=rs("toname")%></td>
<td>〈<a href="#" onClick="MM_openBrWindow('look.asp?id=<%=rs("id")%>','zhufu','width=400,height=300')">查看祝福</a>〉</td>
<td>〈<a href="#" onClick="MM_openBrWindow('Play.asp?id=<%=rs("id")%>','url','width=250,height=80')"><%=rs("songname")%></a>〉</td>
<td><%=left(rs("dateandtime"),len(cstr(rs("dateandtime")))-8)%></td>
<%if zhbg_grade>7 then%>
<td><a href="#" onClick="window.open('xg.asp?id=<%=rs("id")%>','xg','width=400,height=300')">修改</a>&nbsp;&nbsp;&nbsp;<a href="del.asp?id=<%=rs("id")%>">删除</a></td>
<%end if%>
</tr>
<tr>
<td  bgcolor="#9AC1FC" colspan="6">
<%
rs.MoveNext
tn=tn+1
loop
%>
<%
pad="0"
scriptname=request.ServerVariables("SCRIPT_NAME")
for counter =1 to maxcount
if counter>=10 then
pad=""
end if 
ref="<a href='"&scriptname&"?whichpage="&counter
ref=ref&"'>"&pad&counter&"页""</a>"
response.write ref&""
if counter mod  10 =  0 then
response.Write"<br>"
end if 
next
%></td>
</tr>
</table>