📄 class.asp
字号:
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
<%dim num
i=0
num=0
do while not rs.eof
i=i+1
num = Num+1
If num Mod 2 = 0 Then
%>
<td width="50%" height="23">
<%showbook%>
</td>
</tr>
<%else%>
<tr>
<td width="50%">
<%showbook%>
</td>
<%end if%>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
</td>
</tr>
</table>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<form method=Post action="&filename&"?nid="&nclassid&">"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1&nid="&nclassid&" class='contents'>首页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&nid="&nclassid&" class='contents'>上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下一页 尾页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&nid="&nclassid&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&nid="&nclassid&" class='contents'>尾页</a>"
End If
Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "
Response.Write "<font class='contents'> 共有"&totalnumber&"种商品 "
Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&" onkeypress = ""return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))""onpaste= ""return regInput(this,/^[0-9]*$/, window.clipboardData.getData('Text'))""ondrop= ""return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"" maxlength=3 >"
Response.Write " <input type='submit' class='contents' value='GO' name='cndok'></form>"
End Function
%></td>
<td width="167" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="64"><table width="160" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="<%if request.cookies("bookshop")("username")="" then
response.write "images/login_r1_c1.gif"
else
response.write "images/GWXX.gif"
end if%>" width="160" height="26"></td>
</tr>
<tr>
<td width="1" rowspan="2"><img src="images/login_r2_c1.gif" width="6" height="164"></td>
<td width="138" height="140" background="images/login_r2_c2.gif"><!--#include file="userinfo.asp"--></td>
</tr>
<tr>
<td><img src="images/login_r3_c2.gif" width="154" height="20"></td>
</tr>
</table></td>
</tr><tr>
<td height="2" colspan="2"></td>
</tr>
<tr>
<td height="72"> <table width="162" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="2" background="images/GZPHbg.gif"><div align="center"><img src="images/GZPH.gif" width="141" height="24"></div></td>
</tr><tr>
<td height="2" colspan="2"></td>
</tr>
<%
if paihangkongzhi=0 then
sql="select top 20 bookid,bookname,liulancount from shop_books order by liulancount desc"
else
sql= "select top 20 bookid,bookname,liulancount from shop_books where guanzhupaihang=1 order by bookdateorder desc"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "请管理员先到后台添加图书。"
else
dim i
i=1
do while not rs.eof
%>
<tr bgcolor="#D4EEFB">
<td width="17"><div align="center"><%=i%></div></td>
<td width="138" class=pad><%response.write "<a href=book.asp?id="&rs("bookid")&" title=此图书已被浏览过"&rs("liulancount")&"次 target=_blank>"&trim(rs("bookname"))&"</a>"%></td>
</tr>
<%if i>=20 then exit do
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
end if%>
<tr bgcolor="#DBECEE">
<td colspan="2" bgcolor="#00B9F2"><div align="right"><a href="bookorder.asp">更多的关注排行>></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="57">
<table width="162" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="5" colspan="2"></td>
</tr> <tr>
<td colspan="2" background="images/cxphbg.gif"><div align="center"><img src="images/cxph.gif" width="138" height="24"></div></td>
</tr>
<tr>
<td height="1" colspan="2"></td>
</tr>
<%
if paihangkongzhi=0 then
sql="select top 20 bookid,bookname,chengjiaocount from shop_books order by chengjiaocount desc"
else
sql="select top 20 bookid,bookname,chengjiaocount from shop_books where changxiao=1 order by bookdateorder desc"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "还没有图书"
else
i=1
do while not rs.eof
%>
<tr bgcolor="#FDFADD">
<td width="17"><div align="center"><%=i%></div></td>
<td width="138" class=pad>
<%response.write "<a href=book.asp?id="&rs("bookid")&" title=此图书已成功销售"&rs("chengjiaocount")&"次 target=_blank>"&trim(rs("bookname"))&"</a>"%> </td>
</tr>
<%if i>=20 then exit do
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
end if%>
<tr bgcolor="#DBECEE">
<td colspan="2" bgcolor="#CDD912"><div align="right"><a href="bookorder.asp">更多的销售排行>></a></div></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
<%conn.close
set conn=nothing%>
</body>
</html>
<%sub showbook()%>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top width="14%" style="PADDING-LEFT: 6px"><img height=103 hspace=5
src="images/bg_book.gif" width=71 vspace=5 border=0> <P style="MARGIN-TOP: -112px"><A href=book.asp?id=<%=rs("bookid")%> target=_blank><IMG
height=96 alt="点击查看《<%=trim(rs("bookname"))%>》详细资料" hspace=5
src=<%if trim(rs("bookpic"))="" then
response.write "images/emptybook.gif"
else
response.write trim(rs("bookpic"))
end if%> width=65 vspace=3
border=0></A></TD>
<TD width="86%"><A class=a4
href=book.asp?id=<%=rs("bookid")%> target=_blank><font color=#FF6600><%=trim(rs("bookname"))%></font></A><BR>
市场价:<del><%=formatnumber(rs("shichangjia"),2)&"元"%></del><BR>
会员价:<font color=#FF6600><%=formatnumber(rs("huiyuanjia"),2)&"元"%></font> <BR>
<%if request.cookies("bookshop")("grtt")=1 then%>团体价:<font color=#FF6600><%=formatnumber(rs("tuantijia"),2)&"元"%></font><%else%>折 扣:<font color=#FF6600><%=formatnumber((round(rs("dazhe"),2)*10),1)%>折</font><%end if%><br>
<TABLE align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD align=middle width=93 height=22><a href="#" <%if int(rs("queshu"))=0 then
response.write "onClick=""javascript:window.open('shoucang.asp?id="&rs("bookid")&"&action=add ','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" "
else
response.write "onClick=javascript:alert('《"&trim(rs("bookname"))&"》暂时没有库存,请您继续关注!')"
end if%> ><img src=images/shoucang.gif width=49 height=14 align=absmiddle border=0 <%if int(rs("queshu"))=1 then response.write "alt=没有库存"%>></a>
</TD>
<TD width=68 height=22>
<a href="#" <%if int(rs("queshu"))=0 then
response.write "onClick=""javascript:window.open('shopping.asp?id="&rs("bookid")&" ','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" "
else
response.write "onClick=javascript:alert('《"&trim(rs("bookname"))&"》暂时没有库存,请您继续关注!')"
end if%> ><img src=images/gouwu.gif width=49 height=14 align=absmiddle border=0 <%if int(rs("queshu"))=1 then response.write "alt=没有库存"%> ></a>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -