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

📄 displaycats.asp

📁 实用的拍卖源码。适合个人建站学习使用。仅供学习参考
💻 ASP
字号:
<%
catid=rst("catid")
catsid=rst("catsid")
call chk(catid,"id")
%>
<!-- #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 bgColor=#ffffff 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 "<script language=javascript>alert('非法的分页参数');this.location.href='index.asp';</script>"
	response.end
  end if
end if
dim strsql,strsql2

if catsid<>"" then
call chk(catsid,"id")
strsql = "select * FROM Auctions WHERE catid ="&catid&" and catsonid="&catsid&" and aucCloseDate > #"&now()&"# and aucEnded='N' order by aucCloseDate"
strsql2 = "select * FROM catson left join cat on cat.catid =catson.catid where catson.catsonid="&catsid
else
strsql = "select * FROM Auctions WHERE catid ="&catid&" and aucCloseDate > #"&now()&"# and aucEnded='N' order by aucCloseDate"
strsql2 = "select * FROM cat where catid="&catid
end if
set rs=server.createobject("adodb.recordset")
rs.open strsql,conn,1,1
if rs.eof then
   response.write"<br><center><font color=#ff0000>没有找到这个分类的商品耶.</font></center>"
else
set rs2=conn.execute(strsql2)
if rs2.eof then
   response.write"<br><center><font color=#ff0000>没有找到这个分类的商品耶</font></center>"
else
totalcs=rs.recordcount
%>
	
<table width="760" border="0" align=center>
  <tr> 

    <td><a href="index.asp">首页</a>&gt;&gt;&gt;<a href="displaycats.asp?id=<%=catid%>"><%=rs2("catname")%></a><% if catsid<>"" then %>&gt;&gt;&gt;<a href="displaycats.asp?catsid=<%=rs2("catsonid")%>"><%=rs2("catsonname")%></a><% end if %></td>

  </tr>
</table>
<table width="760" border="0" cellspacing="1" cellpadding="0" align="center" class=tablebg>
  <tr class=titletd> 
    <td width="106"> 
      <div align="center">商品图片</div>
    </td>
    <td width="312"> 
      <div align="center">商品名称</div>
    </td>
    <td width="91"> 
      <div align="center">现价</div>
    </td>
    <td width="81"> 
      <div align="center">竞标数</div>
    </td>
    <td width="167"> 
      <div align="center">剩余时间</div>
    </td>
  </tr>
  <%

 if not rs.eof then
rs.movefirst
rs.pagesize=jsperpage
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
		   dim bookmark
		   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


if i mod 2 =0 then
  %>
  <tr id=b2 class=td> 
    <td width="106" id=bg02> 
      <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="85" height="85" border=0></a>
	  <%end if%></div>
    </td>
    <td width="312" id=bg02> 
      <div align="center"><a href="aucinfo.asp?aucid=<%=rs("aucID")%>"><%=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
%>

      </div>
    </td>
  </tr>
  <%else%>
  <tr class=td> 
    <td width="106" id=bg06> 
      <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="85" height="85" border=0></a>
	  <%end if%></div>
    </td>
    <td width="312" id=bg06> 
      <div align="center"><a href="aucinfo.asp?aucid=<%=rs("aucID")%>"><%=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
%>

      </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 class=td>当前没有商品!</td></tr>
<%
	end if
  end if
'if not rst("catid")=1 then%>
<form name="form1" method="post" action="displaycats.asp?catid=<%=request.querystring("catid")%>">
<tr> 
<td align="right" colspan="5">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR class=titletd> 
<TD align=middle width="35%" height=25><IMG height=14 src="img/cha.gif" width=14 align=absMiddle> 共[<font class=fblack><%=totalcs%></font>]个商品 分[<font class=fblack><%=totalpages%></font>]页</TD>
<TD width="40%" align=middle><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=displaycats.asp?page=1&catid="&request.querystring("catsid")&">首页</a> "
response.write "<a href=displaycats.asp?page="&CurrentPage-1&"&jscat_id="&request.querystring("catsid")&">上一页</a> "
end if
if totalpages-currentpage<1 then
response.write "<font class=fblack>下一页 尾页</font>"
else
response.write "<a href=displaycats.asp?page="&CurrentPage+1&"&catid="&request.querystring("catsid")
response.write ">下一页</a> <a href=displaycats.asp?page="&totalpages&"&catid="&request.querystring("catsid")&">尾页</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>&nbsp;<input type="submit" name="Submit2" value="转向" class="button"> </TD>
</TR>
</form>
</TABLE>    
</td></tr></table>      
<%end if%>
<%end if%>
</BODY>
</HTML>
<!-- #include file="bottom.asp" -->

⌨️ 快捷键说明

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