📄 newshop.asp
字号:
<!--#include file="connection.asp"-->
<!--#include file="webconfig.asp"-->
<%dim Action
Action=request.QueryString("Action")%>
<html>
<head>
<title><%=webname%>--新书推荐</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/default.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦!:)';return true">
<!--#include file="webtop.asp"-->
<table width="776" height="6" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="6"></td>
</tr>
</table>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="190" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><img src="<%if Action="tuijian" then response.write "images/jptjb.gif" else response.write "images/newshop.gif" end if%>" width="607" height="57"></td>
</tr>
<tr valign="top">
<td height="157"> <%'开始分页
Const MaxPerPage=18
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
if Action="tuijian" then
sql="select bookname,bookid,tuantijia,huiyuanjia,shichangjia,dazhe,queshu,bookpic from shop_books where bestbook=1 order by bookdateorder desc "
else
sql="select top 200 bookname,bookid,tuantijia,huiyuanjia,shichangjia,dazhe,queshu,bookpic from shop_books order by bookdateorder desc "
end if
conn.CursorLocation = 3
set rs=conn.execute(sql)
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,目前没有更新图书!</p>"
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,"newshop.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"newshop.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"newshop.asp"
end if
end if
end if
sub showContent
dim i
i=0
%> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <table width="98%" 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>
<hr width="96%" size="1" color=#000000> <%
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 "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1&Action="&Action&" class='contents'>首页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&Action="&Action&" 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)&"&Action="&Action&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&Action="&Action&" 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&"种商品 "&maxperpage&"种商品/页</font> "
Response.Write "<select name=select onchange=""var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}"" ><option >跳转到</option>"
dim mmm
for mmm=1 to n
response.write "<option value=NewShop.asp?Page="&mmm&"&Action="&action
if int(request.QueryString("Page"))=int(mmm) then response.write " selected"
response.write ">第"&mmm&"页</option>"
next
response.write "</select>"
End Function
%> </td>
</tr>
</table></td>
<td width="170" valign="top" bgcolor="#FDE6A4"><DIV id=floater
style="Z-INDEX: 20; WIDTH: 144px; POSITION: absolute; TOP: 219px; overflow: visible;"><br>
<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="170" 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="164" height="20"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
<%conn.close
set conn=nothing%>
<script language=javascript>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>
<%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="left" cellPadding=0 cellSpacing=0 width=80% >
<TBODY>
<TR>
<TD align=left 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></a>
<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></a>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -