<%PageName="search"%>
<%on error resume next%>
<!--#include file="conn.asp"-->
<!--#include file="star.INC"-->
<!--#include file="function.asp"-->
<%
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="top11.asp"-->
</SCRIPT><table width="900" BORDER="0" CELLSPACING="0" CELLPADDING="0" bgcolor="#FFFFFF">  

<tr> <td width="100%" align=center bgcolor="ffffff"> <table width="100%"> <tr> 
<td> <%
Set rs= Server.CreateObject("ADODB.Recordset")
if stype="Singer" then
sql="select * from Nclass"
elseif stype="Music" then
sql="select * from Musiclist" 
'sql="select m.musicname,m.id,m.hits,m.wma,m.singer,m.Nclassid,s.name,s.specialid from musiclist m,special s where m.musicname like '%"&keyword&"%' and m.specialid=s.specialid and m.Nclassid=s.Nclassid order by m.id desc" 
'sql="select * from Musiclist where MusicName like '%"&keyword&"%'"
elseif stype="Special" then
sql="select * from Special"
else
end if
rs.open sql,conn,1,1
if stype="Singer" then
 rs.filter = "Nclass Like '%"& keyword &"%'"
end if
if stype="Music" then
 rs.filter = "MusicName like '%"&keyword&"%'"
end if
if stype="Special" then
 rs.filter = "Name 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=10
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 
%> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <td><div align="center"> 
<!-----------------------搜索歌手-----------------------------> <%if stype="Singer" then%> 
<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#c0c0c0" bordercolordark="#FFFFFF" class="TableLine"> 
<tr> <td width="50%" height=22 align=center bgcolor="#C0C0C0">歌手</td>
	<td width="25%" height=22 align=center bgcolor="#C0C0C0">收录歌曲</td>
	<td width="25%" height=22 align=center bgcolor="#C0C0C0">收录专辑</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%">&nbsp;&nbsp;<%=i%>.&nbsp;<a href="Albumlist.asp?Name=恋菲音乐网music.skygd.cn&ID=<%=rs("SClassid")%>&ArtID=<%=rs("NClassid")%>"><%=rs("Nclass")%><%=rs("En")%></a></td><td width="25%" align=center><%=TotalMNum%>　</td><td width="25%" align=center><%=TotalSNum%>　</td></tr> 
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
set Trs=nothing
%> </table><!-----------------------搜索歌曲-----------------------------> <%elseif stype="Music" then%> 
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="3" CLASS="TableLine" BORDERCOLOR="#C0C0C0" > 
<TR>
	<TD WIDTH="42%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">歌曲名字</TD>
	<TD WIDTH="18%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">歌手</TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">人气</TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">试听</TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">下载</TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><FONT COLOR="#000000">歌词</FONT></TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">点歌</TD>
	<TD WIDTH="6%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">音乐盒</TD>
	<TD WIDTH="4%" HEIGHT=22 ALIGN=center BGCOLOR="#C0C0C0" STYLE="border-left: 1 solid #c0c0c0; border-right: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0">铃声</TD></FORM></TR> 
<%do while not rs.eof%> <TR> <TD STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"> 
<%=i%>.<a href="Yxplay.asp?id=<%=rs("id")%>" target="lbsong" title="试听"><%=rs("MusicName")%></A></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><A HREF="Albumlist.asp?Name=环球音乐www.hqwl.org&ID=<%=rs("SClassid")%>&ArtID=<%=rs("NClassid")%>"><%=rs("Singer")%></A></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><%=rs("hits")%></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><%if rs("Wma")<>"" then%><a href="Yxplay.asp?id=<%=rs("id")%>" target="_blank" title="试听"><IMG SRC="indeximg/wma.gif" WIDTH="16" HEIGHT="17" BORDER="0"></A><%else%>暂无<%end if%></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><A HREF="#" ONCLICK="window.open('Yxdown.asp?id=<%=rs("id")%>','yxdown','scrollbars=no,resizable=no,width=610,height=302,menubar=no,top=98,left=68')"><IMG SRC="indeximg/down.gif" WIDTH="14" HEIGHT="12" BORDER="0"></A></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><%if rs("songwords")<>"" then%> 
<A HREF="#" ONCLICK="window.open('songword.asp?id=<%=rs("id")%>','hqwl','scrollbars=yes,resizable=no,width=300,height=400,menubar=no,top=100,left=200');"><IMG SRC="images/note.gif" WIDTH="16" HEIGHT="16" BORDER="0"></A> 
<%else%> <A HREF="#"><IMG SRC="indeximg/word.gif" BORDER="0"></A> <%end if%> </TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><A HREF="#" ONCLICK="window.open('Mailsong.asp?id=<%=rs("id")%>','','scrollbars=no,resizable=no,width=419,height=151,menubar=no,top=98,left=198')"><IMG SRC="indeximg/diange.gif" WIDTH="13" HEIGHT="12" BORDER="0"></A></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><A HREF="Box.asp?action=add&id=<%=rs("id")%>" TARGET="_blank" TITLE="会员才能使用音乐盒"><IMG SRC="indeximg/shoucang.gif" WIDTH="14" HEIGHT="15" BORDER="0"></A></TD><TD ALIGN=center STYLE="border-left: 1 solid #c0c0c0; border-right: 1 solid #c0c0c0; border-top: 1 solid #c0c0c0"><A HREF="http://www.caishow.com/ring_body.asp?f=186&search=<%=rs("MusicName")%>" TARGET="_blank" TITLE="手机铃声"><IMG SRC="indeximg/sms.gif" WIDTH="13" HEIGHT="15" BORDER="0"></A></TD></TR> 
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%> 
</TABLE><!-----------------------搜索专辑-----------------------------> <%elseif stype="Special" then%> 
<table border="1" width="100%" cellspacing="0" cellpadding="3" class="TableLine" bordercolor="#C0C0C0" bordercolordark="#FFFFFF"> 
<tr BGCOLOR="#C0C0C0"> <td width="30%" height=22 align=center>专辑</td><td width="16%" height=22 align=center>歌手</td><td width="17%" height=22 align=center>更新日期</td><td width="9%" height=22 align=center>语种</td><td width="7%" height=22 align=center>收录歌曲</td><td width="9%" height=22 align=center>点击</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>&nbsp;<%=i%>.<a href="MusicList.asp?Name=环球音乐www.hqwl.org&AlbumID=<%=rs("Specialid")%>"><%=rs("Name")%></a></td><td align=center><a href="Albumlist.asp?Name=环球音乐www.hqwl.org&ID=<%=rs("SClassid")%>&ArtID=<%=rs("NClassid")%>"><%=rs("Nclass")%></a></td><td align=center><%=rs("Times")%></td><td align=center><%=rs("Yuyan")%>　</td><td align=center><%=TotalMNum%>　</td><td align=center><%=rs("Hits")%>　</td></tr> 
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
Set Trs=nothing
%> </table><!-----------------------搜索新闻-----------------------------> <%elseif stype="News" then%> 
<table border="1" width="90%" cellspacing="0" cellpadding="3" class="TableLine" bordercolor="#C0C0C0" bordercolordark="#FFFFFF"> 
<tr> <td width="80%" height=22 align=center bgcolor="#C0C0C0">新闻标题</td><td width="20%" height=22 align=center bgcolor="#C0C0C0">更新日期</td></tr> 
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM News where id="+cstr(rs("id"))
Trs.open Tsql,conn,1,1
TotalMNum=Trs.recordcount
Trs.close
%> <tr> <td width="80%">&nbsp;·<a target="_blank" href="News.asp?ID=<%=rs("ID")%>"><%=rs("Title")%></a></td><td width="20%" align=center><%=rs("DateAndTime")%></td></tr> 
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
Set Trs=nothing
%> </table></div><%
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=100% border="1" cellpadding="2" cellspacing="0" bordercolor="#c0c0c0" bordercolordark="#FFFFFF"> 
<tr> <td bgcolor="#EAEAEA" width="100%" align="center">共找到<font color="red"><b><%=totalnumber%></b></font>项记录 
&nbsp;分<b><font color="red"><%=n%></font></b>页显示 &nbsp;当前第<b><font color="red"><%=CurrentPage%></font></b>页 
<%if CurrentPage<2 then%> &nbsp;首页 &nbsp;上一页&nbsp; <%else%> &nbsp<a href="<%=filename%>?page=1&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red">首页</a>&nbsp; 
<a href="<%=filename%>?page=<%=CurrentPage-1%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red"><b>上一页</b></font></a>&nbsp; 
<%
end if
if n-currentpage<1 then
%> 下一页 &nbsp;末页 <%else%> <a href="<%=filename%>?page=<%=CurrentPage+1%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red"><b>下一页</b></font></a>&nbsp; 
<a href="<%=filename%>?page=<%=n%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="red">末页</a> 
<%end if%> </td></tr> </table></center></div><BR> <% 
end function
function Search
%> <%end function%> </td></table></table></center> </table><%
set rs=nothing
conn.close
set conn=nothing
%> 


<SCRIPT src="js/bottom.Js"></SCRIPT>
