📄 search_list.asp
字号:
<!--#include file="header.asp"-->
<%
if request("sr_var")="" then
response.write"<script language=javascript>alert('请输入要搜索的关键词');history.back();</Script>"
response.end
end if
if myobj.ChkStr(request("sr_var"))>50 then
response.write"<script language=javascript>alert('要搜索的关键词不能超过50个字符,每个汉字占两个字符');history.back();</Script>"
response.end
end if
if myobj.ChkStr(request("sr_var"))=false then
response.write"<script language=javascript>alert('要搜索的关键词中存在不允许的字符');history.back();</Script>"
response.end
end if
if request("sr_type")="" then
response.write"<script language=javascript>alert('请选择要搜索的类别');history.back();</Script>"
response.end
end if
if request("sr_type")<>1 and request("sr_type")<>2 and request("sr_type")<>3 then
response.write"<script language=javascript>alert('搜索类别值类型错误');history.back();</Script>"
response.end
end if
%>
<script language="JavaScript">
function tourl(form1_url){
location=form1_url;
for(var i=0;i<document.form1.elements.length;i++){
document.form1.elements[i].options[0].selected=true
}
}
</script>
<table width="776" height="500" border="0" align="center" cellpadding="0" cellspacing="0" class="t1">
<tr>
<td width="9" rowspan="2" valign="top" background="images/img31.gif"><img src="images/img30.gif" width="9" height="15"></td>
<td height="15" align="center" background="images/img35.gif"> </td>
<td width="13" rowspan="2" align="center" valign="top" background="images/img36.gif"><img src="images/img34.gif" width="13" height="15"></td>
<td background="images/img37.gif"> </td>
<td width="9" rowspan="2" align="right" valign="top" background="images/img33.gif"><img src="images/img32.gif" width="9" height="15"></td>
</tr>
<tr>
<td width="200" align="center" valign="top"><table width="190" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/img43.gif" width="190" height="28"></td>
</tr>
</table>
<table width="100" height="10" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where Year(join_time)=Year(getdate()) and Month(join_time)=Month(getdate()) order by search_count desc",conn,1,1
if rs.eof and rs.bof then
%>
<table width="190" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">没有本月加入的影片被搜索</td>
</tr>
</table>
<%
else
j=0
do while not rs.eof
j=j+1
%>
<table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" align="center"><%=j%></td>
<td width="120" align="left"><%if j=1 then%>
<strong>
<%end if%>
<a href="film.asp?id=<%=rs("id")%>" title="<%=rs("film_name")%>">
<%if len(rs("film_name"))>12 then%>
<%=left(rs("film_name"),12)%>...
<%else%>
<%=rs("film_name")%>
<%end if%>
</a>
<%if j=1 then%>
</strong>
<%end if%></td>
<td width="40" align="right"><%if j=1 then%>
<strong>
<%end if%>
<%=rs("see_count")%>次
<%if j=1 then%>
</strong>
<%end if%></td>
</tr>
<tr align="center">
<td height="5" colspan="3"><table width="190" height="1" border="0" cellpadding="0" cellspacing="0" class="t2">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</table>
<%
if j>=20 then exit do
rs.movenext
loop
end if
rs.close
%></td>
<td width="543" align="center" valign="top"><table width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">搜索:<span class="f3">
<%if request("sr_type")=1 then%>
影片名称(别名)
<%end if%>
<%if request("sr_type")=2 then%>
主要演员
<%end if%>
<%if request("sr_type")=3 then%>
影片导演
<%end if%>
</span>中包含关键词 <span class="f3"><%=request("sr_var")%></span> 的影片</td>
</tr>
</table>
<%
if request("sr_type")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where film_name like '%"&request("sr_var")&"%' or other_name like '%"&request("sr_var")&"%' order by id desc",conn,1,1
end if
if request("sr_type")=2 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where film_player like '%"&request("sr_var")&"%' order by id desc",conn,1,1
end if
if request("sr_type")=3 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where film_director like '%"&request("sr_var")&"%' order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="500" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">没有搜索到任何符合条件的影片</td>
</tr>
</table>
<%
else
maxpage=10 '每页最大显示数
dim totalhow '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
if (totalhow mod MaxPage)=0 then
currentpage= totalhow \ MaxPage
else
currentpage= totalhow \ MaxPage + 1
end if
end if
if (currentPage-1)*MaxPage<totalhow then
rs.move (currentPage-1)*MaxPage
else
currentPage=1
end if
%>
<table width="530" height="30" border="0" cellpadding="0" cellspacing="0">
<form name="form1" method="post">
<tr>
<td width="200"> 共<span class="f3"><%=totalhow%></span>部影片 第<span class="f3"><%=currentPage%></span>页/共<span class="f3"><%=totalpage%></span>页 </td>
<td width="300" align="right"><font face="Webdings">7</font> <!--首页头--><%if currentpage>1 then%><a href="search_list.asp?sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%><!--首页尾--> <!--上一页头--><%if currentpage>1 then%><a href="search_list.asp?page=<%=currentPage-1%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>上一页<%if currentpage>1 then%></a><%end if%><!--上一页尾--> <!--下一页头--><%if cint(currentpage)<totalpage then%><a href="search_list.asp?page=<%=currentPage+1%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a><%end if%><!--下一页尾--> <!--尾页头--><%if cint(currentpage)<totalpage then%><a href="search_list.asp?page=<%=totalpage%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a><%end if%><!--尾页尾-->
<font face="Webdings">8</font>
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%for j=1 to totalpage%>
<option value="search_list.asp?page=<%=j%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select>
</td>
</tr>
</form>
</table>
<table width="500" height="1" border="0" cellpadding="0" cellspacing="0" class="t2">
<tr>
<td></td>
</tr>
</table>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="530" height="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<%for i=1 to 10
if rs.eof then exit for%>
<td width="110" align="right"><a href="film.asp?id=<%=rs("id")%>"><img src="filmpic/<%=rs("film_pic")%>" width="100" height="135" border="1" class="img1" title="[主要演员]:<%=rs("film_player")%>"></a>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<td width="155" align="right"><table width="145" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left"><strong><A class="f2" href="film.asp?id=<%=rs("id")%>" title="<%=rs("film_name")%>">
<%if len(rs("film_name"))>10 then%>
<%=left(rs("film_name"),10)%>...
<%else%>
<%=rs("film_name")%>
<%end if%>
</A></strong></td>
</tr>
</table>
<table width="145" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><a class="f6" href="film.asp?id=<%=rs("id")%>" title="[主要演员]:<%=rs("film_player")%>"><%=left(rs("film_gut"),80)%>......</a></td>
</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<%
if i mod 2=0 then
%>
</tr>
<tr>
<%
end if
rs.movenext
next
%>
</tr>
</table></td>
</tr>
</table>
<!-----分页------>
<table width="500" height="1" border="0" cellpadding="0" cellspacing="0" class="t2">
<tr>
<td></td>
</tr>
</table>
<table width="530" height="30" border="0" cellpadding="0" cellspacing="0">
<form name="form2" method="post">
<tr>
<td width="200"> 共<span class="f3"><%=totalhow%></span>部影片 第<span class="f3"><%=currentPage%></span>页/共<span class="f3"><%=totalpage%></span>页 </td>
<td width="300" align="right"><font face="Webdings">7</font> <!--首页头--><%if currentpage>1 then%><a href="search_list.asp?sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%><!--首页尾--> <!--上一页头--><%if currentpage>1 then%><a href="search_list.asp?page=<%=currentPage-1%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>上一页<%if currentpage>1 then%></a><%end if%><!--上一页尾--> <!--下一页头--><%if cint(currentpage)<totalpage then%><a href="search_list.asp?page=<%=currentPage+1%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a><%end if%><!--下一页尾--> <!--尾页头--><%if cint(currentpage)<totalpage then%><a href="search_list.asp?page=<%=totalpage%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a><%end if%><!--尾页尾-->
<font face="Webdings">8</font>
<select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
<%for j=1 to totalpage%>
<option value="search_list.asp?page=<%=j%>&sr_type=<%=request("sr_type")%>&sr_var=<%=request("sr_var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
<%next%>
</select>
</td>
</tr>
</form>
</table>
<%
end if
rs.close
%>
<table width="100" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -