<!--#include file="inc.asp"-->
<!--#include file="check.asp"-->
<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">
<%
if not isempty(request.QueryString("page")) and request.QueryString("page")<>"" then
	currentPage=cint(request.QueryString("page"))
else
	currentPage=1
end if
if request("act")="del" then
conn.execute("update Special set adderror=0 where Specialid="&request("Specialid")&"")
Response.write "<SCRIPT language=JavaScript>alert('删除成功！');window.location.href='?Page="&currentPage&"';</SCRIPT>"
end if
set rs=conn.execute("SELECT * FROM class order by classid") 
if not Rs.eof then
	if Left(PageName,5)="admin" and PageName<>"index" then

			do while not rs.eof

			rs.movenext
			loop
		elseif PageName="AddFileList" or PageName="AddFileModify" or PageName="AddFileList" then

			do while not rs.eof

			rs.movenext
			loop
		else

			do while not rs.eof

			rs.movenext
			loop
		end if
	else

		do while not rs.eof

		rs.movenext
		loop
	end if
rs.close
%>
<div align="center">
  <center>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" style="border-collapse:collapse;">
<tr>
<td width="100%" height="22" align=center class="topbg"><strong>歌 曲 报 错 管 理</strong></td>
</tr>
  <tr>
    <td align=center width="100%" valign=top>
<%
sql="select * from Special where int(adderror)>0 order by int(adderror) desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then 
	response.write "<p align='center'>暂时没有任何歌曲报错</p>" 
else 
	MaxPerPage=30
	PageUrl="0hao_song_err.asp"
	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,PageUrl
		showContent 
		showpage totalput,MaxPerPage,PageUrl
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		end if 
	end if 
end if 
rs.close 
			
sub showContent 
i=0 %>
           <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolordark="#FFFFFF">
            <tr>
                <td width="30%" height=22 align=center class="tdbg"><b>歌曲名称</b></td>
                <td width="20%" height=22 align=center class="tdbg"><b>所属歌手</b></td>
                <td width="10%" height=22 align=center class="tdbg"><b>报错次数</b></td>
                <td width="10%" height=22 align=center class="tdbg"><b>修改</b></td>
                <td width="10%" height=22 align=center class="tdbg"><b>视听</b></td>
                <td width="10%" height=22 align=center class="tdbg"><b>删除</b></td>
              </tr>
<%
do while not rs.eof
	i=i+1
%>
              <tr>
                <td width="35%" height=22>&nbsp;<%=MaxPerPage*(currentPage-1)+i%>.<font color=black><%=rs("name")%></font></td>
                <td width="25%" height=22 align=center><%=rs("Nclass")%></td>
                <td width="10%" height=22 align=center><%=rs("adderror")%> 数</td>
                <td width="5%" height=22 align=center><a href="0hao_song_add.asp?Specialid=<%=rs("Specialid")%>&Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&NClassid=<%=rs("NClassid")%>&page=<%=CurrentPage%>">修改</a></td> 
                <td width="10%" height=22 align=center><a href="../Special/<%=rs("Specialid")%>.htm" target=_blank><font color=blue>视听</font></a></td>
                <td width="5%" height=22 align=center><a href="?Specialid=<%=rs("Specialid")%>&page=<%=CurrentPage%>&act=del"><font color=red>删除</font></a></td> 
              </tr>
<%
	if i>=MaxPerPage then exit do
rs.movenext
loop
%>
            </table>
<%
end sub 

function showpage(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
	n= totalnumber \ maxperpage
else
	n= totalnumber \ maxperpage+1
end if
%>
<form method=Post action="<%=filename%>?">
  <center>共有 <b><%=totalnumber%></b> 首歌曲报错
<%if CurrentPage<2 then%>
  &nbsp;首页 上一页&nbsp;
<%else%>
  &nbsp<a href="<%=filename%>?page=1">首页</a>&nbsp;
  <a href="<%=filename%>?page=<%=CurrentPage-1%>">上一页</a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
  下一页 末页
<%else%>
  <a href="<%=filename%>?page=<%=CurrentPage+1%>">下一页</a>
  <a href="<%=filename%>?page=<%=n%>">末页</a>
<%end if%>
  &nbsp;页次:<strong><%=CurrentPage%>/<%=n%></strong>页
  转到:<select name="page" size="1" onchange="if(this.options[this.selectedIndex].value!=''){location='?page='+this.options[this.selectedIndex].value;}">
<%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>
  </center>
  </div>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</body></html>

