<!--#include file="inc.asp"-->
<!--#include file="check.asp"-->
<%if request("act")="del" then
set rs=server.createobject("adodb.recordset")
sql="delete from SendMusic where id="&request("ID")
rs.open sql,conn,1,2
conn.close
set conn=nothing
page=request("page")
response.redirect "?page="& page
end if
if request("act")="delRC" then
set rs=server.createobject("adodb.recordset")
sql="delete from SendMusic where (fromuserdel=true and foruserdel=true)"
rs.open sql,conn,1,2
conn.close
set conn=nothing
response.redirect "?"
end if
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" width="100%" cellspacing="1" cellpadding="1">
<tr>
<td align=center valign=top>
<%
set rsmin=server.createobject("adodb.recordset")
sqlmin="select * from SendMusic where (fromuserdel=true and foruserdel=true)"
rsmin.open sqlmin,conn,1,1
'if rsmin.eof and rsmin.bof then
totalrc=rsmin.recordcount
'end if
rsmin.close
set rsmin=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from SendMusic order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有点歌</p>"
else
MaxPerPage=15
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
showContent
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
showContent
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
showContent
showpage totalput,MaxPerPage,"0hao_SMusicMana.asp"
end if
end if
rs.close
end if

sub showContent
dim i
i=0
%>
<table border="1" width="100%" cellspacing="1" cellpadding="0" class="TableLine" style="border-collapse:collapse;">
<tr>
<td height=24 colspan="8" align=center class="topbg"><font color="#FFFFFF">点 歌 管 理 &nbsp;&nbsp;&nbsp;<a href="<%=filename%>?act=delRC"><font color="#FFFFFF">清空回收站( <%=totalrc%> 条)</a></font></td>
</tr>
<tr>
<td width="5%" height="20" align="center" bgcolor="#EFF0EB">序号</td>
<td width="10%" height="20" align="center" bgcolor="#EFF0EB">点歌人</td>
<td width="10%" height="20" align="center" bgcolor="#EFF0EB">点歌给</td>
<td width="20%" height="20" align="center" bgcolor="#EFF0EB">歌名</td>
<td width="26%" height="20" align="center" bgcolor="#EFF0EB">祝福</td>
<td width="13%" height="20" align="center" bgcolor="#EFF0EB">时间</td>
<td width="11%" height="20" align="center" bgcolor="#EFF0EB">密码</td>
<td width="8%" height="20" align="center" bgcolor="#EFF0EB">删除</td>
</tr>
<%do while not rs.eof
i=i+1
%>
<tr height="22">
<td width="5%" align=center><%=rs("id")%>　</td>
<td width="10%" align=center title=QQ:<%=rs("Fromqq")%>><%=rs("FromUser")%>　</td>
<td width="10%" align=center title=QQ:<%=rs("Forqq")%>><%=rs("ForUser")%>　</td>
<td width="20%" align=center><a href=../qqdg/qqshow.asp?id=<%=rs("Id")%> target=_black><%=rs("MusicName")%></a>　</td>
<td width="26%"><%=rs("Words")%>　</td>
<td width="13%" align=center><%=rs("dateandtime")%>　</td>
<td width="11%" align=center><%=rs("password")%>　</td>
<td width="8%" align=center><a href="<%=filename%>?act=del&id=<%=rs("id")%>&page=<%=CurrentPage%>">删除</a></td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub

function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
%>
<form method=Post action="<%=filename%>?classid=<%=classid%>&Nclassid=<%=Nclassid%>">
<center>共<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>项点歌
<%if CurrentPage<2 then%>
&nbsp;首页 上一页&nbsp;
<%else%>
&nbsp<a href="<%=filename%>?page=1&classid=<%=classid%>&Nclassid=<%=Nclassid%>">首页</a>&nbsp;
<a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">上一页</a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">下一页</a>
<a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">末页</a>
<%end if%>
&nbsp;页次:<strong><font color="<%=AlertFColor%>"><%=CurrentPage%>/<%=n%></font></strong>页
转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>

<%
end function
%>
</td>
</tr>
</table>
</div>
<%
set rs=nothing
conn.close
set conn=nothing
%></body></html>