📄 search.asp
字号:
<!--#include file="conn.asp"-->
<html>
<title>VOD点播系统</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="#ffffff">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="730">
<tr>
<td width="100%">
<iframe marginwidth=0 marginheight=0 frameborder=0 bordercolor='#000000' scrolling=no src='head.asp' width=748 height=80></iframe></td>
</tr>
</table>
<table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div align="center">
<tr><td height="3"> </td></tr>
</table>
<table border="0" width="98%" cellspacing="0" cellpadding="0" id="table28" height="580">
<tr>
<td height="4">
<table width="571" height="30" border="0" align="center" cellpadding="0" cellspacing="0" id="table29">
<tr>
<td >
<table border="0" width="83%" cellspacing="0" cellpadding="0" id="table30" height="21">
<tr>
<td align="right" valign="top"><font color="#000000">
<span style="font-size: 12px"> 影 片 搜 索</span></font></td>
</tr>
</table>
</td>
<td width="133" valign="top">
<form action="search.asp" method="post" name="form1" style="margin: 0px">
<table width="390" border="0" align="left" cellPadding="0" cellSpacing="0">
<tr>
<td width="144" valign="top"><span lang="zh-cn">
<select class="smallSel" name="typeid" size="1">
<option selected name="typeid" value="片名">=按影片名称=</option>
<option name="typeid" value="演员">=按主要演员=</option>
</select></span></td>
<td width="113" valign="top">
<input id="key" name="keyword" onfocus="this.value=''" size="10" value="关键字搜索"></td>
<td width="77">
<div align="center">
<input border="0" name="imageField" src="../images/search.gif" type="image"></div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</tr>
<tr>
<td height="522" align="center" valign="top">
<%
name=trim(request("keyword"))
name=replace(name,"'","''")
if request("typeid")="片名" then
sql="select * from Playbill where title Like '%"& name &"%'order by pro_id desc"
else
sql="select * from Playbill where name Like '%"& name &"%'order by pro_id desc"
end if
set rs=server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if name="" then
response.write"<font color=""#FF5050"">查找字符不能为空串,请重输入查找的信息<a href=""javascript:history.go(-1)"">返回重查</a></font>"
response.end
elseif rs.eof then
response.write"<font color=""#FF5050"">没有你要查找的信息<a href=""javascript:history.go(-1)"">返回重查</a></font>"
response.end
else
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
end if
%>
<%
const MaxPerPage=3
dim totalPut
dim CurrentPage
dim TotalPages
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rst=server.CreateObject("ADODB.RecordSet")
%>
<%
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 电 影</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
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
showContent
showpage totalput,MaxPerPage,"search.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"search.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"search.asp"
end if
end if
end if
sub showContent%>
<table width="560" height="57" border="1" align="center" cellpadding="0" cellspacing="0" id="table31">
<%do while not rs.eof %>
<tr>
<td width="141" height="33" >
<table width="103%" height="21" border="0" cellpadding="0" cellspacing="0" id="table32">
<tr>
<td align="center"><span style="font-size: 12px">[<%=rs("typeid")%>]</span></td>
</tr>
</table>
</td>
<td width="413" height="33" >
<table border="0" width="54%" cellspacing="0" cellpadding="0" id="table33">
<tr>
<td align="center"><font color="#000000">
<span style="font-size: 12px">
<a target="_self" href="db.asp?title=<%=rs("title")%>">
<font color="#000000"><%=rs("title")%></a>
<%=rs("dateandtime")%></span></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<table border="0" width="532" cellspacing="0" cellpadding="0" id="table38" height="128">
<tr>
<td width="135" align="center"><font color="#051547">
<span style="font-size: 12px">[主 演]</span></font></td>
<td width="397"><font color="#5C5B5B">
<span style="font-size: 12px"><%=rs("name")%></span></font></td>
</tr>
<tr>
<td width="135" align="center"><font color="#051547">
<span style="font-size: 12px">[推荐级别]</span></font></td>
<td width="397"><font color="#800000">
<span style="font-size: 12px"><%=rs("Level")%></span></font></td>
</tr>
<tr>
<td width="135" align="center"><font color="#051547">
<span style="font-size: 12px">[收看次数]</span></font></td>
<td width="397"><font color="#5C5B5B">
<span style="font-size: 12px"><%=rs("hits")%></span></font></td>
</tr>
<tr>
<td width="135" height="12" align="center" valign="top">
<span style="font-size: 12px">[影片介绍]</span></td>
<td width="397" height="12" valign="top">
<span style="font-size: 12px">
<%
content=rs("content")
if len(content)>65 then content=left(content,65)&"……"
content=replace(content,"<p>","")
response.write content%></span></td>
</tr>
</table>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="560" height="57" align="center" cellpadding="1" cellspacing="1" id="table31">
<tr>
<td align="center">
<% end sub
function showpage(totalnumber,maxperpage,filename)%>
<% if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
Response.Write "共有影片:<font face=""arial"" color=""red"">"&totalnumber&"</font>部 当前页:<font face=""arial"" color=""red"">"&CurrentPage&"</font> 共<font face=""arial"" color=""red"">"&n&"</font>页 "
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?keyword="&name&"&page=1&>首页</a> "
response.write "<a href="&filename&"?keyword="&name&"&page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?keyword="&name&"&page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?keyword="&name&"&page="&n&">尾页</a>"
end if
response.write " </td>"
'response.write "<form name=""Listbox1"">"
response.write "<td width=""12%"" height=""18"">" %>
</td>
</tr>
</table>
<%
end function
%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -