?? confirmed.asp
字號:
<%@ LANGUAGE=vbscript %>
<!--#INCLUDE FILE="include/shop.asp" -->
<!--#INCLUDE FILE="include/util.asp" -->
<% REM ##########################################################################%>
<% REM #%>
<% REM CONFIRMED.ASP #%>
<% REM 訂單確認 #%>
<% REM #%>
<% REM Copyright (c) 1996-98 Microsoft Corporation. All rights reserved. #%>
<% REM #%>
<% REM ##########################################################################%>
<%
cardnum=request("cardnum")
password=request("password")
dim errorList
'讀運費信息
cmdTemp.CommandText = "SELECT * FROM CARRIAGE"
Set recordSet = Server.CreateObject("ADODB.Recordset")
recordSet.Open cmdTemp, , adOpenKeyset, adLockOptimistic
while not(recordset.EOF)
if recordset("id")="1" then cost1=recordset("cost")
if recordset("id")="2" then cost2=recordset("cost")
if recordset("id")="3" then cost3=recordset("cost")
if recordset("id")="4" then cost4=recordset("cost")
recordset.MoveNext
wend
recordset.Close
cmdTemp.CommandText = "SELECT * FROM basket WHERE session_id = '" & session.SessionID & "' order by product_id"
recordSet.Open cmdTemp, , adOpenKeyset, adLockOptimistic
if recordset.RecordCount =0 then
errorList=errorList & "您的購物籃是空的。<br>"
end if
if (Isnull(ShopperID) or isempty(ShopperID)) then
errorList=errorList & "用戶未登錄或操作超時。<br>"
end if
bill_to_name = checklength(Request("bill_to_name"), 25)
if IsNull(bill_to_name) then
errorList=errorList & "付款人必須在1到25個漢字。<br>"
end if
bill_to_street = checklength(Request("bill_to_street"), 120)
if IsNull(bill_to_street) then
errorList=errorList & "付款人地址必須在1到120個漢字。<br>"
end if
bill_to_method = checklength(Request("bill_to_method"), 4)
if IsNull(bill_to_method) then
errorList=errorList & "必須選擇付款方式。<br>"
end if
bill_to_state = checklength(Request("bill_to_state"),15)
if IsNull(bill_to_state) then
errorList=errorList & "付款人位置付款人地址必須在1到15個漢字。<br>"
end if
bill_to_city = checklength(Request("bill_to_city"), 25)
if IsNull(bill_to_city) then
errorList=errorList & "付款人城市必須在1到25個漢字。<br>"
end if
bill_to_zip = checklength(Request("bill_to_zip"), 15)
if IsNull(bill_to_zip) then
errorList=errorList & "付款人郵編位置必須在1到15個數字。<br>"
end if
bill_to_phone = checklength(Request("bill_to_phone"), 20)
if IsNull(bill_to_phone) then
errorList=errorList & "付款人電話必須是1到20個字符。<br>"
end if
ship_to_name = checklength(Request("ship_to_name"), 25)
if IsNull(ship_to_name) then
errorList=errorList & "收貨人必須在1到25個漢字。<br>"
end if
ship_to_street = checklength(Request("ship_to_street"), 120)
if IsNull(ship_to_street) then
errorList=errorList & "收貨人地址必須在1到120個漢字。<br>"
end if
ship_to_state = checklength(Request("ship_to_state"),15)
if IsNull(ship_to_state) then
errorList=errorList & "收貨人位置付款人地址必須在1到15個漢字。<br>"
end if
ship_to_city = checklength(Request("ship_to_city"), 25)
if IsNull(ship_to_city) then
errorList=errorList & "收貨人城市必須在1到25個漢字。<br>"
end if
ship_to_zip = checklength(Request("ship_to_zip"), 15)
if IsNull(ship_to_zip) then
errorList=errorList & "收貨人郵編位置必須在1到15個數字。<br>"
end if
ship_to_phone = checklength(Request("ship_to_phone"), 20)
if IsNull(ship_to_phone) then
errorList=errorList & "收貨人電話必須是1到20個字符。<br>"
end if
description = checklength(Request("note"), 100)
ship_to_email = checklength(Request("ship_to_email"), 50)
bill_to_email = checklength(Request("bill_to_email"), 50)
'計算運費
if trim(bill_to_state)="其它" then
pay_currency="美金"
else
pay_currency="人民幣"
end if
if trim(ship_to_state)="北京" and pay_currency="人民幣" then
ship_fee=cost1
elseif trim(ship_to_state)<>"北京" and pay_currency="人民幣" then
ship_fee=cost2
elseif trim(ship_to_state)="北京" and pay_currency="美金" then
ship_fee=cost3
else
ship_fee=cost4
end if
%>
<%if errorList="" then%>
<html>
<head>
<title>訂單確認</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<LINK REL=stylesheet HREF="ecom.css" TYPE="text/css">
</head>
<body topmargin="0">
<!--#INCLUDE FILE = "include/toolbar.asp" -->
<br>
<table border="0" width="720" align="center">
<tr>
<td width="720" >
<table border="0" width="600" align="center">
<tr>
<td align="middle" bgColor=<%=tdcolor4%> colSpan=4" width="600" height=25>
<p align="center"><b>訂單確認</b></p>
</td>
</tr>
<tr bgColor=<%=thcolor4%>>
<td width="100"><font color="#000000">商品名稱</font></td>
<td width="200"><font color="#000000">數量</font></td>
<td width="100"><font color="#000000">單價</font></td>
<td width="200"><font color="#000000">小計</font></td>
</tr>
<% For i = 1 to recordSet.RecordCount
If recordSet.EOF then exit for
%>
<tr>
<td bgColor=<%=tdleft4%> width="100"><% =recordSet("name").value %></td>
<td bgColor=<%=tdleft4%> width="200"><% =recordSet("quantity").value %></td>
<% if pay_currency="美金" then %>
<td bgColor=<%=tdleft4%> width="100">$<% =recordSet("list_price").value %></td>
<%else %>
<td bgColor=<%=tdleft4%> width="100">¥<% =recordSet("rmb_price").value %></td>
<%end if%>
<%
quantity=recordSet("quantity").value
list_price=recordSet("list_price").value
'Response.Write list_price
'Response.End
'a=formatnumber(list_price,2)
'Response.Write a
'Response.End
if subtotal_price<> -1 then subtotal_price=formatnumber(quantity)*formatnumber(list_price,2)
if total_price<>-1 then total_price=total_price+subtotal_price
rmb_price=recordSet("rmb_price").value
rmbsubtotal_price=formatnumber(quantity)*formatnumber(rmb_price,2)
rmbtotal_price=rmbtotal_price+rmbsubtotal_price
if pay_currency="美金" then
if subtotal_price<>-1 then%>
<td bgColor="<%=tdleft4%>">$<% =subtotal_price %></td>
<%else %>
<td bgColor="<%=tdleft4%>">---</td>
<%end if
else %>
<td bgColor="<%=tdleft4%>">¥<% =rmbsubtotal_price %></td>
<%end if%>
</tr>
<% recordSet.MoveNext%>
<% next %>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">合計</td>
<% if pay_currency="美金" then %>
<td bgColor=<%=tdleft4%> width="200">$<% =total_price %></td>
<% else %>
<td bgColor=<%=tdleft4%> width="200">¥<% =rmbtotal_price %></td>
<%end if%>
</tr>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">運費</td>
<% if pay_currency="美金" then %>
<td bgColor=<%=tdleft4%> width="200">$<% =ship_fee%></td> \
<% else %>
<td bgColor=<%=tdleft4%> width="200">¥<% =ship_fee %></td>
<%end if%>
</tr>
<tr>
<td width="100"> </td>
<td width="200"> </td>
<td bgColor=<%=tdleft4%> width="100">總計</td>
<% if pay_currency="美金" then %>
<td bgColor=<%=tdleft4%> width="200">$<% =(formatnumber(ship_fee)+total_price)%></td>
<% else %>
<td bgColor=<%=tdleft4%> width="200">¥<% =(formatnumber(ship_fee)+rmbtotal_price)%></td>
<%end if%>
</tr>
</table>
<%
if bill_to_method="儲蓄卡付" then
tradesum=cstr(clng((formatnumber(ship_fee)+rmbtotal_price)*100))
'tradesum=cstr(clng(total_price*100))
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -