📄 display.asp
字号:
<%@ Language=VBScript%>
<html>
<head>
<title>都乐书店</title>
<meta http-equiv="introduce-Type" content="text/html; chaRecdet=gb2312">
<link rel="stylesheet" type="text/css" href="css/common.css">
<Script language=javascript>
function setcookie(cookiename, bookid, bookname,publish, unitprice, num)
{
var expiryday = new Date();
expiryday.setTime(expiryday.getTime() + 3*30*60*1*1000);
var valuestr = "bookid" + bookid + "|" +
"bookname" + bookname + "|" +
"publish" + publish + "|" +
"unitprice" + parseFloat(unitprice) + "|" +
"num"+ parseFloat(num);
var namestr = cookiename + "=" + valuestr;
var expirystr = "expires" + "=" + expiryday.toGMTString();
var amount = parseInt(num);
if (!isNaN(amount))
document.cookie = namestr + ";" +
expirystr + ";" +
"path=/";
//window.alert("cookie:" + document.cookie);
}
function addtocart(form) {
if (parseInt(form.num.value) >= 1) {
setcookie("dule"+form.bookid.value,form.bookid.value, form.bookname.value, form.publish.value, form.unitprice.value, form.num.value);
window.alert("'" + form.bookname.value + "' 已放入您的购物车.\n\n" +
"欢迎您继续购物或到收银台结帐.\n");
} else {
window.alert("对不起,请您输入购买数量!");
}
}
</Script>
</head>
<body topmargin=4>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><!--#include file="include/title.inc"--></td>
</tr>
<tr>
<td>
<%
bookid=Request("bookid")
set conn=server.CreateObject("ADODB.connection")
conn.open application("dtbase"),application("user"),application("pwd")
set Recd=server.CreateObject("ADODB.Recordset")
sql="select * from books where bookid='"&bookid&"'"
Recd.open sql,conn,3
%>
<br>
<table width="500" border="0" cellspacing="4" cellpadding="0" align="center">
<tr>
<td rowspan="10" width="32%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<img src="pages/<%=rtrim(Recd("ISBN"))%>.jpg" width="100" height="135" border="1">
</td>
</tr>
<tr>
<form action="" method="post">
<td align="center">
<input type="hidden" name="bookid" value="<%=bookid%>">
<input type="hidden" name="bookname" value="<%=Recd("bookname")%>">
<input type="hidden" name="publish" value="<%=Recd("publish") %>">
<input type="hidden" name="unitprice" value="<%=Recd("unitprice") %>">
数量: <input type="text" name="num" value="1" size="5" maxlength=4><br>
<input value="放入购物车" type="button" alt="订购" onclick="addtocart(this.form);" class="inputbox">
</td>
</form>
</tr>
</table>
</td>
<td colspan="2" align="center" height=20 class="big"> 本 书 详 细 信 息 </td>
</tr>
<tr>
<td width="27%"align="center"> 书 名 </td>
<td width="41%"><%=Recd("bookname") %></td>
</tr>
<tr>
<td width="27%"align="center">作 者 </td>
<td width="41%"><%=Recd("auther")%></td>
</tr>
<tr>
<td width="27%"align="center">开 本 </td>
<td width="41%"><%=Recd("banshi") %></td>
</tr>
<tr>
<td width="27%"align="center"> ISBN书号 </td>
<td width="41%"><%=Recd("ISBN") %></td>
</tr>
<tr>
<td width="27%"align="center"> 出 版 社 </td>
<td width="41%"><%=Recd("publish") %></td>
</tr>
<tr>
<td width="27%"align="center"> 出版日期 </td>
<td width="41%"><%=Recd("publishdate") %></td>
</tr>
<tr>
<td width="27%"align="center">配套光盘 </td>
<td width="41%">
<%if Recd("cd")= true then
Response.Write "有"
else
Response.Write "无"
end if
%>
</td>
</tr>
<tr>
<td align=center>页 数</td>
<td><%=Recd("pagenumber")%>页</td>
</tr>
<tr>
<td width="27%"align="center">定 价 </td>
<td width="41%"><%=Recd("unitprice") %></td>
</tr>
<tr>
<td colspan="3" style="line-height:160%">内容简介:<br> <%=Recd("introduce") %></td>
</tr>
<tr>
<td align=right colspan="3">
<form action="mail.asp" method=post id=form2 name=form2>
<input type=hidden name="bookid" value="<%=bookid%>">
<input type=hidden name="bookname" value=<%=Recd("bookname")%>>
<input type="button" value="查看购物车" onclick="location.href='default.asp?job=shopcar'" class="inputbox">
<input type="button" value="返回上页" onclick="history.back()" class="inputbox">
<input type="submit" value="介绍给好友" id=submit1 name=submit1 class="inputbox">
</form>
</td>
</tr>
<tr>
<td colspan=3>
<span class="color2">■</SPAN><span class="color1">[ 相关书目:]</span>
<hr size=1 color=blue>
<div style="padding-left:80px;line-height:140%">
<%
set RecAbout = Server.CreateObject ("ADODB.Recordset")
RecAbout.Open "Select top 15 bookid,bookname from books where bookid<>'"&Recd("bookid")&"'and bookname like '%"&left(Recd("bookname"),8)&"%' and maintype = '"&Recd("maintype")&"'and secondtype='"&Recd("secondtype")&"' order by bookid DESC",conn,3
if RecAbout.RecordCount > 0 then
for i = 1 to 15
%>
<a href="display.asp?bookid=<%=RecAbout("bookid")%>"><%= RecAbout("bookname")%></a><br>
<%
RecAbout.movenext
if RecAbout.eof then exit for
next
else
Response.Write "相关书目为0"
end if
Response.Write "</div>"
Recd.close ()
RecAbout.Close ()
conn.close ()
%>
<hr size=1 color=blue>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="45" align="center">
<!--#include file="include/foot.inc"-->
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -