📄 search.asp
字号:
<%PageName="search"%>
<%
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="conn.asp"-->
<TITLE>搜索结果-音乐酒吧MTV-MTV视听-Http://Www.Y98.Cn</TITLE>
<script language="jscript.encode" src=../js/top.txt></script>
<SCRIPT language=JavaScript>
<!--
function goMenu(Val,Sel)
{
Sel.value = '';
if (Val) location=Val;
}
//--></SCRIPT>
<SCRIPT language=JavaScript>
<!--
function jumpMenu(obj)
{
window.location=obj.value;
}
//--></SCRIPT>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" valign="top">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="100%" bgcolor="#64CB1F" height="19" valign="bottom">
<b> 搜 索 结 果 :::...</b></td>
</tr>
<tr>
<td width="100%" colspan="2">
<%
'////////////////////////////■■■■■把以下部分复制到你搜索文件的相应部分,原来的语句去掉!■■■■///////////////////////////////////////
Set rs= Server.CreateObject("ADODB.Recordset")
if stype="Singer" then
sql="select * from Nclass"
elseif stype="Music" then
sql="select * from mtvlist"
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 = "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>"
end if
else
totalPut=rs.recordcount
MaxPerPage=15
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 width="100%" border="0" cellpadding="0" cellspacing="0">
<td><div align="center">
<!-----------------------搜索歌手----------------------------->
<%if stype="Singer" then%>
<table width="100%" border="1" cellspacing="1" bordercolor="#64CB1F" class="TableLine" style="border-collapse: collapse">
<tr>
<td width="25%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">歌
手</font></td>
<td width="30%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">进
入</font></td>
<td width="30%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">歌曲数量</font></td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM mtvList where Nclassid="+cstr(rs("Nclassid"))
Trs.open Tsql,conn,1,1
TotalMNum=Trs.recordcount
Trs.close
Tsql="SELECT * FROM Nclass where Nclassid="+cstr(rs("Nclassid"))
Trs.open Tsql,conn,1,1
Trs.close
%>
<form method="POST" action="NClassSave.asp?act=rename&NClassid=<%=rs("NClassid")%>" id=Nform<%=k%> name=Nform<%=k%>>
<tr>
<td> <%=i%>. <a href="../mtv/<%=rs("NClassid")%>_1.htm"><%=rs("NClass")%></a></td>
<td align=center><img src="../images/albumzx.gif" width="11" height="11" border="0"> <a href="../mtv/<%=rs("NClassid")%>_1.htm">进入该歌手歌曲列表</a></td>
<td align=center><%=TotalMNum%></td>
</tr>
</form>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
set Trs=nothing
%>
</table>
<!-----------------------搜索歌曲----------------------------->
<%elseif stype="Music" then%>
<table width="100%" border="1" cellspacing="1" bordercolor="#64CB1F" class="TableLine" style="border-collapse: collapse">
<tr>
<td width="33%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">MTV名称</font></td>
<td width="12%" align=center bgcolor="#64CB1F"><font color="#FFFFFF">所属歌手</font></td>
<td width="12%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">视 听</font></td>
<td width="11%" height=22 align=center bgcolor="#64CB1F">
<font color="#FFFFFF">人 气</font></td>
<td width="11%" align=center bgcolor="#64CB1F"><font color="#FFFFFF">音乐盒</font></td>
<td width="11%" height=22 align=center bgcolor="#64CB1F"><font color="#FFFFFF">下
载</font></td>
<td width="11%" align=center bgcolor="#64CB1F"><font color="#FFFFFF">会员下载</font></td>
</tr>
<%
do while not rs.eof
i=i+1
%>
<tr>
<td width="33%" height="22"> <%=i%>. <a href="../html/<%=rs("mtvlistid")%>.htm" target="_blank"><%=rs("name")%></a></td>
<td width="12%" align=center><a href="../mtv/<%=rs("NClassid")%>_1.htm"><%=rs("singer")%></a></td>
<td width="12%" align=center height="22"><a href="../html/<%=rs("mtvlistid")%>.htm" target="_blank"><img src="../images/rm.gif" alt="点击视听:<%=rs("name")%>" width="16" height="16" border="0"></a></td>
<td width="11%" align=center height="22"><%=rs("hits")%></td>
<td width="11%" align=center><a href="../user/musicsc.asp?action=add&id=<%=rs("mtvlistid")%>" target="_blank"><img src="../images/he.gif" alt="收藏歌曲:<%=rs("name")%>" width="15" height="15" border="0"></a></td>
<td width="11%" align=center height="22"><A href="#" onclick="window.open('../user/mtvdown.asp?id=<%=rs("mtvlistid")%>','y98cn','scrollbars=no,resizable=no,width=473,height=310,menubar=no,top=98,left=198')"><img src="../images/searchDown.gif" alt="点击下载:<%=rs("name")%>" width="16" height="16" border="0"></a></td>
<td width="11%" align=center><A href="#" onclick="window.open('../user/vipmtvdown.asp?id=<%=rs("mtvlistid")%>','y98cn','scrollbars=no,resizable=no,width=473,height=210,menubar=no,top=98,left=198')"><img src="../images/vipDown.gif" alt="VIP下载:<%=rs("name")%>" width="16" height="16" border="0"></a></td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
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
%>
<div align="center">
<center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td bgcolor="#ffffff" align="center"><%=Nclass%> 共找到<font color="#ff0000"><b><%=totalnumber%></b></font>个结果
分<font color="#ff0000"><%=n%></font>页显示 每页<font color="#ff0000">15</font>首
当前第<font color="#ff0000"><%=CurrentPage%></font>页
<a href="<%=filename%>?page=1&keyword=<%=keyword%>&stype=<%=stype%>"><font color="#000000">首页</font></a>
<%if CurrentPage<2 then%>上一页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage-1%>&keyword=<%=keyword%>&stype=<%=stype%>">上一页</a>
<%
end if
if n-currentpage<1 then
%>
下一页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>&keyword=<%=keyword%>&stype=<%=stype%>">下一页</a>
<%end if%>
<a href="<%=filename%>?page=<%=n%>&keyword=<%=keyword%>&stype=<%=stype%>"><font color="#000000">末页</font></a>
转到:<SELECT
style="BORDER-RIGHT: #aaaaaa 1px solid; BORDER-TOP: #aaaaaa 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #aaaaaa 1px solid; COLOR: #ff6600; BORDER-BOTTOM: #aaaaaa 1px solid; FONT-FAMILY: arial; BACKGROUND-COLOR: #ffffff"
onchange=goMenu(this.options[this.selectedIndex].value,this)
name=select>
<%for i = 1 to n%>
<option value="<%=filename%>?page=<%=i%>&keyword=<%=keyword%>&stype=<%=stype%>">第<%=i%>页</option>
<%next%>
</select>
</td>
</tr>
</table>
</center>
</div>
<%
end function
function Search
%></td>
</tr>
</table>
</td>
</tr>
</table>
<%end function%>
<%
set rs=nothing
conn.close
set conn=nothing
%></body>
<script language="jscript.encode" src=../js/end.txt></script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -