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

📄 productclass.asp

📁 一套很早的多用户电子商务程序
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp" -->
<%
ProductClass_2=request("ProductClass_2")
ProductClass_2=FomaID(ProductClass_2)

ProductClass_1=request("ProductClass_1")
ProductClass_1=FomaID(ProductClass_1)
%>

<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>BODY {
	FONT-SIZE: 9pt
}
TD {
	FONT-SIZE: 9pt
}
A {
	TEXT-DECORATION: none
}
A:hover {
	TEXT-DECORATION: underline
}
</STYLE>
<SCRIPT language=JavaScript>
<!--
function openbag(url,name){
		window.open(url,name,"height=200,width=600,left=190,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no")}
-->
</SCRIPT>
<title>产品分类</title>
</head>

<body leftmargin="0" topmargin="2">
<!--#include file="top.asp" -->
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" width="778" height="80" background="IMAGES/bg3.gif">
    <tr>
      <td width="172" valign="top"> 
        <table border="0" cellpadding="0" cellspacing="0" width="170" align="center">
          <tr> 
            <td height="17" valign="bottom" bgcolor="#ffcc39"> <p align="center"><b>商 品 搜 索</b> 
            </td>
          </tr>
          <tr> 
            <td> 
              <div align="center"> 
                <table width="100%" border="0" cellspacing="5" cellpadding="4">
                  <form action=ProductSearch.asp method=post>
                    <tr> 
                      <td> <div align="center">商品名称: 
                          <input type='text' name='Product_Name' size='10' class='a'>
                          <br>
                        </div></td>
                    </tr>
                    <tr> 
                      <td><div align="center">商品类别: 
                          <select name="Product_Class" size="1" tabindex="0" class="a"  font-size: 9pt>
                            <option  value="所有类别" selected>所有类别</option>
                            <%
set rs_lx=server.CreateObject("adodb.recordset")
sql="select * from Class_1"
rs_lx.open sql,conn,1
if not rs_lx.eof and not rs_lx.bof then
for i=1 to rs_lx.recordcount
%>
                            <option  value=<%=rs_lx("Class_1_Name")%>><%=rs_lx("Class_1_Name")%></option>
                            <%
rs_lx.movenext
next
rs_lx.close
end if
%>
                          </select>
                        </div></td>
                    </tr>
                    <tr> 
                      <td><div align="center"> 
                          <input name="Submit14" src style="BACKGROUND-COLOR: #feac37; BORDER-BOTTOM: #000875 1px solid; BORDER-LEFT: #9aa3ff 1px solid; BORDER-RIGHT: #000875 1px solid; BORDER-TOP: #9aa3ff 1px solid; COLOR: #efefef; HEIGHT: 20px" type="submit" value="搜 索">
                          &nbsp; 
                          <input name="Submit122"  src style="BACKGROUND-COLOR: #feac37; BORDER-BOTTOM: #000875 1px solid; BORDER-LEFT: #9aa3ff 1px solid; BORDER-RIGHT: #000875 1px solid; BORDER-TOP: #9aa3ff 1px solid; COLOR: #efefef; HEIGHT: 20px" type="reset" value="重 置">
                        </div></td>
                    </tr>
                  </form>
                </table>
              </div></td>
          </tr>
        </table>
        <div align="center"> 
          <center>
            <table border="0" cellpadding="0" cellspacing="0" width="145" height="3">
              <tr> 
                <td height="3"> </td>
              </tr>
            </table>
          </center>
        </div>
        <div align="center"> 
          <center>
            <table width="170" height="147" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td bgcolor="#ffcc39" height="17" valign="bottom"> <p align="center"><b><font color="#FFFFFF">商 品 分 类</font></b> 
                </td>
              </tr>
              <tr> 
                <td height="3"> </td>
              </tr>
              <tr> 
                <td height="250" valign="top" > 
                  <%
set rs_class_1=server.createobject("adodb.recordset")
sqltext2="select * from Class_1 "
rs_class_1.open sqltext2,conn,1,1
While Not rs_class_1.EOF
%>
                  <table width="100%" border="0" cellspacing="3" cellpadding="0">
                    <tr> 
                      <td> 
                        <%
set rs_p2=server.createobject("adodb.recordset")               
sqltext3="select * from Class_2 where Class_1_Name='" & rs_class_1("Class_1_Name") & "'"               
rs_p2.open sqltext3,conn,1,1				                
%>
                        <%=rs_class_1("Class_1_Name")%><br> 
                        <%While Not rs_p2.EOF%>
                        <a href="ProductClass.asp?ProductClass_1=<%=rs_class_1("Class_1_Name")%>&ProductClass_2=<%=rs_p2("Class_2_Name")%>"><%=rs_p2("Class_2_Name")%></a> 
                        <%               
rs_p2.MoveNext               
j=j+1               
Wend               
rs_p2.close               
%>
                        <table width="153" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="3"></td>
                          </tr>
                          <tr> 
                            <td height="1" bgcolor="#EAAF00"></td>
                          </tr>
                          <tr> 
                            <td height="3"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  <%               
rs_class_1.MoveNext               
Wend               
rs_class_1.close          
%>
                </td>
              </tr>
            </table>
          </center>
        </div></td>
      <td height="62"></td>
      <td width="599" height="62" valign="top"> 
        <div align="center"> 
          <table border="0" cellpadding="0" cellspacing="0" width="100%" class=main1 height="53" >
            <tr> 
              <td width="100%" bgcolor="#FFFFDD" height="22" valign="middle">&nbsp;<a href="default.asp">首页</a> 
                &gt;&gt; <%=request("ProductClass_1")%> - <%=ProductClass_2%>&nbsp;   
              </td>
            </tr>
            <tr> 
              <td width="100%" height="15" valign="middle"> </td>
            </tr>
            <tr> 
              <td width="100%" height="31"> <div align="center"> 
                  <table border="0" cellpadding="0" cellspacing="0" width="100%" height="148" class=main1>
                    <tr> 
 <%   
set rs=server.createobject("adodb.recordset")
sqltext="select  * from Product  Where Class_2='"& ProductClass_2 &"' order by id desc"
rs.open sqltext,conn,1,1

dim MaxPerPage
MaxPerPage=24
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 
                                                    
'/////////////////////////////////////////////////////////假如没有商品时//////////////////                                                      
If rs.eof and rs.bof then                                                       
   response.write "<td><p align='center'><font color='#ff0000'>此类别暂时还没有商品资料!</font></p></td>"                                                      
else
row_count=1
i=0                                                      
 Do While Not rs.EOF%>
                      <td width="160" align="center"  valign="top"> <a href="<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>" target="_blank"><img src="<%=rs("small_pic")%>" name="small" width="75"  height="78" border="0"  ></a>
					  <br>
                        <a href="<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>"><%=rs("Product_Name")%></a><br>
                        <font color="#cc0000">销售商:</font><%=rs("p_shop")%><font color="#cc0000"><br>
	会员价:</font><%=rs("P_NewPrice")%>元<br> <a href="javascript:openbag('check.asp?cpbm=<%=rs("Product_Id")%>&amp;shopname=<%=rs("p_shop")%>')"><img style="CURSOR: hand" height="22" src="images/che1.gif" width="56" align="absMiddle" border="0"></a> 
	<br> <br> </td>
  <%if row_count mod 4 =0 then%>
</tr>
<tr> 
  <%end if%>
  <%                                                     
	i=i+1                                                     
	if i >= MaxPerpage then exit do                                                     
	rs.MoveNext                                                     
	row_count=row_count+1                                                     
	Loop  
	  
   If Rs.recordcount > MaxPerPage then               
   call showpages                                                     
   end if
end if
 %>
                    </tr>
                  </table>
                </div></td>
            </tr>
          </table>
        </div></td>
    </tr>
  </table>                                                     
  <table width="778" border="0" cellpadding="0" cellspacing="0" bgcolor="#B8A194">
    <tr>
      <td height="1"> </td>
    </tr>
  </table>
</div>                                                     
<%                                                     
'显示翻页的子程序                                                     
sub showpages()%>                   
<table  border="0" cellPadding="0" cellSpacing="0" width="96%" >            
<form method="POST" action="ProductClass.asp"> 
<tr>            
<td width="100%" height="28"> </td>            
</tr>                                                      
<tr>                             
<td >                                                     
<INPUT  type=hidden value=<%=ProductClass_1%> name=ProductClass_1>                                                     
<table border="0" cellPadding="0" cellSpacing="0" width="100%" height="30">                                
                                                     
   <tr>                               
                                                   
            <td> <div align="center"><font color="#000000"> 
                <%                                                     
   If currentpage > 1 Then                                                     
      response.write "<a href='ProductClass.asp?&page="+cstr(1)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><font color='#000000'>首页</font></a><font color='#000000'><b>-</b></font>"                                                       
      Response.write "<a href='ProductClass.asp?page="+Cstr(currentpage-1)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><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_1="+Cstr(ProductClass_1)+"'><font color='#000000'>后页</font></a><font color='#000000'><b>-</b></font>"                                                     
      Response.write "<a href='ProductClass.asp?page="+Cstr(Rs.PageCount)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><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 "<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>&nbsp;&nbsp;"                                                        
%>
                </font> </div></td>                                                       
   </tr>                                                     
  </table>                                                     
                                                   
</td></tr>
</form>                                                      
</table>                                                                                                          
<%end sub%>
<!--#include file="bottom.asp" -->                                    
</body>                                                     
                                                     

⌨️ 快捷键说明

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