📄 cx.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="ADOVBS.INC"-->
<!--#include file="util.asp" -->
<!--#include file="function.asp" -->
<%
strAction=Request.Form("cmdMove")
If Not (strAction="前一页" or strAction="后一页") Then
DbPath = SERVER.MapPath("bookshop.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
set rs=server.createobject("adodb.recordset")
sqltext="select * from book"
if trim(request.form("txtFindInfo"))<>"" then
sqltext=sqltext &" where bookname like '%" &trim(request.form("txtFindInfo"))&"%' "
else
end if
'response.write sqltext
rs.open sqltext,conn,adOpenkeyset,adlockoptimistic,adcmdtext
rs.PageSize=10
If rs.eof Then
Emptyyn=true
Conn.close
Set rs=nothing
set conn=nothing
response.write"没有记录,请重新选择查询"
response.write"<br>"
response.write"<br>"
response.write"<a href='javascript:window.history.go(-1)'>返回</a>"
'Delay 1000
response.end
Else
rs.AbsolutePage=1
Set Session("rs")=rs
Session("pg")=1
End If
Else
Set rs=Session("rs")
Select Case strAction
Case "前一页"
If Session("pg")>1 Then
Session("pg")=Session("pg")-1
Else
Session("pg")=1
End if
rs.AbsolutePage=Session("pg")
Case "后一页"
If rs.AbsolutePage<rs.PageCount Then
Session("pg")=Session("pg")+1
Else
Session("pg")=rs.PageCount
End if
rs.AbsolutePage=Session("pg")
case Else
Session("pg")=1
rs.AbsolutePage=Session("pg")
End Select
End If
%>
<html>
<head>
<title>查询结果</title>
</head>
<body bgcolor="#ffffff">
<form Action="Add.asp" Method="POST">
<table Border="1" align="center" cellspacing="0" >
<tr bgcolor="#FFFFCC">
<td colspan="7" align="center"><font color="#990066">搜索结果</font></td>
</tr>
<tr bgcolor="#495E5F" >
<td align="center"><font color="#FFFFFF">选中</font></td>
<td align="center"><font color="#FFFFFF">商品名称</font></td>
<td align="center"><font color="#FFFFFF">生产厂家</font></td>
<td align="center"><font color="#FFFFFF">型号</font></td>
<td align="center"><font color="#FFFFFF">原价</font></td>
<td align="center"><font color="#FFFFFF">售价</font></td>
<td align="center"><font color="#FFFFFF">详情</font></td>
</tr>
<%
Page=0
do until rs.EOF
Page=Page+1
if Page>rs.PageSize then exit do
IsCheck=""
If InStr(Session("ProductList"), rs("bookbm")) > 0 Then
IsCheck="Checked"
End If
%>
<tr BGCOLOR="#D0E1D0" >
<td Align="Center" >
<input Type="CheckBox" Name="bookbm" Value="<%=rs("bookbm")%>" <%=IsCheck%>>
</td>
<td Align="left"><%=rs("bookname")%></td>
<td Align="center"><%=rs("Author")%></td>
<td Align="center"><% =rs("cd") %></td>
<td align="left" ><% =rs("price") %></td>
<td align="left" ><% =rs("yhj") %></td>
<td Align="center"><a href="fullinfo.asp?bookbm=<% =rs("bookbm") %>" target="_blank">详情</a></td>
</tr>
<%
rs.MoveNext
loop
%>
<tr>
<td colspan=7 bgcolor="#ffffff"> </td>
</tr>
<tr BGCOLOR="#3A766F">
<td align="left" colspan=4><font color="#FFFFFF">选择好商品后,点击"放入购物车"</font></td>
<td colspan=3 align="center"> <font color="#FFFFFF">
<input Type="submit" Value="放入购物车">
</font></td>
</tr>
</table>
</form>
<form action="cx.asp" name="查询" method="post">
<table align="center">
<tr>
<% If Session("pg")>1 Then %>
<td align="center"><input type="submit" name="cmdMove" value="前一页"> </td>
<%End If%>
<% If Session("pg")<rs.PageCount Then %>
<td align="center"><input type="submit" name="cmdMove" value="后一页"> </td>
<%End If%>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -