<%PageName="search"%>
<%on error resume next%>
<!--#include file="function.asp"-->
<!--#include file="star.INC"-->
<%
keyword=trim(request("keyword")) 
keyword=replace(keyword,"'","''") 
stype=request("stype")
if keyword="" then
errmsg=errmsg+"查找字符不能为空，请重输入查找的信息<a href=""javascript:history.go(-1)"">返回重查</a>"
call error()
Response.End 
end if
%>
<!--#include file="../inc/conn.asp"--><!--#include file="const.asp"-->
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="description" content="<%=guanjian%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="<%=name2%>" content="<%=name2%>">
<title><%=name2%>【<%=name%>】<%=guanjian%></title><%=css%>
<script src=../js/js.js></script>
<script language="javascript">
kstatus();
function kstatus(){
self.status="<%=tai%>";
setTimeout("kstatus()",0);
}
</script>
</head>
<!--#include file="../5233/5233_top.asp"-->
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="760" bgcolor="#FFFFFF">
    <tr>
      <td width="760">  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td bgcolor="#FFFFFF">
      <%
Set rs= Server.CreateObject("ADODB.Recordset")
if stype="Singer" then
sql="select * from Nclass where Nclass Like '%"& keyword &"%' order by Nclassid desc"
elseif stype="Music" then 
'sql="select * from MusicList where MusicName Like '%"& keyword &"%' order by id desc"
sql="select * from Musiclist"

elseif stype="Special" then
sql="select * from Special where Name Like '%"& keyword &"%' order by Specialid desc"
else
end if
'response.write sql
'response.end
rs.open sql,conn,1,1
if stype="Music" then
 rs.filter = "MusicName like '%"&keyword&"%'"
end if

if not isempty(request.QueryString("page")) then
currentPage=cint(request.QueryString("page"))
else
currentPage=1
end if
if rs.eof and rs.bof then
if stype="Singer" then
response.write "<p align='center'><br><br>Sorry, 未 找 到 你 想 要 的 歌 手<br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
elseif stype="Music" then 
response.write "<p align='center'><br><br>Sorry, 未 找 到 你 想 要 的 歌 曲<br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
elseif stype="Special" then
response.write "<p align='center'><br><br>Sorry, 未 找 到 你 想 要 的 专 辑<br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
end if
else
totalPut=rs.recordcount
MaxPerPage=20
PageUrl="Search.asp"
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
search
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
search
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
search
end if
end if
rs.close
end if

sub showContent 
i=0 
%><!-----------------------搜索歌手----------------------------->
<%if stype="Singer" then%>
<table border="0" width="95%" align="center" cellspacing="1" cellpadding="0" bgcolor="#808080">
<tr>
<td width="50%" height=22 align=center bgcolor="#FFFFFF">歌手</td>
<td width="25%" height=22 align=center bgcolor="#FFFFFF">收录歌曲</td>
<td width="25%" height=22 align=center bgcolor="#FFFFFF">收录专辑</td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM MusicList where Nclassid="+cstr(rs("Nclassid"))
Trs.open Tsql,conn,1,1
TotalMNum=Trs.recordcount
Trs.close
Tsql="SELECT * FROM Special where Nclassid="+cstr(rs("Nclassid"))
Trs.open Tsql,conn,1,1
TotalSNum=Trs.recordcount
Trs.close
Tsql="SELECT * FROM Nclass where Nclassid="+cstr(rs("Nclassid"))
Trs.open Tsql,conn,1,1
Trs.close
%>
<tr>
<td width="50%" bgcolor="#FFFFFF" height="20">&nbsp;&nbsp;<%=i%>.&nbsp;<a href="../special/555t_<%=rs("NClassid")%>.htm"><%=rs("Nclass")%></a></td>
<td width="25%" align=center bgcolor="#FFFFFF" height="20"><%=TotalMNum%>　</td>
<td width="25%" align=center bgcolor="#FFFFFF" height="20"><%=TotalSNum%>　</td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
set Trs=nothing
%>
</table>
<!-----------------------搜索歌曲----------------------------->
<%elseif stype="Music" then%>
      <div align="center">
        <center>
<table border="0" width="95%" cellspacing="1" cellpadding="0" class="TableLine" bordercolor="#808080" bgcolor="#808080">
<form name="form" onSubmit="javascript:return lbsong();" target="musiclisten" action="../play/songlian.asp">

<td width="42" height=22 align=center bgcolor="#FFFFFF">选择</td>
<td width="307" height=22 align=center bgcolor="#FFFFFF">歌曲名字</td>
<td width="141" height=22 align=center bgcolor="#FFFFFF">歌手</td>
<td width="71" height=22 align=center bgcolor="#FFFFFF">人气</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">播放</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">歌词</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">下载</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">收藏</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">点歌</td>
<td width="39" height=22 align=center bgcolor="#FFFFFF">铃声</td>
<tr><%do while not rs.eof%>

<td align="center" width="42" bgcolor="#FFFFFF" height="20"><input type="checkbox" name="id" value="<%=rs("id")%>"></td>
<td width="307" bgcolor="#FFFFFF" height="20">&nbsp;<a href="javascript:play('<%=rs("id")%>')"><%=rs("MusicName")%></a></td> 
<td align=center width="141" bgcolor="#FFFFFF" height="20"><a href='special/555t_<%=rs("nclassid")%>.htm'><%=rs("Singer")%></a></td> 
<td align=center width="71" bgcolor="#FFFFFF" height="20"><%=rs("hits")%></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href="javascript:play('<%=rs("id")%>')"><%=b2%></a></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href="javascript:songword('<%=rs("id")%>')"><%=b3%></a></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href="javascript:down('<%=rs("id")%>')"><%=b4%></a></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href="../user/musicsc.asp?action=add&amp;id=<%=rs("id")%>" target="_blank"><%=b5%></a></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href=javascript:Mailsong('<%=rs("id")%>')><%=b6%></a></td> 
<td align=center width="39" bgcolor="#FFFFFF" height="20"><a href='http://pic.caishow.com/ring_body.asp?f=395&search=<%=rs("MusicName")%>' target='_blank'><%=b7%></a></td> 
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr>
<td align="center" colspan="10" height="22" width="761" bgcolor="#FFFFFF">
 <input type="button" value='' name="chkOthers" onClick="CheckAll(this.form)" title="选择显示的所有歌曲" style="width: 61px; height: 19px; background-image: url('../images/555t_br1.gif'); border-style: none; border-width: medium">&nbsp;<input type="button" name="chkOthers" value='' onClick="CheckOthers(this.form)" title="反向选择歌曲" style="width: 61px; height: 19px; background-image: url('../images/555t_br2.gif'); border-style: none; border-width: medium">&nbsp;<input type="submit" name="B1" value='' title="请先选择你想听的歌曲后再点击播放" style="width: 61px; height: 19px; background-image: url('../images/555t_br3.gif'); border-style: none; border-width: medium">&nbsp;
</td>
</tr>
</form>
</table></center>
      </div>
      <!-----------------------搜索专辑----------------------------->
<%elseif stype="Special" then%>
<table border="0" width="95%" align="center" cellspacing="1" cellpadding="0" bgcolor="#808080">
<tr>
<td width="25%" height=22 align=center bgcolor="#FFFFFF">专辑名称</td>
<td width="17%" height=22 align=center bgcolor="#FFFFFF">演唱歌手</td>
<td width="10%" height=22 align=center bgcolor="#FFFFFF">更新日期</td>
<td width="10%" height=22 align=center bgcolor="#FFFFFF">专辑语种</td>
<td width="10%" height=22 align=center bgcolor="#FFFFFF">人气</td>
<td width="8%" height=22 align=center bgcolor="#FFFFFF">收藏</td>
<td width="8%" height=22 align=center bgcolor="#FFFFFF">点播</td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM MusicList where Specialid="+cstr(rs("Specialid"))
Trs.open Tsql,conn,1,1
TotalMNum=Trs.recordcount
Trs.close
%>

<tr>
<td bgcolor="#FFFFFF" align="center" height="20">&nbsp;<%=i%>.<a href="../musiclist/555t_<%=rs("Specialid")%>.htm"><%=rs("Name")%></a></td>
<tdalign=center>
<td bgcolor="#FFFFFF" align="center" height="20">　                                                                     
<tdalign=center>                                                                     
<tdalign=center>                                                                     
<tdalign=center><a href="../special/555t_<%=rs("NClassid")%>.htm"><%=rs("Nclass")%></a><tdalign=center>　
  <td bgcolor="#FFFFFF" align="center" height="20"><%=rs("Times")%>　
    <td bgcolor="#FFFFFF" align="center" height="20"><%=rs("Yuyan")%>　
      <td bgcolor="#FFFFFF" align="center" height="20"><%=TotalMNum%>　
        <td bgcolor="#FFFFFF" align="center" height="20"><a href="albumsc.asp?action=add&amp;id=<%=rs("specialid")%>" target="_blank" title="会员才能使用专辑收藏夹">收藏</a>
        <td bgcolor="#FFFFFF" align="center" height="20"><a href=javascript:Mailalbum('<%=rs("specialid")%>')>点播</a>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
Set Trs=nothing
%>
</table>
<!-----------------------搜索专辑----------------------------->
<%elseif stype="Special" then%>
<% 
else 
end if 
%> 
<% 
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 
%> 
<BR><div align="center"> 
<center> 
<table width=95% border="1" cellpadding="2" cellspacing="0" bordercolor="#999999"> 
<tr><form method=Post action="<%=filename%>?keyword=<%=keyword%>&stype=<%=stype%>"> 
<td bgcolor="#FFFFFF" width="100%" align="center">共找到<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>项记录
 分<strong><font color="<%=AlertFColor%>"><%=n%></font></strong>页显示
 当前第<strong><font color="<%=AlertFColor%>"><%=CurrentPage%></font></strong>页 
<%if CurrentPage<2 then%>
 首页 上一页 
<%else%>
 <a href="<%=filename%>?page=1&keyword=<%=keyword%>&stype=<%=stype%>"></a> 
<a href="<%=filename%>?page=<%=CurrentPage-1%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red"><b>上一页</b></font></a> 
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red"><b>下一页</b></font></a> 
<a href="<%=filename%>?page=<%=n%>&keyword=<%=keyword%>&stype=<%=stype%>">末页</a>
<%end if%> 
</td></form> 

</tr>
</table>
</center>
</div>
<div align="center">
<% 
end function
function Search
%>
<%end function%> 
</div> 
</td>  
    <tr>
      <td bgcolor="#FFFFFF">
      　 
</td>  
</table> </td>
    </tr>
  </table>
  </center>
</div>
<% 
set rs=nothing 
conn.close 
set conn=nothing 
%> 
<!--#include file="../5233/5233_copyright.asp"-->







