?? order.asp
字號:
<!--#include file="conn.asp" -->
<html>
<head>
<title>訂單確認列表</title>
<link href="css.css" rel="stylesheet">
</head>
<body>
<%
if session("user")="" then
response.write "<script language=javascript>alert('購物車沒有任何商品!');window.location.reload('javascript:window.close()')</script>"
response.end
end if
if request("action")="confirm" then
if request("conid")="" then
response.write "<br><div align=center>沒有此商品或者商品參數錯誤</div>"
else
sp=request("conid")
end if
if request("count")="" then
pcount=1
else
pcount=request("count")
end if
set rs=server.createobject("adodb.recordset")
sql="select * from basket where sp_id='"&sp&"' and user_name='"&session("user")&"' and basket_check=false"
rs.open sql,conn,3,3
if rs.eof then
rs.addnew
rs("sp_id")=sp
rs("user_name")=session("user")
rs("count")=pcount
rs("basket_date")=now()
rs("sp_name")=request("consp")
rs("memprice")=request("conprice")
else
rs("count")=int(rs("count"))+int(pcount)
end if
rs.update
rs.close
set rs=nothing
%>
<%
end if
%>
<table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="tabbgcolorli">
<td> <font color="#FFFFFF">您已選購的商品列表</font></td>
</tr>
</table>
<br>
<table class="border3" width="480" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="40%"> <div align="center">商品名稱 </div></td>
<td width="20%"> <div align="center">單價</div></td>
<td width="20%"> <div align="center">數量</div></td>
<td width="20%"> <div align="center">總金額</div></td>
</tr>
<form action="submitorder.asp" name="submitorder" method="post">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from basket where user_name='"&session("user")&"' and basket_check=false"
rs.open sql,conn,1,1
if rs.eof then
response.write"<br><div align=center>您暫時沒有已選購的商品</div>"
response.end
else
do while not rs.eof
%>
<tr>
<td><div align="center"><%=rs("sp_name")%></div></td>
<td><div align="center"><%=rs("memprice")%>元</div></td>
<td><div align="center"><%=rs("count")%></div></td>
<td><div align="center"><%=rs("count")*rs("memprice")%>元</div></td>
</tr>
<%
total=total+(rs("count")*rs("memprice"))
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<tr>
<td colspan="4">您已選購的商品的總價為:<%=total%>元 <input type="hidden" name="total" value="<%=total%>"> <input type="submit" name="sbm" value="這就去下訂單" class="border"></td>
</tr>
</form>
</table>
<br>
<table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href="javascript:window.close()"><font color="#000000">繼續購物之旅</font></a></div></td>
<td><div align="center"><a href="cp.asp"><font color="#000000">清除上述商品</font></a></div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -