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

📄 class.asp

📁 酷购网上商城~~ 完整的asp源代码.通过少许的改动就可以让你拥有自己的商城~~ 此代码仅供个人学习使用
💻 ASP
📖 第 1 页 / 共 2 页
字号:
                                        <img src="image/left/left_zxsc.gif" width="172" height="45"></td>
                                  </tr>
                                  <tr>
                                    <td><!--#include file="rank2.asp" --></td>
                                  </tr>
                                </table></td>
                                <td width="12" background="image/index_22.gif">&nbsp;</td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td valign="top"><img name="index_23" src="image/index_23.gif" width="198" height="23" border="0" alt=""></td>
                        </tr>
                    </table></td>
                    <td width="656" valign="top" bgcolor="#FFFFFF"><table width="654" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
                      <tr>
                        <td width="100%" valign="top" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
                            <%leixing=lcase(trim(request("lx")))
					select case leixing
					case "big"
					anclassid=request("anid")
					set rs=server.createobject("adodb.recordset")
					rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
					anclassname=rs("anclass")
					rs.close
					%>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> <%=anclassname%></td>
                            </tr>
                            <%
					  case "small"
					  	anclassid=request("anid")
					  	nclassid=request("nid")
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
						anclassname=rs("anclass")
						rs.close
					  	rs.open "select * from shop_nclass where nclassid="&nclassid,conn,1,1
						nclassname=rs("nclass")
						rs.close
					  %>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> <a href=class.asp?lx=big&anid=<%=anclassid%>><%=anclassname%></a> >> <%=nclassname%></td>
                            </tr>
                            <%case "tejia"%>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 特价商品</td>
                            </tr>
                            <%case "hot"%>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 热卖商品</td>
                            </tr>
                            <%case "news"%>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 新货上架 </td>
                            </tr>
                            <%case else%>
                            <tr>
                              <td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="9" height="9" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 新货上架</td>
                            </tr>
                            <%end select%>
                          </table>
                            <%set rs=server.createobject("adodb.recordset")
		if leixing="big" then
			rs.open "select * from shop_books where anclassid="&anclassid&" order by adddate desc",conn,1,1
		elseif leixing="small" then
			rs.open "select * from shop_books where anclassid="&anclassid&" and nclassid="&nclassid&" order by adddate desc",conn,1,1
		elseif leixing="hot" then
			rs.open "select * from shop_books order by chengjiaocount desc",conn,1,1
		elseif leixing="tejia" then
			rs.open "select * from shop_books where tejiabook=1 order by adddate desc",conn,1,1
		elseif leixing="news" then
			rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1
		else
			rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1
		end if
		if rs.recordcount=0 then 
		%>
                            <table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
                              <tr>
                                <td align=center>暂无商品</td>
                              </tr>
                            </table>
                            <%
		else
	  		rs.PageSize =10 '每页记录条数
			iCount=rs.RecordCount '记录总数
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	
			For i=1 To x
		%>
                            <table width="652"  border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" class="table-xia">
                              <tr bgcolor="#F7F7F7">
                                <td width="206" height="200" align="center"><TABLE onmouseover="this.style.backgroundColor='#7995b0'" onmouseout="this.style.backgroundColor=''" width=100 height=100 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
                                  <TBODY>
                                    <TR>
                                      <TD width=100 height=100 bgColor=#ffffff align=center><%if rs("bookpic")="" then 
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" target=_blank><img src=images/emptybook.gif width=90 height=90 border=0></a></div>"
else%>
                                          <a href=list.asp?id=<%=rs("bookid")%> target=_blank><img src="<%=trim(rs("bookpic"))%>"  width=150 border=0 height=150></a>
                                          <%end if%>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table></td>
                                <td width="446"><table width="426"  border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td width="426" height="35" background="image/classpic.gif"><table width="96%"  border="0" align="right" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td><a href=list.asp?id=<%=rs("bookid")%> target=_blank><span class="style3"><%=trim(rs("bookname"))%></span></a></td>
                                      </tr>
                                    </table></td>
                                  </tr>
                                </table>
                                <table width="96%"  border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#D7D7D7">
                                  <tr>
                                    <td width="24%" align="right" bgcolor="#F7F7F7">产品简介:</td>
                                    <td width="76%" bgcolor="#FFFFFF">
                                  <%if len(trim(rs("bookcontent")))>40 then
	response.write left(trim(rs("bookcontent")),40)&"..."
	else
	response.write trim(rs("bookcontent"))
	end if%></td>
                                  </tr>
                                  <tr>
                                    <td align="right" bgcolor="#F7F7F7">价格系数:</td>
                                    <td bgcolor="#FFFFFF">市场价:<s><%=trim(rs("shichangjia"))%> 元</s> | <strong>会员价:<font color=#FF3300><%=trim(rs("huiyuanjia"))%> 元</font></strong></td>
                                  </tr>
                                  <tr>
                                    <td align="right" bgcolor="#F7F7F7">其它相关:</td>
                                    <td bgcolor="#FFFFFF">商品数量:<%=trim(rs("kucun"))%> <%=rs("bookchuban")%> 本产品被浏览<%=trim(rs("liulancount"))%>次 <%if rs("kucun")>0 then%>
  <span class="style1">热卖中</span>
  <%else%>
  <span class="style2">缺货</span>
  <%end if%></td>
                                  </tr>
                                  <tr align="center">
                                    <td colspan="2" bgcolor="#F7F7F7"><a href="javascript:;" onClick="javascript:window.open('gouwu.asp?id=<%=rs("bookid")%>&action=add','','width=780,height=440,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src="images/goumai.gif" width="65" height="20" border=0></a> <a href="shoucang.asp?id=<%=rs("bookid")%>&action=add"><img src="images/shoucang1.gif" width="65" height="20" border=0></a></td>
                                    </tr>
                                </table></td>
                              </tr>
                            </table>
                            <%rs.movenext
		next
		call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
		rs.close
		set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1>" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR bgcolor=#f1f1f1>" & vbCrLf )
    Response.Write("<TD align=center height=35>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首 页 " & vbCrLf)        
        Response.Write ("上一页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首 页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下一页 " & vbCrLf)
        Response.Write ("尾 页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾 页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次:" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "种商品" &  vbCrLf)
    Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%>
                        </td>
                      </tr>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="854">
                  <tr>
                    <td><img name="index_24" src="image/index_24.gif" width="663" height="38" border="0" alt=""></td>
                    <td><img src="image/index_25.gif" alt="" name="index_25" width="191" height="38" border="0" usemap="#index_25Map"></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td width="854" height="62" align="center" background="image/index_26.gif"><!--#include file="copyright.asp"--></td>
            </tr>
            <tr>
              <td><img name="index_27" src="image/index_27.gif" width="854" height="14" border="0" alt=""></td>
            </tr>
        </table></td>
        <td valign="top" bgcolor="#FFFFFF"><table align="left" border="0" cellpadding="0" cellspacing="0" width="122">
            <tr>
              <td width="122" height="301"><!--#include file="right.asp" -->
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<map name="index_25Map">
  <area shape="rect" coords="137,10,176,27" href="#top">
</map>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function checkk()
{
   if(checkspace(document.form2.searchkey.value)&&((document.form2.action.value=="3")||(document.form2.action.value=="1")))  {
	document.form2.searchkey.focus();
	alert("请输入查讯关键字!");
	return false;
  }
   document.form2.submit();
}

//-->
</script>

⌨️ 快捷键说明

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