回复 1# 的帖子
代码如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<!--#include file="manage/inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/chk.asp"-->
<%
dim id,i,iii ,books,bookscount,product
id=request("id")
if id="" then
call MsgBox("你的购物车内没有商品!","Back","None")
response.end
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上书城</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="head.htm"-->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="219" align="left" valign="top"><!--#include file="uleft.asp"--></td>
<td width="561" align="left" valign="top">
<br>
<br>
<form name="form1" method="post" action="">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr align="center" bgcolor="#eeeeee">
<td align="left">商品名称</td>
<td width="9%">市场价</td>
<td width="9%"> 会员价</td>
<td width="9%">折扣</td>
<td width="10%">VIP会员价</td>
<td width="9%"> 数量</td>
<td width="12%"> 小计</td>
<td width="10%">修改数量</td>
</tr>
<%
Dim cart
Dim cart_numRows
Set cart = Server.CreateObject("ADODB.Recordset")
cart.ActiveConnection = MM_conn_STRING
cart.Source = "SELECT id,name,price1,price2,vipprice,discount
FROM product
WHERE id in ("&id&")
ORDER BY id"
cart.CursorType = 1
cart.CursorLocation = 2
cart.LockType = 1
cart.Open()
cart_numRows = 0
%>
<%
iii=0
bookscount=request.QueryString("id").count
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
cart_numRows = cart_numRows + Repeat1__numRows
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT cart.EOF))
%>
<%
dim quatity
Quatity = CInt( Request( "shop"&cart("id")) )
If Quatity <=0 Then Quatity = 1
%>
<tr align="center">
<td style='PADDING-LEFT: 5px' align="left"><%=(cart.Fields.Item("name").Value)%>
<input type=hidden name=name value=<%=(cart.Fields.Item("name").Value)%>>
</td>
<td ><%=(cart.Fields.Item("price1").Value)%>元</td>
<input type=hidden name=price2 value=<%=(cart.Fields.Item("price2").Value)%>>
<td><%=(cart.Fields.Item("price2").Value)%>元</td>
<td><%=(cart.Fields.Item("discount").Value)*100%>%</td>
<td><%=(cart.Fields.Item("vipprice").Value)%>元</td>
<td><input name="<%="shop"& cart("id")%>" type="text" size="3" value="<%=Quatity%>" 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'))">
</td>
<td>
<%
Dim rsvip,strvip,strdeposit,txtvip
set rsvip=server.CreateObject("adodb.recordset")
rsvip.open "select vip from [user] where username='"&request.cookies(cookieName)("username")&"' ",conn,1,1
strvip = rsvip("vip")
if
strvip = true then
txtvip = "VIP会员"
if Quatity<=1 then
response.write cart("vipprice")*1&"元"
else
response.write cart("vipprice")*Quatity&"元"
end if
iii=cart("vipprice")*Quatity+iii
else
txtvip = "普通会员"
if Quatity<=1 then
response.write cart("price2")*1&"元"
else
response.write cart("price2")*Quatity&"元"
end if
iii=cart("price2")*Quatity+iii
end if
%></td>
<td WIDTH="12%" align="center"><input type="submit" name="Submit" value="修改"
onClick="this.form.action='cart.asp?action=modify';this.form.submit()">
</td>
</tr>
<%if bookscount=1 then books=cart("id")%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
cart.MoveNext()
Wend
%>
<%
cart.Close()
Set cart = Nothing
%>
<tr height="20">
<td colspan="4" align="center">你是 <font color="#FF0000">
<% = txtvip %>
</font> 会员</td>
<td colspan="4" align="right"><font color="#FF0000">总计:<%=iii%>元 </font></td>
</tr>
<tr>
<td height="32" colspan="8" align="center"><input type="submit" name="Submit2" value="下一步" onClick="this.form.action='checkout.asp';this.form.submit()" >
<input name="id" type="hidden" id="id" value="<%=id%>">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
<!--#include file="foot.htm"-->
</body>
</html>