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

📄 cat.asp

📁 一个不错的拍卖网站,fdsafdsfdfe
💻 ASP
字号:
<!--#include file="conn.asp" -->
<!-- #include file="inc/adovbs.inc" -->
<!-- #include file="inc/info.asp" -->
<!-- #include file="webtop.asp" -->
<html>
<head>
<TITLE><%=webname%>--产品页</TITLE>
<META http-equiv=Content-Type content="text/html; charset="<%=charset%>">
<META name="keywords" content="<%=keywords%>">
<META name="description" content="<%=description%>">
<link href="images/yq_style.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 onmouseover=exitpop=false text=#000000 topMargin=0 marginheight="0" marginwidth="0">
<%
if request("page")<>"" then
  if not isnumeric(request("page")) then
      response.write "<br>"+"<li>非法的分页参数。"
	  response.end
  end if
end if
if request("catid")<>"" then
  if not isnumeric(request("catid")) then
      response.write "<br>"+"<li>非法的分类参数。"
	  response.end
  end if
end if
dim strsql,aucid
dim bookmark,totalcs,Currentpage,totalpages,i
catid=request.querystring("catid")
if catid ="" then 
catid ="1"
end if
strsql2 = " select * FROM cat left join catson on cat.catid =catson.catid where cat.catid="&catid&" order by cat.catid"
set rs2=conn.execute(strsql2)
%>
<table width="760" border="0" align=center>
<tr>
<td>
<table width="760" border="0" align=center>
  <tr> 
    <td><a href="index.asp">首页</a>&gt;&gt;&gt; 
	<%
	if rs2.eof then
	response.write "还没有小分类呢!"
	rs2.close
	set rs2=nothing
	response.end
	else
	%>
      <a href="cat.asp?catid=<%=catid%>"><%=rs2("catname")%></a></td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="2"> 
      <%
	while not rs2.eof%>
      &nbsp;<a href="viewcats.asp?catid=<%=catid%>&catsid=<%=rs2("catsonid")%>"><%=rs2("catsonname")%> 
      </a> &nbsp; &nbsp; 
      <%rs2.movenext
	wend
	end if
	rs2.close
set rs2=nothing%>
    </td>
  </tr>

    <tr>
      <td><a href=sell.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>|<a href=8c7_end_auction.asp>已经结束商品</a></div>
      </td>
    </tr>
  </table>

<table width="760" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#cccccc">
<%
set rs=server.createobject("adodb.recordset")
if rst("action")="closing" then
strsql = " select * FROM Auctions WHERE catid ="&catid&" and aucCloseDate > #"&now&"#  and aucEnded='N' order by aucCloseDate"

end if
if rst("action")="new" then
strsql = " select * FROM Auctions WHERE catid ="&catid&" and aucCloseDate > #"&now&"#  and aucEnded='N' order by aucAvailDate desc"
end if
if rst("action")="hot" then
strsql = " select * FROM Auctions WHERE catid ="&catid&" and aucCloseDate > #"&now&"#  and aucEnded='N' order by bidtimes desc"
end if
if rst("action")="all" or rst("action")="" then
strsql = " select * FROM Auctions WHERE aucCloseDate > #"&now&"#  and aucEnded='N' order by  aucCloseDate"
end if

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

  <tr bgcolor="#FFCC00"> 
    <td width="106" bgcolor="#EDECEC"> 
      <div align="center">商品图片</div>
    </td>
    <td width="312" bgcolor="#EDECEC"> 
      <div align="center">商品名称</div>
    </td>
    <td width="91" bgcolor="#EDECEC"> 
      <div align="center">现价</div>
    </td>
    <td width="81" bgcolor="#EDECEC"> 
      <div align="center">竞标数</div>
    </td>
    <td bgcolor="#EDECEC" width="167"> 
      <div align="center">剩余时间</div>
    </td>
  </tr>
  <%
if not rs.eof then
rs.movefirst
rs.pagesize=jsperpage
if trim(request("page"))<>"" then
   currentpage=clng(request("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
'  i=0
  
  
 '  while not rs.eof
if i mod 2 =0 then
  %>
  <tr id=b2  bgcolor="#FFFFFF"> 
    <td width="106" id=bg02> 
      <div align="center">
	  <%
	  if rs("aucImageURL")="" then
	  response.write "没有图片"
	  else%><a href="viewaucid.asp?aucid=<%=rs("aucID")%>" target=_blank>
	 <img src="<%=rs("aucImageURL")%>" width="85" height="85"  border=0></a>
	  <%end if%></div>
    </td>
    <td width="312" id=bg02> 
      <div align="center"><a href="viewaucid.asp?aucid=<%=rs("aucID")%>" target=_blank><%=rs("aucItemTitle")%></a></div>
    </td>
    <td width="91" id=bg02> 
      <div align="center"><%=rs("aucCurrentBid")%></div>
    </td>
    <td width="81" 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>
  <%else%>
  <tr  bgcolor="#FFFFFF"> 
    <td width="106" id=bg06> 
      <div align="center">
	  <%
	  if rs("aucImageURL")="" then
	  response.write "没有图片"
	  else%><a href="viewaucid.asp?aucid=<%=rs("aucID")%>" target=_blank>
	 <img src="<%=rs("aucImageURL")%>" width="85" height="85"  border=0></a>
	  <%end if%></div>
    </td>
    <td width="312" id=bg06> 
      <div align="center"><a href="viewaucid.asp?aucid=<%=rs("aucID")%>" target=_blank><%=rs("aucItemTitle")%></a></div>
    </td>
    <td width="91" id=bg06> 
      <div align="center"><%=rs("aucCurrentBid")%></div>
    </td>
    <td width="81" id=bg06> 
      <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=bg06> 
      <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>
  <% end if
   i=i+1
  rs.movenext
loop
else
if rs.eof and rs.bof then%>
<tr><td nowrap height="30" colSpan=5>当前没有商品!</td></tr>
<%end if
end if
'if not request("catid")=1 then
sub FPage()%>
<form name="form1" method="post" action="cat.asp?catid=<%=request.querystring("catid")%>">
<tr> 
<td align="right" bgcolor="#ECECEC" colspan="5">
<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 color="#FF6666"><%=totalcs%></font>]个商品 分[<font color="#FF6666"><%=totalpages%></font>]页</TD>
<TD width="40%" align=middle bgcolor="#e6e6e6"><IMG height=11 src="img/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</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 color='999966'>下一页 尾页</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" class="lanyu">
<%
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="copyright.asp" -->
</BODY></HTML>

⌨️ 快捷键说明

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