📄 classright.asp
字号:
<!--#include file="connection.asp"-->
<!--#include file="webconfig.asp"-->
<%dim nclassid,anclassid
nclassid=int(request.QueryString("nclassid"))
anclassid=int(request.QueryString("anclassid"))
if int(request("intbook"))<>0 then
session("intbook")=int(request("intbook"))
end if
if session("intbook")="" then session("intbook")=20
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/default.css" rel="stylesheet" type="text/css">
</head>
<script language=javascript>
function mm1()
{
var a = document.getElementsByTagName("input");
if(a[0].checked==false)
{
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = true;
}
else
{
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = false;
}
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦!:)';return true">
<!--#include file="webtop.asp"-->
<table width="10" height="7" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height=7></td>
</tr>
</table>
<%'开始分页
dim maxperpage
MaxPerPage=session("intbook")
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
conn.CursorLocation = 3
if nclassid=0 or anclassid=0 then
sql="select top 50 bookname,bookzz,bookchuban,bookdateorder,shichangjia,tuantijia,dazhe,huiyuanjia,queshu,bookid from shop_books order by bookdateorder desc"
else
sql="select bookname,bookzz,bookchuban,bookdateorder,shichangjia,huiyuanjia,dazhe,queshu,tuantijia,bookid from shop_books where nclassid="&nclassid&" and anclassid="&anclassid&" order by bookdateorder desc"
end if
set rs=conn.execute(sql)
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write "<table align=center><tr><td> <br>对不起,此分类暂时还没有图书!</td></tr></table>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"ClassRight.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"ClassRight.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"ClassRight.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<form name="form1" method="post" action="" onsubmit="window.open('',this.target,'width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');">
<tr bgcolor="#FFD55A">
<td><div align="center">图书名称</div></td>
<td><div align="center">作者</div></td>
<td><div align="center">出版社</div></td>
<td><div align="center">出版日期</div></td>
<td><div align="center">市场价</div></td>
<td><div align="center">会员价</div></td>
<td><div align="center"><%if request.cookies("bookshop")("grtt")=1 then response.write "团体价" else response.write "折 扣" end if%></div></td>
<td><div align="center">选择</div></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FDE6A4">
<td style="padding-left:4px"><a href=book.asp?id=<%=rs("bookid")%> target=_blank><%=trim(rs("bookname"))%></a></td>
<td><div align="center"><%=trim(rs("bookzz"))%></div></td>
<td><div align="center"><%=trim(rs("bookchuban"))%></div></td>
<td><div align="center"><%=cdate(rs("bookdateorder"))%></div></td>
<td><div align="center"><%=formatnumber(ccur(rs("shichangjia")),2)&"元"%></div></td>
<td><div align="center"><font color=#ff6600><%=formatnumber(ccur(rs("huiyuanjia")),2)&"元"%></font></div></td>
<td><div align="center"><font color=#ff6600><%if request.cookies("bookshop")("grtt")=1 then
response.write formatnumber(ccur(rs("tuantijia")),2)&"元"
else
response.write formatnumber((round(rs("dazhe"),2)*10),1)&"折"
end if
%></font></div></td>
<td><div align="center">
<input name="bookid" type="checkbox" id="bookid" value="<%=int(rs("bookid"))%>" <%if int(rs("queshu"))=1 then response.write "disabled"%>>
</div></td>
</tr>
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing%>
<tr bgcolor="#FFD55A">
<td height="30" colspan="8"><div align="center"> <input type="submit" name="Submit4" value="添加到收藏架" onclick="this.form.action='shoucang.asp?action=add';this.form.target='ckxp';">
<input type="submit" name="Submit3" value="直接购买" onclick="this.form.action='shopping.asp';this.form.target='ckxp';">
</td>
</tr>
</form>
</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 "<table align=center><form method=Post action="&filename&"?nclassid="&nclassid&"&anclassid="&anclassid&">"
response.write "<tr><td>"
If CurrentPage<2 Then
Response.Write "首页 上一页 "
Else
Response.Write "<a href="&filename&"?page=1&nclassid="&nclassid&"&anclassid="&anclassid&" >首页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&nclassid="&nclassid&"&anclassid="&anclassid&" >上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "下一页 尾页"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&nclassid="&nclassid&"&anclassid="&anclassid&" >"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&nclassid="&nclassid&"&anclassid="&anclassid&" >尾页</a>"
End If
Response.Write " 页次:"&CurrentPage&"/"&n&"页 "
Response.Write "<font class='contents'> 共有"&totalnumber&"种商品 "&maxperpage&"种商品/页</font> "
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'))"">"
Response.Write " <input type='submit' class='contents' value='GO' name='cndok'></td></tr></form></table>"
End Function
%>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -