<META HTTP-EQUIV="expires" CONTENT="0">
<% Response.Expires = -1
  Response.ExpiresAbsolute = Now() - 1
  Response.cachecontrol = "no-cache"
 %>
 <!--#include file="function.asp"-->
<%CheckAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/config_list.asp"-->
<%
if request("page")<>"" then
	currentPage=cint(request("page"))
else
	currentPage=1
end if

if request("classid")<>"" then
	classid=request("classid")
else
	classid="1"
end if
if request("Sclassid")<>"" then
	Sclassid=request("Sclassid")
else
	Sclassid=""
end if


if request("IsGood")<>"" then
	IsGood=request("IsGood")
else
	IsGood=""
end if

if request("hitsdesc")<>"" then
	hitsdesc=request("hitsdesc")
else
	hitsdesc=""
end if
%>
<!--#include file="top.asp"-->
<div style="text-align:center; border:#0066FF 1px solid; width:90%; margin-left:20px; height:22px; padding-top:3px;">
<%
dim i
i=0 
MaxList=9
set rs=server.createobject("adodb.recordset")
sql="select * from sclass order by classid"
rs.open sql,conn,1,1
'i=request("id")
'if i="" then i=rs("SClassid")
do while not rs.eof
	i=i+1
%>

		<a href="888wang_song_main.asp?SClassid=<%=rs("SClassID")%>&IsGood=<%=IsGood%>&hitsdesc=<%=hitsdesc%>"><b><%=rs("SClass")%></b></a>
      <%
	if i>=MaxList then exit do
    rs.movenext
	loop
	rs.close
%>
</div>
<%
set rs=server.createobject("adodb.recordset")

if classid<>"" then
if SClassid<>"" then
		'是否只显示推荐的,技术支持888wang.com QQ:56566918
		if request.QueryString("IsGood") ="list" then
			'是否按点击排序
			if  request.QueryString("hitsdesc") ="yes" then
				sql="select * from MusicList where SClassID="+cstr(SClassID)+" and classid="+cstr(classid)+" and isgood=1 order by hits desc" 
			else
				sql="select * from MusicList where SClassID="+cstr(SClassID)+" and classid="+cstr(classid)+" and isgood=1 order by id desc" 
			end if
			
			
		else
			if  request.QueryString("hitsdesc") ="yes" then
				sql="select * from MusicList where SClassID="+cstr(SClassID)+" and classid="+cstr(classid)+" order by hits desc" 
			else
				sql="select * from MusicList where SClassID="+cstr(SClassID)+" and classid="+cstr(classid)+" order by id desc" 
			end if
		end if	
		
	
	else
		'是否只显示推荐的,技术支持888wang.com QQ:56566918
		if request.QueryString("IsGood") ="list" then
			'是否按点击排序
			if  request.QueryString("hitsdesc") ="yes" then
				sql="select * from MusicList where classid="+cstr(classid)+" and isgood=1 order by hits desc" 
			else
				sql="select * from MusicList where classid="+cstr(classid)+" and isgood=1 order by id desc" 
			end if
			
			
		else
			if  request.QueryString("hitsdesc") ="yes" then
				sql="select * from MusicList where classid="+cstr(classid)+" order by hits desc" 
			else
				sql="select * from MusicList where classid="+cstr(classid)+" order by id desc" 
			end if
		end if	
				
	end if
	
else	
	if request.QueryString("IsGood") ="list" then
			sql="select * from MusicList where isgood=1 order by id desc"
		else
			sql="select * from MusicList order by id desc"
		end if
	

	
end if
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>" 
	'showList
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,"888wang_song_main.asp" 
		showContent 
		showpage totalput,MaxPerPage,"888wang_song_main.asp" 
		'showList
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,"888wang_song_main.asp" 
			showContent 
			showpage totalput,MaxPerPage,"888wang_song_main.asp" 
			'showList
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,"888wang_song_main.asp" 
			showContent 
			showpage totalput,MaxPerPage,"888wang_song_main.asp" 
			'showList
		end if 
	end if 
	rs.close 
end if 

sub showContent 
dim i 
i=0 
%>
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" class="bordercolor">
  <tr>
    <td width="33%" align=center ><b>歌曲名字</b></td>
	<td width="12%" align=center ><b>点击量</b></td>
    <td width="17%" align=center ><b>所属分类</b></td>
	<td width="6%" align=center ><b>路径ID</b></td>
    <td width="6%" align=center ><b>审核</b></td>
	 <td width="7%" align=center ><b>生成</b></td>
    <td width="8%" align=center ><b>推荐</b></td>
    <td width="8%" align=center ><b>修改</b></td>
    <td width="9%" align=center ><b>删除</b></td>
  </tr>
  <%do while not rs.eof%>
  <tr>
    <td width="33%"><%=(i+1)%>.<a href="<%=urlPlay(rs("id"))%>" target="_blank&play"><%=rs("musicname")%></a></td>
	<td width="12%">
	  <form name="form2" method="post" action="888wang_song_hits.asp?act=edithits&id=<%=rs("id")%>">
	  <input type="text" name="hits" size="5" value="<%=rs("hits")%>">
	    <input type="submit" name="Submit2" value="go">
      </form>    </td>
    <td width="17%" align=center>
	 <select name="sclass" disabled >
    <%
	set rsSmall=server.createobject("adodb.recordset")
	sqlSmall="select * from sclass order by sclassid"
	rsSmall.open sqlSmall,conn,1,1
	if rsSmall.eof and rsSmall.bof then
		response.Write("<option value=无分类 >无分类</option>")
	else
		response.Write("<option value=0>无</option>")
	do while not rsSmall.eof
	sclassid_small=rsSmall("sclassid")
	%>
    		<option value="<%=sclassid_small%>" <%if sclassid_small=rs("SClassid") then %>  selected  <%end if%> ><%=rsSmall("sclass")%></option>
	<%
	rsSmall.movenext
	loop 
	end if
	rsSmall.close
	%>
	</select>
    
	<a href="888wang_song_add.asp?SClassid=<%=rs("SClassid")%>">[添歌]</a></td>
	<td width="6%" align=center><%=rs("url")%> </td>
    
    <td width="6%" align=center><a href="888wang_song_isgood.asp?act=isCheck&id=<%=rs("id")%>&Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&page=<%=CurrentPage%>">
      <%if rs("ischeck")=1 then%>
      <font color=red>已审核</font>
      <%else%>
      未审核
      <%end if%> </td>
    
	 <td width="7%" align=center><a href="make_play.asp?jim=<%=rs("id")%>">生成</a></td>
    <td width="8%" align=center><a href="888wang_song_isgood.asp?act=SetIsGood&id=<%=rs("id")%>&Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&page=<%=CurrentPage%>">
      <%if rs("IsGood")=true then%>
      <font color=red>已推荐</font>
      <%else%>
      未推荐
      <%end if%>
    </a></td>
    <td width="8%" align=center><a href="888wang_song_modify.asp?id=<%=rs("id")%>&AskClassid=<%=rs("classid")%>&page=<%=CurrentPage%>">修改</a></td>
    <td width="9%" align=center><a href="888wang_song_del.asp?id=<%=rs("id")%>&classid=<%=classid%>&SClassid=<%=SClassid%>&page=<%=CurrentPage%>" onClick="{if(confirm('确定要删除记录吗?')){return true;}return false;}">删除</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%>&IsGood=<%=IsGood%>&hitsdesc=<%=hitsdesc%>">
  <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%>&IsGood=<%=IsGood%>&hitsdesc=<%=hitsdesc%>">首页</a>&nbsp; <a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&IsGood=<%=IsGood%>&hitsdesc=<%=hitsdesc%>">上一页</a>&nbsp;
  <%
end if
if n-currentpage<1 then
%>
  下一页 末页
  <%else%>
  <a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&IsGood=<%=IsGood%>&hitsdesc=<%=hitsdesc%>">下一页</a> <a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>&Sclassid=<%=Sclassid%>&IsGood=list&hitsdesc=yes">末页</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 Trs=nothing
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>





