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

📄 cat.asp

📁 实用的拍卖源码。适合个人建站学习使用。仅供学习参考
💻 ASP
字号:
<!-- #include file="inc/char.asp" -->
<!-- #include file="conn.asp" -->
<!-- #include file="inc/adovbs.inc" -->
<!-- #include file="head.asp" -->
<html>
<head>
<TITLE><%=webname%>--商品列表---联系QQ:6439358,联系邮箱vqqq59r@163.com,网站www.vqqq.com,谢谢大家对我们系统的支持</title>
<META http-equiv=Content-Type content="text/html; charset="<%=charset%>">
<META name="keywords" content="<%=keywords%>">
<META name="description" content="<%=description%>">
<link href="images/main_style.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY leftMargin=0 onmouseover=exitpop=false text=#000000 topMargin=0 marginheight="0" marginwidth="0">
<%
if rst("page")<>"" then
  if not isnumeric(rst("page")) then
      response.write "<br>"+"<li>非法的分页参数。"
	  response.end
  end if
end if
dim strsql,aucid
dim bookmark,totalcs,Currentpage,totalpages,i

%>
<table width="760" border="0" align=center cellpadding=0 cellspacing=1 class=tablebg>
  <tr> 

    <td class=titletd width=100% colspan="2"><a href="index.asp">首页</a>&gt;&gt;&gt; <a href="search.asp">商品搜索</a>&gt;&gt;&gt; 
	<%
flag=rst("action")
if flag<>"new" and flag<>"hot" and flag<>"closing" then flag="all"
if flag="new" then
response.write "新登商品"
elseif flag="hot" then
response.write "热点商品"
elseif flag="closeing" then
response.write "即将结束"
else
response.write "所有商品"
end if
	%>
     </td>
  </tr>
    <tr class=td>
      <td><a href=sellauc.asp>我有类似商品出售</a></td>
      <td>
        <div align="right"><a href=cat.asp?action=all>所有商品</a>|<a href=cat.asp?action=closing>即将结束</a>|<a href=cat.asp?action=new>新登商品</a>|<a href=cat.asp?action=hot>热点商品</a></div>
      </td>
    </tr>
</table>

<table width="760" border="0" cellspacing="1" cellpadding="0" align="center" class=tablebg>
<%
set rs=server.createobject("adodb.recordset")
if flag="closing" then
strsql = " select * FROM Auctions WHERE aucCloseDate > #"&now&"#  and aucEnded='N' order by aucmoli desc,aucCloseDate"
end if
if flag="new" then
strsql = " select * FROM Auctions WHERE aucCloseDate > #"&now&"#  and aucEnded='N' order by aucmoli desc,aucAvailDate desc"
end if
if flag="hot" then
strsql = " select * FROM Auctions WHERE aucCloseDate > #"&now&"#  and aucEnded='N' order by aucmoli desc,aucclick desc"
end if
if flag="all" or rst("action")="" then
strsql = " select * FROM Auctions WHERE aucCloseDate > #"&now&"#  and aucEnded='N' order by aucmoli desc,aucCloseDate"
end if

rs.open strsql,conn,1,1
totalcs=rs.recordcount
%>

  <tr class=titletd> 
    <td width="106"> 
      <div align="center">商品图片</div>
    </td>
    <td width="380"> 
      <div align="center">商品名称</div>
    </td>
    <td width="40"> 
      <div align="center">现价</div>
    </td>
    <td width="40"> 
      <div align="center">竞标数</div>
    </td>
    <td width="167"> 
      <div align="center">剩余时间</div>
    </td>
  </tr>
<%
if not rs.eof then
rs.movefirst
jsperpage=rs.pagesize
if trim(rst("page"))<>"" then
   currentpage=clng(rst("page"))
   if currentpage>rs.pagecount then
      currentpage=rs.pagecount
   end if
else
   currentpage=1
end if
   if currentpage<>1 then
       if (currentpage-1)*jsperpage<totalcs then
	       rs.move(currentpage-1)*jsperpage
		   
		   bookmark=rs.bookmark
	   end if
   end if
   if (totalcs mod jsperpage)=0 then
      totalpages=totalcs\jsperpage
   else
      totalpages=totalcs\jsperpage+1
   end if
i=0
do while not rs.eof and i<jsperpage
%>

  <tr id=b2 class=td> 
    <td width="106" id=bg02>
	<div id="Layer1" style="position:relative; left:0px; top:0px; z-index:2; width: 0; height: 0;"> 
<% if rs("aucmoli")>=aucml*5 then %> <img src="images/5star.gif"> 
<% elseif rs("aucmoli")>=aucml*4 then %> <img src="images/4star.gif">
<% elseif rs("aucmoli")>=aucml*3 then %> <img src="images/3star.gif">
<% elseif rs("aucmoli")>=aucml*2 then %> <img src="images/2star.gif">
<% elseif rs("aucmoli")>=aucml*1 then %> <img src="images/1star.gif">
<% elseif rs("aucclick")>10 then %> <img src="images/hotauc.gif">
<% else %> <img src="images/0star.gif">
<% end if%>
	</div>
	<div align="center">
	  <%
	  if rs("aucImageURL")="NULL" then
	  response.write "没有图片"
	  else%><a href="aucinfo.asp?aucid=<%=rs("aucID")%>" target=_blank>
	 <img src="<%=rs("aucImageURL")%>" width="72" height="72"  border=0></a>
	  <%end if%></div>
    </td>
    <td width="380" id=bg02> 
      <div align="left">&nbsp;<a href="aucinfo.asp?aucid=<%=rs("aucID")%>" target=_blank>
<%
auctitle=rs("aucItemTitle")
if len(auctitle)>30 then
auctitle=left(auctitle,28)&"..."
response.write auctitle&"("&rs("aucclick")&")"
else
response.write auctitle&"("&rs("aucclick")&")"
end if
%>
</a></div>
    </td>
    <td width="40" id=bg02> 
      <div align="center"><%=rs("aucCurrentBid")%></div>
    </td>
    <td width="40" id=bg02> 
      <div align="center"><%
	  sql3="select count(*) as Bnum from bids where bidItemID="&rs("aucid")
	  set rs3=conn.execute(sql3)
	response.write rs3("Bnum")%></div>
    </td>
    <td width="167" id=bg02> 
      <div align="center"> 
		<%
		date2 = rs("aucCloseDate")
		date1 = now()
		sDate = DateDiff("s", date1, date2) '总秒数
		sDay = fix(sDate/60/60/24) '天数
		sDate1 = sDate mod 60*60*24 '余数
		sHour = fix(sDate1/60/60) '小时
		sDate2 = sDate1 mod 60*60 '余数
		sMinute = fix(sDate2/60) '分钟
		sDate3 = sDate2 mod 60 '余数
		if sDay>0 then
		response.write sDay & "天"
		end if
		if sDay=0 and shour>=0 then 
		'and sHour=0 and sMinute=0 and sDate3=0
		'response.write sDay & "天" & sHour & "小时" & sMinute & "分钟" & sDate3 & "秒"
		response.write sHour & "小时"
		end if
		if sDay=0 and shour=0 and sMinute>=0 then
		response.write sMinute & "分钟" 
		end if
		if sDay=0 and shour=0 and sMinute=0 and sDate3>=0 then
		response.write sDate3 & "秒"
		end if
		if sDate3<0 then
		sqlend="update auctions set aucEnded='Y' where aucid="&rs("aucid")
		conn.execute(sqlend)
		end if
		%>
     </div>
    </td>
  </tr>
<%
  i=i+1
  rs.movenext
loop
else
if rs.eof and rs.bof then%>
<tr><td nowrap height="30" colSpan=5 class=td>当前没有商品!</td></tr>
<%
end if
end if
sub FPage()%>
<form name="form1" method="post" action="cat.asp?catid=<%=request.querystring("catid")%>">
<tr> 
<td align="right" colspan="5" class=titletd>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR> 
<TD align=middle width="35%" height=25><IMG height=14 src="img/cha.gif" width=14 align=absMiddle> 共[<font class=fred><%=totalcs%></font>]个商品 共分[<font class=fred><%=totalpages%></font>]页 &nbsp;当前为第[<font class=fred><%=CurrentPage%></font>]页</TD>
<TD width="40%" align=middle class=fblack><IMG height=11 src="img/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "<font class=fblack>首页 上一页</font> "
else
response.write "<a href=cat.asp?action="&rst("action")&"&page=1&catid="&request.querystring("catid")&">首页</a> "
response.write "<a href=cat.asp?action="&rst("action")&"&page="&CurrentPage-1&"&jscat_id="&request.querystring("catid")&">上一页</a> "
end if
if totalpages-currentpage<1 then
response.write "<font class=fblack>下一页 尾页</font>"
else
response.write "<a href=cat.asp?action="&rst("action")&"&page="&CurrentPage+1&"&catid="&request.querystring("catid")
response.write ">下一页</a> <a href=cat.asp?action="&rst("action")&"&page="&totalpages&"&catid="&request.querystring("catid")&">尾页</a>"
end if
%>
 <IMG height=11 src="img/gt.gif" width=11 align=absMiddle></TD>
<TD align=middle width="25%">
<select name="page">
<%
i=1
for i=1 to totalpages
if i=currentpage then
%>
<option value=<%=i%> selected>第<%=i%>页</option> 
<%else%>
<option value=<%=i%>>第<%=i%>页</option> 
<%end if
next%>
</select><input type="submit" name="Submit2" value="转向" class="button"> </TD>
</TR>

</TABLE>     
</td>
</tr>
</form>   
<%
end sub 
call FPage()%>
</table>
<!-- #include file="bottom.asp" -->
</BODY></HTML>

⌨️ 快捷键说明

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