📄 search.asp
字号:
<!--#include file="bzmtvconst.asp"-->
<%PageName="search"%>
<%on error resume next%>
<%CheckAdmin1%>
<!--#include file="../bzmtv-inc/path.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="top.asp"-->
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" height="19" align=center valign="bottom">
<b>...::: 搜 索 结 果 :::...</b></td>
<td width="0%" bgcolor="#FFB5D2"></td>
</tr>
<tr>
<td width="100%" colspan="2">
<%
'---------------------------search----------------------
Set rs= Server.CreateObject("ADODB.Recordset")
if stype="Singer" then
sql="select * from Nclass"
elseif stype="Special" then
sql="select * from Special"
elseif stype="User" then
sql="select * from user"
else
end if
rs.open sql,conn,1,1
if stype="Singer" then
rs.filter = "Nclass Like '%"& keyword &"%'"
end if
if stype="Special" then
rs.filter = "Name Like '%"& keyword &"%'"
end if
if stype="user" then
rs.filter = "UserName like '%"& keyword &"%'"
end if
rs.open sql,conn,1,1
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="Special" then
response.write "<p align='center'><br><br>Sorry, 未 找 到 你 想 要 的 MTV<br><br><a href=""javascript:history.go(-1)"">点 此 返 回</a><br><br></p>"
elseif stype="User" 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 border="1" width="96%" cellspacing="0" cellpadding="3" class="TableLine" bordercolor="GREEN" bordercolordark="#FFFFFF">
<tr>
<td width="45%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">歌手</font></td>
<td width="20%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">修改</font></td>
<td width="20%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">生成HTM</font></td>
<td width="15%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">删除</font></td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
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
%>
<form method="POST" action="bzmtv-35.asp?act=rename&NClassid=<%=rs("NClassid")%>" id=Nform<%=k%> name=Nform<%=k%>>
<tr>
<td> <%=i%>. <a href="bzmtv-5.asp?Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&NClassid=<%=rs("NClassid")%>"><%=rs("Nclass")%></a></td>
<td align=center><a href="bzmtv-34.asp?nclassid=<%=rs("NClassid")%>">修改歌手资料</a>
<td align=center><a title="生成 <%=rs("nclass")%> MTV列表文件" href="make_special.asp?bzmtv=<%=rs("nclassid")%>"><font color=blue>生成HTM</font></a></td>
<td align=center><a title="慎重! 删除后可是不能恢复了哦!" href='bzmtv-35.asp?act=del&NClassid=<%=rs("NClassID")%>'>删除</a></td>
</tr>
</form>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
set Trs=nothing
%>
</table>
<!-----------------------搜索MTV----------------------------->
<%elseif stype="Special" then%>
<table border="1" width="96%" cellspacing="0" cellpadding="3" class="TableLine" bordercolor="GREEN" bordercolordark="#FFFFFF">
<tr>
<td width="37%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">MTV名称</font></td>
<td width="12%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">所属歌手</font></td>
<td width="11%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">快速添歌</font></td>
<td width="11%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">推荐</font></td>
<td width="7%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">修改</font></td>
<td width="15%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">生成HTM</font></td>
<td width="7%" height=22 align=center background="bzmtv/bgleft.gif"><font color="GREEN">删除</font></td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM Special where Specialid="+cstr(rs("Specialid"))
Trs.open Tsql,conn,1,1
Trs.close
%>
<tr>
<td width="37%"><a href="bzmtv-6.asp?Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&NClassid=<%=rs("NClassid")%>&specialid=<%=rs("specialid")%>"><font color=black><%=rs("name")%></font></a> <a href="bzmtv-5-1.asp?Classid=<%=rs("Classid")%>&SClassid=<%=rs("SClassid")%>&NClassid=<%=rs("NClassid")%>&specialid=<%=rs("specialid")%>">[添歌]</a></td>
<td width="12%" align=center><%=rs("Nclass")%> </td>
<td width="11%" align=center><a href="bzmtv-5-2.asp?specialid=<%=rs("specialid")%>">快速添歌</a></td>
<td width="11%" align=center><a href="bzmtv-5-3-1.asp?act=SetIsGood&Specialid=<%=rs("Specialid")%>&Askclassid=<%=classid%>&AskSClassid=<%=SClassid%>&AskNclassid=<%=Nclassid%>&page=<%=CurrentPage%>"><%if rs("IsGood")=true then%><font color=red>撤销</font><%else%>推荐<%end if%></a></td>
<td width="7%" align=center><a href="bzmtv-5-4.asp?Specialid=<%=rs("Specialid")%>&AskClassid=<%=rs("Classid")%>&AskSClassid=<%=rs("SClassid")%>&AskNClassid=<%=rs("NClassid")%>&page=<%=CurrentPage%>">修改</a></td>
<td width="15%" align=center><a href="make_musiclist.asp?bzmtv=<%=rs("specialid")%>"><font color=blue>生成HTM</font></a></td>
<td width="7%" align=center><a href="bzmtv-5-5.asp?Specialid=<%=rs("Specialid")%>&classid=<%=rs("Classid")%>&AskSClassid=<%=rs("SClassid")%>&Nclassid=<%=rs("NClassid")%>&page=<%=CurrentPage%>">删除</a></td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
Set Trs=nothing
%>
</table>
<!-----------------------搜索会员----------------------------->
<%elseif stype="User" then%>
<div align="center">
<center>
<table border="0" width="96%" cellspacing="1" cellpadding="1">
<tr>
<td align=center valign=top>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="TableLine" bordercolor="GREEN" bordercolordark="#FFFFFF">
<tr>
<td width="13%" height=25 align=center background="bzmtv/bgleft.gif"><font color="GREEN">ID</font></td>
<td width="50%" height=25 align=center background="bzmtv/bgleft.gif"><font color="GREEN">用户名</font></td>
<td width="13%" height=25 align=center background="bzmtv/bgleft.gif"><font color="GREEN">修改</font></td>
<td width="13%" height=25 align=center background="bzmtv/bgleft.gif"><font color="GREEN">锁定</font></td>
<td width="13%" height=25 align=center background="bzmtv/bgleft.gif"><font color="GREEN">删除</font></td>
</tr>
<%
Set Trs= Server.CreateObject("ADODB.Recordset")
do while not rs.eof
i=i+1
Tsql="SELECT * FROM User where id="+cstr(rs("id"))
Trs.open Tsql,conn,1,1
Trs.close
%>
<tr>
<td height="22" align=center><%=rs("id")%> </td>
<td align=center><a href="bzmtv-8-1.asp?id=<%=rs("id")%>"><%=rs("UserName")%></a> </td>
<td align=center><input type=button name=edit value=修改 onclick="javascript:window.open('bzmtv-8-1.asp?id=<%=rs("id")%>','_self','')"></td>
<td align=center><input type=button name=lock value=<%if rs("lockuser")=false then%>"锁定"<%else%>"开锁"<%end if%> onclick="javascript:window.open('bzmtv-8-3.asp?id=<%=rs("id")%>&act=lock','_self','')"></td>
<td align=center><input type=button name=del value=删除 onclick="javascript:window.open('bzmtv-8-2.asp?id=<%=rs("id")%>','_self','')"></td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</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
%>
<div align="center">
<center>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr><form method=Post action="<%=filename%>?classid=<%=classid%>&Nclassid=<%=Nclassid%>">
<td bgcolor="#ffffff" align="center"><%=Nclass%> 共找到<font color="#ff0000"><b><%=totalnumber%></b></font>个结果
分<font color="#ff0000"><%=n%></font>页显示
当前第<font color="#ff0000"><%=CurrentPage%></font>页
<%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%> </td></form>
</tr>
</table>
</center>
</div>
<%
end function
function Search
%></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<%end function%><%
set rs=nothing
conn.close
set conn=nothing
%></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -