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

📄 class.asp

📁 电子商务网络购物系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%dim sortsid,i
sortsid=request.querystring("nid")%>
<title><%=webname%>--商品分类</title>
<!--#include file="include/header.asp"--> 

<TABLE WIDTH="760" BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center">
  <TR>
    <TD width="23%" valign="top"> 
	<div  id=floater style="Z-INDEX: 20; WIDTH: 175px; POSITION: absolute; TOP: 120px; overflow: visible;; left: 0px"><br>
        <!--#include file="status.asp"-->
      </div>
      <script language=javascript src="fly.js"></script> 

      <table>
	  <tr><td><!--#include file="include/cast.asp"--></td></tr>
        <tr>
          <td align="center"><A HREF=<%=zuo1url%> TARGET="_blank"><IMG SRC=<%=zuo1%> BORDER="0" WIDTH="165"></A></td>
        </tr>
		<tr><td><!--#include file="include/hot.asp"--></td></tr>
        <tr>
          <td align="center"><A HREF=<%=zuo2url%> TARGET="_blank"><IMG SRC=<%=zuo2%> BORDER="0" WIDTH="165"></A></td>
        </tr>
		<tr><td><!--#include file="include/sold.asp"--></td></tr>
        <tr>
          <td align="center"><A HREF=<%=zuo3url%> TARGET="_blank"><IMG SRC=<%=zuo3%> BORDER="0" WIDTH="165"></A></td>
        </tr>
        <tr>
          <td align="center"><A HREF=<%=zuo4url%> TARGET="_blank"><IMG SRC=<%=zuo4%> BORDER="0" WIDTH="170"></A></td>
        </tr>
      </table>
    <td BGCOLOR=<%=bgclr4%> valign="top"> 
      <table width="98%" border="0" cellspacing="0" cellpadding="0" bordercolor="#6699CC" align="center">
        <tr> 
          <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td rowspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
                    <tr> 
                      <td class="12v" > <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                          <tr> 
                            <td 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 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 sortsid="&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,"class.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"class.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"class.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 height="5" colspan="2" valign="top"></td>
                                      </tr>
                                      <tr> 
                                        <td width="20%" valign="middle"> <div align="center"> 
                                            <%
                        response.Write "<a href=product.asp?id="&rs("id")&">"
                        if trim(rs("pic"))<>"" then
                        response.Write "<img src="&trim(rs("pic"))&"  border=0 ></a>"
                        else
                        response.Write "<img src=images/emptybook.jpg  border=0></a>"
                        end if%>
                                          </div></td>
                                        <td width="80%"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
                                            <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 colspan="3"><%=trim(rs("intro"))%><%=trim(rs("introduce"))%></td>
                                            </tr>
                                            <tr> 
                                              <td> <%=trim(rs("predate"))%><%=trim(rs("productdate"))%></td>
                                              <td>浏览次数:<%=trim(rs("viewnum"))%></td>
                                              <td><%=trim(rs("other"))%><%=trim(rs("grade"))%></td>
                                            </tr>
                                            <tr> 
                                              <td width="41%">市场价:<S>¥<%=rs("price1")%>元</S></td>
                                              <td width="34%">会员价:<FONT COLOR="#D03420">¥</FONT><font color=red><%=rs("price2")%>元</font></td>
                                              <td width="25%">折&nbsp;&nbsp;扣:<%=rs("discount")*10%>折</td>
                                            </tr>
                                            <tr> 
                                              <td height="24" colspan="3" align="center">
											  <%response.write "<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> "
													response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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"><hr></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
				
				Response.Write "<form method=Post action="&filename&"?nid="&sortsid&">"  
				Response.Write "<p align='center' class='contents'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='contents'>首页 上一页</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1&nid="&sortsid&" class='contents'>首页</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&nid="&sortsid&" class='contents'>上一页</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='contents'>下一页 尾页</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&nid="&sortsid&" class='contents'>"  
					Response.Write "下一页</a> <a href="&filename&"?page="&n&"&nid="&sortsid&" class='contents'>尾页</a>"  
				End If  
					Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
					Response.Write "<font class='contents'> 共有"&totalnumber&"种商品 " 
					Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"  
					Response.Write "&nbsp;<input type='submit'  class='contents' value='GO' name='cndok'></form>"  
				End Function  
			%> </td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="include/footer.asp"--> 
</body>
</html>


⌨️ 快捷键说明

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