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

📄 cat.asp

📁 上海购物网设计的购物系统是基于WEB开发的大型购物系统。   它以构建电子商务网站为目标
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
dim sortsid,i,strcat
sortsid=request.querystring("catid")%>
<title><%=webname%>--商品分类</title>
<!--#include file="include/header.asp"-->
<%
		  set rs=server.CreateObject("adodb.recordset")
		   rs.open "select category from category where categoryid="&sortsid&" ",conn,1,1 
		  strcat = trim(rs("category"))
		  rs.close 
		  set rs = nothing
		  %>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1" bgcolor="#CCCCCC"><img src="images/linebg.gif" width="1" height="6"></td>
    <td width="200" valign="top"> 
      <table width="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td width="200" valign="top"> 
            <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
              <tr> 
                <td valign="top"><a href="profile.asp?action=addtocart"> </a> 
                  <TABLE width="200" BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="#FFFFFF">
                    <tr 
					  > 
                      <td height="26" background="images/skin/default/hot_.gif"> 
                        <div align="center"><strong>商 品 搜 索</strong></div></td>
                    </tr>
                    <tr 
					  > 
                      <form name="searchform" method="post" action="research.asp" >
                                    <td width="250" height="70"> &nbsp;&nbsp;&nbsp;&nbsp; 
                                      <select name="action" id="select2">
                                        <option value="1">按商品名称查询</option>
                                        <option value="2">按商品品牌查询</option>
                                        <option value="3">按商品类别查询</option>
                                      </select> <br> &nbsp;&nbsp;&nbsp;&nbsp; 
                                      <input name="searchkey" type="text" size="10" value="关键字" onFocus="this.value=''"> 
                                      <input type="submit" name="Submit2" value="查询" onClick="return check();" > 
                                      <br> <a href="search.asp">&nbsp;&nbsp;&nbsp;&nbsp; 
                                      详细查询</a> </td>
                                  </form>
                    </tr>
                  </TABLE>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>商 
                          品 小 类</strong></div></td>
                    </tr>
                  </table>
                  <!--#include file="include/cat.asp" -->
                  <br>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>商 
                          品 分 类</strong></div></td>
                    </tr>
                  </table> 
                  <div align="center"><br>
                    <!--#include file="include/pronav.asp" -->
                    <br>
                    <!--#include file="include/catdis.asp"-->
                    <!--#include file="include/catsold.asp"-->
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>推 
                            荐 购 买</strong></div></td>
                      </tr>
                    </table>
                    <br>
                    <A HREF=<%=zuo3url%> TARGET="_blank"><IMG SRC=<%=zuo1%> BORDER="0" WIDTH="190"></A><A HREF=<%=zuo2url%> TARGET="_blank"><br>
                    <IMG SRC=<%=zuo2%> BORDER="0" WIDTH="190"></A><A HREF=<%=zuo3url%> TARGET="_blank"><br>
                    <IMG SRC=<%=zuo3%> BORDER="0" WIDTH="190"></A><br>
                  </div></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
    <td width="1" bgcolor="#CCCCCC"><img src="images/skin/default/linebg.gif" width="1" height="6"></td>
    <td valign="top"> 
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr> 
          <td width="7%" height="51" align="center" valign="middle"><img src="images/skin/default/index7.gif" width="14" height="10"></td>
          <td width="93%" valign="middle"><FONT COLOR="#000000"><%=webname%>&gt;&gt;><%=strcat %></FONT></td>
        </tr>
        <tr> 
          <td colspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr bgcolor="#b8b8b9"> 
                <td></td>
              </tr>
              <tr> 
                <td> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td colspan="2" valign="top"> 
            <%
				Const MaxPerPage=10
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if 
				
		 if sortsid="" then
		  set rs=server.CreateObject("adodb.recordset")
		  rs.open "select top 20 prename,company,mark,pretype,intro,other,type,viewnum,grade,predate,id,name,introduce,price1,price2,discount,productdate,pic from product where isfb=0 order by adddate desc",conn,1,1
		  else
		  set rs=server.CreateObject("adodb.recordset")
		   rs.open "select predate,prename,company,mark,pretype,intro,name,other,type,viewnum,grade,id,introduce,price1,price2,discount,productdate,pic from product where isfb=0 and categoryid="&sortsid&" order by adddate desc",conn,1,1 
		  end if
		  
				if err.number<>0 then
				response.write "数据库中暂时无数据"
				end if
				
  				if rs.eof And rs.bof then
       				Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</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,"cat.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"cat.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"cat.asp"
	      				end if
	   				end if
   				   				end if

   				sub showContent
       			dim i
	   			i=0

			%>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td> 
                  <%
			do while not rs.eof%>
                  <table width="96%" border="0" align="center" cellpadding="3" cellspacing="0">
                    <tr> 
                      <td width="28%" valign="middle" align="center"> <TABLE WIDTH="100" HEIGHT="100" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#cccccc">
                          <TR> 
                            <TD WIDTH="100" height="100" align="center" valign="middle" BGCOLOR="#FFFFFF"> 
                              <a href=product.asp?id=<% = rs("id") %> target="_blank"> 
                              <% if trim(rs("pic"))<>"" then %>
                              <img src=<% = trim(rs("pic"))%> width="<% = webimg9 %>"  height="<% = webimg10 %>" border=0 ></a> 
                              <%  else %>
                              <img src=images/emptybook.jpg  border=0> 
                              <% end if %>
                            </TD>
                          </TR>
                        </TABLE></td>
                      <td width="71%"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
                          <tr> 
                            <td colspan="3"> 
                              <% = trim(rs("prename")) %>
                              <a href=product.asp?id=<%=rs("id")%>><font color="#FF0000"><%=trim(rs("name"))%></font></a></td>
                          </tr>
                          <tr> 
                            <td> <%=trim(rs("company"))%><%=trim(rs("mark"))%></td>
                            <td colspan="2"><%=trim(rs("pretype"))%><%=trim(rs("type"))%></td>
                          </tr>
                          <tr> 
                            <td width="38%">市场价:<S>¥<%=rs("price1")%>元</S></td>
                            <td width="29%">会 员 价:<FONT COLOR="#FF0000">¥</FONT><font color=red><%=rs("price2")%>元</font></td>
                            <td width="33%">折扣:<%=rs("discount")*10%>折</td>
                          </tr>
                          <tr> 
                            <td> <a href=# onClick="javascript:window.open('cart.asp?id=<% = rs("id") %>','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/cart.gif width=50 height=19 align=absmiddle border=0></a> 
                            </td>
                            <td colspan="2"><a href=# onClick="javascript:window.open('addto.asp?id=<% = rs("id") %>&action=add','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/addto.gif width=50 height=19 align=absmiddle border=0></a></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr> 
                      <td colspan="2"><table height=1 cellspacing=0 cellpadding=0 width=500 
                        align=center bgcolor=#f2f2f2 border=0 valign="top">
                          <tbody>
                            <tr> 
                              <td></td>
                            </tr>
                          </tbody>
                        </table></td>
                    </tr>
                  </table>
                  <%
			i=i+1
			if i>=MaxPerPage then Exit Do
			rs.movenext
			loop
			rs.close
			set rs=nothing
			%>
                </td>
              </tr>
            </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 %>?catid=<% = sortsid %>>
              <%
				If CurrentPage<2 Then  %><div align="center">
              首页 上一页 
              <% Else  %><div align="center">
              <a href=<% = filename %>?page=1&catid=<% = sortsid %>>首页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&catid=<% = sortsid %>>上一页</a> 
              <%
				End If
				If n-currentpage<1 Then  %>
              下一页 尾页 
              <%	Else  %>
              <a href=<% = filename %>?page=<% = (CurrentPage+1) %>&catid=<% = sortsid %>>下一页</a> 
              <a href=<% = filename %>?page=<% = n %>&catid=<% = sortsid %>>尾页</a> 
              <%	End If  %>
              第 <b> 
              <% = CurrentPage %>
              </b>页 共 <b> 
              <% = n %>
              </b>页 共 <b> 
              <% = totalnumber %>
              </b>件商品 每页 <b> 
              <% = maxperpage %>
              </b> 件商品 转到第: 
              <input type='text' name='page' size=2 maxlength=20 value=<% = currentpage %>>
              <input type='submit'  class='contents' value='跳转' name='cndok'>
            </form>
            <%
				End Function  
			%>
          </td>
        </tr>
      </table></td>
    <td width="1" bgcolor="#CCCCCC"><img src="images/linebg.gif" width="1" height="6"></td>
  </tr>
</table>
<!--#include file="include/footer.asp"--> 

⌨️ 快捷键说明

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