📄 search_easy_result.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<%
dim conn
dim connstr
Set conn=Server.CreateObject("ADODB.Recordset")
connstr="Driver={Microsoft ODBC for Oracle};server=mylink;uid=system;pwd=system;"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快速查询结果</title>
<style type="text/css">
td {font-size: x-small}
</style></head>
<body>
<%
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim rs,sql,keyword
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
keyword=ucase(request("keyword"))
if keyword="" then
response.write "<script language=javascript>alert('对不起,请您输入查讯关键字');history.go(-1);</script>"
else
sql="select product_id, product_kindnum,product_price from GSCOTT.product_info_table where product_isdel='n' and product_kindnum like '%"&keyword&"%'"&" order by product_id"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,connstr,1,1
%>
<!-- #include file="pagetop.asp" -->
<div align="center"><center>
<% if rs.eof and rs.bof then %>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr><td height="100"></td></tr>
<tr>
<td align="center"><font color="#0000FF" size="-1">对不起,没有查讯到您需要的商品!</font></td>
</tr>
<tr><td height="100"></td></tr>
</table>
<% else %>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr><td height="50"></td></tr>
<tr align="center">
<td><font size="-1"></font>商品型号</td>
<td>价格</td>
<td></td>
</tr>
<%
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_easy_result.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"search_easy_result.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"search_easy_result.asp"
end if
end if
sub showContent
dim i
i=0
do while not rs.eof
%>
<tr><td height="5"></td></tr>
<tr align="center">
<td><a href="shp_detail.asp?id=<%=rs("product_id")%>"><%=rs("product_kindnum")%></a></td>
<td><%=rs("product_price")%></td>
<td><img src="../img/goumai.gif"></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.MoveNext
loop
rs.Close
set rs=nothing
%>
</table>
<%
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 %>
<form method="Post" action="<%=filename%>?keyword=<%=keyword%>">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<% If CurrentPage<2 Then %>
<td width="8%" height="25"><span class="style2">首页</span></td>
<td width="8%"><span class="style2">上一页</span></td>
<% Else %>
<td width="8%"><a href=<%=filename%>?page=1&keyword=<%=keyword%> class="style2">首页</a></td>
<td width="8%"><a href=<%=filename%>?page=<%=CurrentPage-1%>&keyword=<%=keyword%> class="style2">上一页</a></td>
<% end if %>
<% If n-currentpage<1 Then %>
<td width="8%"><span class="style2">下一页</span></td>
<td width="8%"><span class="style2">末页</span></td>
<% Else %>
<td width="8%"><a href=<%=filename%>?page=<%=(CurrentPage+1)%>&keyword=<%=keyword%>><span class="style2">下一页</span></a></td>
<td width="8%"><a href=<%=filename%>?page=<%=n%>&keyword=<%=keyword%> class="style2">末页</a></td>
<% end if %>
<td width="8%"><span class="style2">第<%=CurrentPage%>页</span></td>
<td width="8%" class="style2">共<%=n%>页</td>
<td width="16%" height="25" colspan="2" align="center" class="style2">共<%=totalnumber%>条记录</td>
<td width="16%" colspan="2" align="center" class="style2">每页<%=maxperpage%>条记录</td>
</tr>
<tr align="center">
<td height="25" colspan="14"><span class="style2">转到第
<input type="text" name="page" size="2" maxlength="10" value="<%=currentpage%>">
页</span>
<input type="submit" value="跳转" name="cndok"></td>
</tr>
</table>
</form>
<%
End Function
%>
</center></div>
<% end if %>
<% end if %>
</body>
<!-- #include file="pagefooter.html" -->
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -