类型:转载 责任编辑:asp.net 日期:2007/05/23
热门软件下载:
<!--#include file="conn.asp"-->
<% dim keyword,stype,errmsg
keyword=cstr((request("keyword")))
stype=request("stype")
if keyword="" then
errmsg=errmsg+"查找字符不能为空,请重输入查找的信息<a href=""javascript:history.go(-1)"">返回重查</a>"
call error()
Response.End
end if
%>
<div align="center">
<table width=773 border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#000000" valign=middle>
<tr>
<td width="100%" align=center bgcolor="ffffff">
<table width="100%">
<tr>
<td>
<% dim rs,sql
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&"%"
elseif stype="Special" then
sql="select * from Special where Name Like %"& keyword &"% order by Specialid desc"
else
end if
rs.open sql,conn,1,1
dim currentPage
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>"
elseif stype="MusicWords" then
response.write "<p align=center><br><br>Sorry, 未 找 到 这 歌 词 的 歌 <br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
elseif stype="SpecialIntro" then
response.write "<p align=center><br><br>Sorry, 未 找 到 这 简 介 的 歌<br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
end if
else
dim totalPut,MaxPerPage,PageUrl
totalPut=rs.recordcount
MaxPerPage=2
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
dim i
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="#cbe97c">歌手</td>
<td width="25%" height=22 align=center bgcolor="#cbe97c">收录歌曲</td>
<td width="25%" height=22 align=center bgcolor="#cbe97c">收录专辑</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%"> <%=i%>. <a href="Albumlist.asp?Name=无忧音乐 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>
网友回答: