📄 checkout.asp
字号:
<%@ Language=VBScript %>
<%
' this file gets the latest info from the customer before inserting order
' into db
%>
<!-- #include file="db.inc" -->
<%
If Session("customerid") = "" Then
Response.Redirect "../error.asp?error=" & Server.URLEncode ("We did not find your information, please fill the needed information again.")
End If
Dim rs
Set rs = Server.CreateObject ("adodb.Recordset")
rs.Open "customers", dbc, adOpenForwardOnly, adLockReadOnly, adCmdTable
rs.Filter = "custID = " & CInt(Session("customerid"))
If rs.EOF then
Response.Redirect "customer.asp?error=" & Server.URLEncode("Please enroll again, your information was not found.")
End If
msg = Request.QueryString ("msg")
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>Checkout</TITLE>
</HEAD>
<BODY>
<% If msg <> "" Then %>
<h3><font face="Arial">Error. <%= msg %></font></h3>
<% else %>
<h3><font face="Arial">Completing your order</font></h3>
<% end if %>
<P><FORM action="process.asp" method=post>
<TABLE border=1 cellPadding=4 cellSpacing=2 width=100%>
<TR>
<TD bgColor=darkblue><FONT color=white
face="" style="BACKGROUND-COLOR: #00008b"><STRONG>Customer
information</STRONG></FONT> </TD>
</TR>
<TD><STRONG>Customer ID:</STRONG> <%= rs("custid")%><br>
<STRONG>Name:</STRONG> <%= rs("cfirstname")& " " & rs("clastname") %><br>
<STRONG>Address:</STRONG> <%= rs("caddress") %>
<% If Not IsEmpty(rs("caddress2")) Then %>
<%
Response.Write (rs("caddress2"))
End If %>
<br>
<STRONG></STRONG> <%= rs("ctown") %><br>
<STRONG>State:</STRONG> <%= rs("cstate") %><br>
<STRONG>Zip:</STRONG> <%= rs("czip") %><br>
<STRONG>Country:</STRONG> <%= rs("ccountry") %>
</TD>
</TR>
</table>
<p><hr>
<TABLE border=1 cellPadding=4 cellSpacing=2 width=100%>
<TR>
<TD colspan=2 bgColor=darkblue><FONT color=white face="" style="BACKGROUND-COLOR: #00008b">
<STRONG>Shipping information (if different from customer information)</STRONG></FONT> </TD>
</TR>
<TR>
<TD>Name:</TD>
<TD>
<INPUT type="text" name=shipname></TD></TR>
<TR>
<TD>Address:</TD>
<TD>
<INPUT type="text" name=shipaddress></TD></TR>
<TR>
<TD>Town:</TD>
<TD>
<INPUT type="text"name="shiptown"></TD></TR>
<TR>
<TD>Zip code:</TD>
<TD>
<INPUT type="text" name="shipzip">
</TD></TR>
<TR>
<TD>State:</TD>
<TD>
<INPUT type="text" name=shipstate></TD></TR>
<TR>
<TD>Country:</TD>
<TD>
<INPUT name="shipcountry"></TD></TR>
<TR>
<TD colspan=2 bgColor=darkblue><FONT color=white face="" style="BACKGROUND-COLOR: #00008b">
<STRONG>Payment information</STRONG></FONT>
</TD>
</TR>
<TR>
<TD>Payment:</TD>
<TD><SELECT id=select1 name=paymentm>
<OPTION selected value=Visa>Visa
<OPTION value="American Express">American Express
<OPTION value=Mastercard>Mastercard
<OPTION value=dinersclub>Diner's Club</SELECT></TD></TR>
<TR>
<TD>Card name:</TD>
<TD>
<INPUT type=text name="cardname" value="<%= Session("cardname")%>"></TD></TR>
<TR>
<TD>Card no.:</TD>
<TD>
<INPUT type=text maxLength=16 name="cardno" value="<%= Session("cardno")%>"></TD></TR>
<TR>
<TD>Expiration date:</TD>
<TD>
<INPUT type="text" name=cardexpire maxLength=16 size=18 value="<%= Session("cardexpire")%>"> (mm/yy)</TD></TR>
<TR>
<TD>Card address:</TD>
<TD>
<INPUT type="text" name=cardaddress value="<%= Session("cardaddress")%>"></TD>
</TR>
<TR>
<TD>Shipment method:</TD>
<%
Dim rsship
Set rsship = Server.CreateObject ("ADODB.Recordset")
rsship.Open "shipmethods", dbc, adOpenForwardOnly,adLockReadOnly, adCmdTable
%>
<TD><SELECT name=shipment>
<% Do While Not rsship.EOF %>
<OPTION value="<%= rsship("shipmethodID") %>"><%= rsship("shipmethod") %>
<%
rsship.MoveNext
Loop
rsship.Close
%>
</SELECT>
</TD>
</TR>
<TR>
<TD> </TD>
<TD></TD>
</TR>
</TABLE>
<hr>
</P>
<TABLE border=0 cellPadding=3 cellSpacing=2 width=100%>
<TR bgColor=darkblue>
<TD><FONT color=white face=""
style="BACKGROUND-COLOR: #00008b">Product
code</FONT></TD>
<TD><FONT color=white face=""
style="BACKGROUND-COLOR: #00008b">Product name</FONT></TD>
<TD><FONT color=white face=""
style="BACKGROUND-COLOR: #00008b">Quantity</FONT></TD>
<TD><FONT color=white face="" style="BACKGROUND-COLOR: #00008b">Unit
Price</FONT></TD>
<TD><FONT color=white face=""
style="BACKGROUND-COLOR: #00008b">Total</FONT></TD></TR>
<%
Dim isubtotal, i, scartItem, arrCart
scartItem = Session("cartItem")
arrCart = Session("MyCart")
isubtotal = 0
For i = 1 to scartItem
%>
<TR bgColor=navajowhite>
<TD><INPUT name=selected<%= Cstr(i)%> type=checkbox value="yes" checked><%= arrCart(cProductCode,i) %></TD>
<TD><%= arrCart(cProductname,i) %></TD>
<TD><INPUT type="text" name=quantity<%= CStr(i) %> value="<%= arrCart(cQuantity,i) %>"></TD>
<TD><%= FormatCurrency(arrCart(cUnitPrice,i),2) %></TD>
<TD><%= FormatCurrency(arrCart(cUnitPrice,i) * arrCart(cQuantity,i),2) %></TD></TR>
<%
isubtotal = isubtotal + (arrCart(cUnitPrice,i) * arrCart(cQuantity,i))
Next
%>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
<TD bgColor=darkblue><FONT color=white face="" style="BACKGROUND-COLOR: #00008b">Total</FONT></TD>
<TD bgColor=lightgoldenrodyellow><%= FormatCurrency(isubtotal,2) %></TD></TR></TABLE></P>
<INPUT type="hidden" name="ordertotal" value="<%= isubtotal%>">
<P><INPUT name="action" type=submit value="Order now!">
<INPUT name=action type=submit value="Cancel order"> <br>
</P></FORM>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -