<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html><head>
<title><%=webname%>--<%if IsNumeric(request.QueryString("anid"))=False then
								response.write"<script>alert(""输入错误，如有疑问请联系管理员！"");location.href=""index.asp"";</script>"
								response.end
								end if
								if IsNumeric(request.QueryString("nid"))=False then
								response.write"<script>alert(""输入错误，如有疑问请联系管理员！"");location.href=""index.asp"";</script>"
								response.end
								end if
					leixing=lcase(trim(request("lx")))
					  select case leixing
					  case "big"
					  	response.write "大类商品"
					  case "small"
					  	response.write "小类商品"
					  case "tejia"
					  	response.write "特价商品"
					  case "news"
					  	response.write "新品上架"
					  case else
					  	response.write "新品上架"					  
					  end select%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='〖<%=webname%>〗<%=weburl%>如果您喜欢本站,别忘了把本站介绍给您的好友哦！';return false">
<!--#include file="webtop.asp"--> <table width="760" 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 border="0" src="img/14.gif"> 
            <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 border="0" src="img/14.gif"> 
            <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 border="0" src="img/14.gif"> 
            <a href=index.asp><%=webname%></a> >> 特价促销</td></tr> <%case "hot"%> <tr>
          <td colspan="3" background="images/class_bg.jpg" height=50>　<img border="0" src="img/14.gif"> 
            <a href=index.asp><%=webname%></a> >> 热卖排行</td></tr> <%case "news"%> <tr>
          <td colspan="3" background="images/class_bg.jpg" height=50>　<img border="0" src="img/14.gif"> 
            <a href=index.asp><%=webname%></a> >> 最新上架</td></tr> <%case else%> <tr>
          <td colspan="3" background="images/class_bg.jpg" height=50>　<img border="0" src="img/14.gif"> 
            <a href=index.asp><%=webname%></a> >> 最新上架</td></tr> <%end select%> </table><table width=100% align=center class=table-shang border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1> 
<TR> <TD bgColor=#ffffff colSpan=3 height=1></TD><TR> <tr> 
          <td width=20% height=20 align=center background="img/yellowback.gif">产品预览</td>
          <td width=60% height=20 align=center background="img/green.gif">产品名称</td>
          <td width=20% height=20 align=center background="img/yellowback.gif">产品价格</td>
        </tr> 
<TR> <TD bgColor=#cccccc colSpan=3 height=1></TD></TR> <TR> <TD bgColor=#f1f1f1 colSpan=3 height=3></TD></TR> 
</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="100%" class="table-xia" border="0" cellspacing="0" cellpadding="10" align="center"> 
<tr> <td width="20%" rowspan="4" class="table-you" align="center"> <TABLE onmouseover="this.style.backgroundColor='#FF4FAE'" 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=100 border=0 height=100></a> 
<%end if%> </td></tr> </tbody> </table></td><td width="60%"><img src="images/ring01.gif"> 
<a href=list.asp?id=<%=rs("bookid")%> target=_blank><font color="#ff6600"><u><%=trim(rs("bookname"))%></u></font></a></td><td width="20%" rowspan="4" class="table-zuo"> 
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align=center> 
市场价：<s><%=trim(rs("shichangjia"))%> 元</s><br> 会员价：<font color=#FF3300><%=trim(rs("huiyuanjia"))%> 
元</font><br> </td></tr> <tr> <td align=center> <a href="gouwu.asp?id=<%=rs("bookid")%>&action=add"><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> <tr> <td valign="top"><font color="#666666"> <%if len(trim(rs("bookcontent")))>150 then
	response.write left(trim(rs("bookcontent")),120)&"..."
	else
	response.write trim(rs("bookcontent"))
	end if%></font></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><!--#include file="service.asp"--> <!--#include file="copyright.asp"--> 
</body>
</html>