⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productsearch.txt

📁 网上购物系统
💻 TXT
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp" -->
<%
ProductClass_2=request("ProductClass_2")
set rs=server.createobject("adodb.recordset")

sqltext="select * from Product" 

	if request("Product_Name")<>"" then
       sqltext=sqltext &" where  Product_Name like '%"& request("Product_Name") &"%' "
    else
       sqltext=sqltext &" where Product_Name like '%"& "" &"%' "
    end if
    if request("Product_Class")<>"" then
       sqltext=sqltext &" and Class_1 like '%"& request("Product_Class") &"%' "
    end if
rs.open sqltext,conn,1,1

dim MaxPerPage
MaxPerPage=9

'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
 Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
   checkpage=instr(1,text,mid(request("page"),i,1))
   if checkpage=0 then
      exit for 
   end if
next

If checkpage<>0 then
      If NOT IsEmpty(request("page")) Then
        CurrentPage=Cint(request("page"))
        If CurrentPage < 1 Then CurrentPage = 1
        If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
      Else
        CurrentPage= 1
      End If
      If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
   CurrentPage=1
End if

%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<STYLE type=text/css>.main {
	FONT-SIZE: 12px
}
.main1 {
	FONT-SIZE: 14px
}
.main2 {
	FONT-SIZE: 16px
}
.main3 {
	FONT-SIZE: 7px
}
.main4 {
	FONT-SIZE: 10px
}
A:link {
	COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
	COLOR: #000000; TEXT-DECORATION: none
}
A:active {
	COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #aa0000; TEXT-DECORATION: underline
}
</STYLE>
<script>
  function openbag(id) { window.open("check.asp?cpbm="+id,"","height=200,width=600,left=190,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");} 
</script>
<title>产品分类<%= request("Product_Name")%><%= request("Product_Class")%></title>
</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#000080" bordercolordark="#FFFFFF" height="19">
  <tr>
    <td width="100%" bgcolor="#6d8e4d"  height="20">
      <p align="right"><font color="#FFFFFF" class="main3">●</font><span class="main1"><font color="#FFFFFF"><a href="reg_user.htm">会员注册</a>   
      </font></span><font color="#FFFFFF" class="main3">●</font><span class="main1"><font color="#FFFFFF">订单查询                                                                                              
      </font></span><font color="#FFFFFF" class="main3">●</font><span class="main1"><font color="#FFFFFF"><a href="javascript:openbag()">查看购物车</a></font></span></p>
    </td>
  </tr>
</table>

<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#E6E4C4" bordercolordark="#E8E4C8" >
  <tr>
    <td width="100%" bgcolor="#e6e4c4" class="main1"> </td>
  </tr>
</table>

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="100%" height="80" background="images/back.gif">
    <tr>
      <td width="100%" colspan="3" height="18"></td>
    </tr>
    <tr>
      <td width="21%" height="62" valign="top">
         <table border="0" cellpadding="0" cellspacing="0" width="100%" class=main1 height="611" bgcolor="#F7F7F7">
            <tr>
              <td width="100%" bgcolor="#6D8E4D" height="22"><font color="#FFFFFF">&nbsp;会员登录</font></td>
            </tr>
            <tr>
              <td width="100%" height="88"> 
<form method="POST" action="LoginCheck.asp">
<p align="center"><br>
用户:<input type="text" name="UserName" size="11"><br>
密码:<input type="password" name="UserPass" size="11"><br>
<br>
<input type="submit" value="登录" name="B1" tabindex="1" style="font-size: 14px"><input type="reset" value="重置" name="B2" style="font-size: 14px">
</form>
</td>
            </tr>
            <tr>
              <td width="100%" height="22" bgcolor="#6D8E4D">&nbsp;<font color="#FFFFFF">商品检索</font></td>
            </tr>
            <tr>
              <td width="100%" height="60">
<form method='POST' action='ProductSearch.asp'>
<div align='center'><p><br>
请填入商品名称<br>
<input type='text' name='Product_Name' size='11' class='a'><br>
<select name='Product_Class' size='1' tabindex='0' class='a' style="font-size: 14px">

<%
	sqltext2="select * from Class_1 "
	set	rs_class_1=server.createobject("adodb.recordset")
	rs_class_1.open sqltext2,conn,1,1
	'if NOT rs_class_1.EOF then
	while not rs_class_1.EOF
%>
<option value=<%=rs_class_1("Class_1_Name")%>><%=rs_class_1("Class_1_Name")%></option>
<%
	rs_class_1.MoveNext
	wend
	rs_class_1.close
%>
</select><br>
<br>
<input type='submit' value='查询' name='Submit' class='a' style="font-size: 14px">&nbsp;<input type='reset' value='重填' name='Reset' class='a' style="font-size: 14px"></p>
</form>
</div>
</td>
            </tr>
            <tr>
              <td width="100%" height="22" bgcolor="#6D8E4D">
                <font color="#FFFFFF">
                &nbsp;订单查询</font>
</td>
            </tr>
            <tr>
              <td width="100%" height="15">
<form method='POST' action='OrderListFind.asp'>
<div align='center'><br>
请填入订单号码<br>
<algin='center'><input type='text' name='Form_Id' size='10'><br>
<br>
<input type='submit' value='查询' name='djB1' class='a' style="font-size: 14px">&nbsp;<input type='reset' value='重填' name='djb2' class='a' style="font-size: 14px">
</div></form>
</td>
            </tr>
            <tr>
              <td width="100%" height="365">
                 
</td>
            </tr>
          </table>
</td>
      <td width="2%" height="62"></td>
      <td width="77%" height="62" valign="top">
        <div align="center">
          <table border="0" cellpadding="0" cellspacing="0" width="100%" class=main1 height="92" >
            <tr>
              <td width="100%" bgcolor="#E6E4C4" height="22" valign="middle">&nbsp;<a href="default.asp">首页</a>                                                    
                </td>                                                                             
            </tr>
            <tr>
              <td width="100%" height="15" valign="middle">&nbsp;</td>                                                  
            </tr>
            <tr>
              <td width="100%" height="70">
                <div align="center">
                  <table border="0" cellpadding="0" cellspacing="0" width="100%" height="148" class=main1>
                    <tr><td valign="top">

<div align="center">
<%
'假如没有商品时
If rs.eof and rs.bof then 
   response.write "<td><p align='center'><font color='#ff0000'>没有找到符合条件的商品资料</font></p></td>"
   response.end
End if %>
  <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#6D8E4D" bordercolordark="#FFFFFF" class=main1 height="55">
    <tr>
      <td width="16%" align="center" bgcolor="#6D8E4D" height="23"><font color="#FFFFFF">商品编号</font></td>
      <td width="34%" align="center" bgcolor="#6D8E4D" height="23"><font color="#FFFFFF">商品名称</font></td>
      <td width="18%" align="center" bgcolor="#6D8E4D" height="23"><font color="#FFFFFF">会员价</font></td>
      <td width="17%" align="center" bgcolor="#6D8E4D" height="23"><font color="#FFFFFF">详细信息</font></td>
      <td width="15%" align="center" bgcolor="#6D8E4D" height="23"><font color="#FFFFFF">购买</font></td>
    </tr>

                    <%row_count=1
                    '显示帖子的子程序
					Sub list()%>
                    <%i=0
                     Do While Not rs.EOF%>
      <tr>                    
      <td width="16%" align="center" height="28"><%=rs("Product_Id")%></td>
      <td width="34%" align="center" height="28" ><%=rs("Product_Name")%></td>
      <td width="18%" align="center" height="28"><%=rs("P_NewPrice")%></td>
      <td width="17%" align="center" height="28"><a href="ProductDetail.asp?ProductNO=<%=rs("Product_No")%>">详细资料</td>
      <td width="15%" align="center" height="28"><a href='javascript:openbag(<%=rs("Product_Id")%>)'><img style="CURSOR: hand" height="22" src="images/che1.gif" width="56" align="absMiddle" border="0"></a></td>
    </tr>
        <%
                        i=i+1
  					    if i >= MaxPerpage then exit do
				    	rs.MoveNext
						Loop
					end Sub
					  %>
<% call list
   If Rs.recordcount > MaxPerPage then
   call showpages
 end if%>
  </table>
</div>
 				</td></tr>
                  </table>

     </div>
              </td>
            </tr>
          </table>
        </div>
        </td>
    </tr>
  </table>
</div>
<%
'显示翻页的子程序
sub showpages()%>
<table bgColor="#f8e8a0" border="0" cellPadding="0" cellSpacing="0" width="400" >  
<tr><td >

<form method="POST" action="ProductClass.asp">
<INPUT  type=hidden value=<%=ProductClass_2%> name=ProductClass_2>
<table bgColor="#6D8E4D" border="0" cellPadding="0" cellSpacing="0" width="583" height="30">  
   <tr>
    <td  bgcolor="#E6E4C4" class=main1 width="510">   
<font color="#000000">   
<p align="center">   
<%
   Response.write "<font color='#000000'>页面-> </font>"   
   If currentpage > 1 Then
      response.write "<a href='ProductClass.asp?&page="+cstr(1)+"&ProductClass_2="+Cstr(ProductClass_2)+"'><font color='#000000'>首页</font></a><font color='#000000'><b>-</b></font>"  
      Response.write "<a href='ProductClass.asp?page="+Cstr(currentpage-1)+"&ProductClass_2="+Cstr(ProductClass_2)+"'><font color='#000000'>前页</font></a><font color='#000000'><b>-</b></font>"
   Else
      Response.write "<font color='#000000'>首页-</font>"
      Response.write "<font color='#000000'>前页-</font>" 
   End if
   
   If currentpage < Rs.PageCount Then
      Response.write "<a href='ProductClass.asp?page="+Cstr(currentPage+1)+"&ProductClass_2="+Cstr(ProductClass_2)+"'><font color='#000000'>后页</font></a><font color='#000000'><b>-</b></font>"
      Response.write "<a href='ProductClass.asp?page="+Cstr(Rs.PageCount)+"&ProductClass_2="+Cstr(ProductClass_2)+"'><font color='#000000'>尾页</font></a>&nbsp;&nbsp;"
   Else
      Response.write "<font color='#000000'>后页-</font>"
      Response.write "<font color='#000000'>尾页</font>&nbsp;&nbsp;"       
   End if
   Response.write "<font color='#000000'>页次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font>&nbsp;"
   Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>种商品/页&nbsp" & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>种商品</font>&nbsp;&nbsp;"

response.write "</td><td align='right'>"
response.write "<font color='#000000' class=main1>到:</font><input type='text' name='page' size=2 maxlength=3 class=smallInput value="&Currentpage&">&nbsp;"
   response.write "<input class=buttonface type='submit'  value='Go'  name='cndok' style='background-color: #E6E4C4'></span>"   
%>    
</font>    
    </td>  
   </tr>
  </table>
  </center>
</td></tr>
</table>
</form>
<%end sub%>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -