<!--#include file="const.asp"-->
<!--#include file="error.ini"-->
<%PageName="songwordsadmin"%>
<!--#include file="Top.asp"-->
<%if session("flag")>1 then
    response.write "<script>alert('您的操作权限不够！');history.back();</script>"
    response.end
end if
%>
<link href="Images/Admin_Style.Css" rel="stylesheet" type="text/css">
<%
if request("page")<>"" then
	currentPage=cint(request("page"))
else
	currentPage=1
end if

%>
<div align="center">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from MusicList where shenhe=1 order by id desc" 
rs.open sql,conn,1,1
if rs.eof and rs.bof then 
	response.write "<p align='center'><b>暂时没有收集任何歌词或没有任何未通过审核的歌词<br><br><a href='javascript:history.go(-1)'>...::: 点 此 返 回 :::...</a></b></p>" 
	
else 
MaxPerPage=20
	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,"Admin_Word.Asp" 
		showContent 
		showpage totalput,MaxPerPage,"Admin_Word.Asp" 
		
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,"Admin_Word.Asp" 
			showContent 
			showpage totalput,MaxPerPage,"Admin_Word.Asp" 
			
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,"Admin_Word.Asp" 
			showContent 
			showpage totalput,MaxPerPage,"Admin_Word.Asp" 
			
		end if 
	end if 
	rs.close 
end if 

sub showContent 
dim i 
i=0 
%>
 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
            <tr class="title">
          <td width="40%" height="22" align="center"><strong>歌曲名字</strong></td>
          <td width="30%" height="22" align="center"><strong>所属歌手</strong></td>
          <td width="9%" height="22" align="center"><strong>歌词审核</strong></td>
          </tr>
<%do while not rs.eof%>
        <tr>
          <td width="40%" class=tdbg height=22> <%=(i+1)%>.<%=rs("MusicName")%></td>
          <td width="30%" class=tdbg height=22 align=center><%=rs("singer")%>  </td>
          <td width="9%" class=tdbg height=22 align=center><a href="Admin_Word_Edit.Asp?id=<%=rs("id")%>">进入审核</a></td> 
   </tr>
<%
	i=i+1
	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%>&Sclassid=<%=Sclassid%>&Nclassid=<%=Nclassid%>">
  <center>共<font color="#ff0000"><b><%=totalnumber%></b></font>首歌曲
<%if CurrentPage<2 then%>
  &nbsp;首页 上一页&nbsp;
<%else%>
  &nbsp<a href="<%=filename%>?page=1&classid=<%=classid%>&Sclassid=<%=Sclassid%>&Nclassid=<%=Nclassid%>">首页</a>&nbsp;
  <a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&Nclassid=<%=Nclassid%>">上一页</a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
  下一页 末页
<%else%>
  <a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&Nclassid=<%=Nclassid%>">下一页</a>
  <a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&Nclassid=<%=Nclassid%>">末页</a>
<%end if%>
  &nbsp;页次:<strong><font color="#ff0000"><%=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
%>

<%

set rs=nothing
conn.close
set conn=nothing
%></body></html>