📄 order.asp
字号:
If (side = "left") Then
strRet = LTrim(str)
ElseIf (side = "right") Then
strRet = RTrim(str)
Else
strRet = Trim(str)
End If
DoTrim = strRet
End Function
</SCRIPT>
<%
UC_CartColNames=Array("ProductID","Quantity","productName","Price","totalweight","weight","Total")
UC_ComputedCols=Array("","","","","weight","","Price")
set UCCart1=VBConstuctCart("UCCart",2,UC_CartColNames,UC_ComputedCols)
UCCart1__i=0
%>
<%
set paymethod = Server.CreateObject("ADODB.Recordset")
paymethod.ActiveConnection = MM_conn_STRING
paymethod.Source = "SELECT * FROM paymethod"
paymethod.CursorType = 0
paymethod.CursorLocation = 2
paymethod.LockType = 3
paymethod.Open()
paymethod_numRows = 0
%>
<%
set shopping = Server.CreateObject("ADODB.Recordset")
shopping.ActiveConnection = MM_conn_STRING
shopping.Source = "SELECT * FROM shipping"
shopping.CursorType = 0
shopping.CursorLocation = 2
shopping.LockType = 3
shopping.Open()
shopping_numRows = 0
%>
<%
Dim user__MMColParam
user__MMColParam = "1"
if (Session("mm_username") <> "") then user__MMColParam = Session("mm_username")
%>
<%
set user = Server.CreateObject("ADODB.Recordset")
user.ActiveConnection = MM_conn_STRING
user.Source = "SELECT * FROM user WHERE user = '" + Replace(user__MMColParam, "'", "''") + "'"
user.CursorType = 0
user.CursorLocation = 2
user.LockType = 3
user.Open()
user_numRows = 0
%>
<%
Dim HLooper1__numRows
HLooper1__numRows = 7
Dim HLooper1__index
HLooper1__index = 0
bclass_numRows = bclass_numRows + HLooper1__numRows
%>
<%
If InStr(1, MM_editAction, "?", vbTextCompare) = 0 Then
MM_editAction = MM_editAction + "?UC_SaveCartToTable=1"
Else
MM_editAction = MM_editAction + "&UC_SaveCartToTable=1"
End If
If (CStr(Request("UC_SaveCartToTable")) = "1") Then
set UC_connCart = Server.CreateObject("ADODB.Connection")
UC_connCart.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.Mappath("db1.mdb")
UC_redirectPage = "thankyou.asp"
UC_destColName = Array("productid","quantity","productname","price","","weight","totalprice")
UC_destColType = Array("str","num","str","str","str","num","num")
UC_orderId = Session("orderid")
UCCart1.SaveToDatabase UC_connCart,"orderdetails","orderid","num",UC_orderId,UC_destColName,UC_destColType
' redirect with URL parameters (remove the "UC_SaveCartToTable" query param).
if (UC_redirectPage = "") Then UC_redirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
newQS = "?"
For Each Item In Request.QueryString
If (Item <> "UC_SaveCartToTable") Then
If (Len(newQS) > 1) Then newQS = newQS & "&"
newQS = newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(newQS) > 1) Then UC_redirectPage = UC_redirectPage & newQS
End If
Response.Redirect(UC_redirectPage)
End If
%>
<% If UCCart1.GetItemCount() <= 0 Then Response.Redirect("cartempty.asp") %>
<%
Dim Repeat2__numRows
Repeat2__numRows = 10
Dim Repeat2__index
Repeat2__index = 0
tuijian_numRows = tuijian_numRows + Repeat2__numRows
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
hot_numRows = hot_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
Dim Repeat3__numRows
Repeat3__numRows = 7
Dim Repeat3__index
Repeat3__index = 0
news_numRows = news_numRows + Repeat3__numRows
%>
<%
Dim HLooper3__numRows
HLooper3__numRows = 4
Dim HLooper3__index
HLooper3__index = 0
dazhe_numRows = dazhe_numRows + HLooper3__numRows
%>
<%
Dim HLooper2__numRows
HLooper2__numRows = 2
Dim HLooper2__index
HLooper2__index = 0
newproduct_numRows = newproduct_numRows + HLooper2__numRows
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>
<html>
<head>
<title>收银台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
<script language="JavaScript">
<!--
function checkdata() {
if (document.registerForm.username.value=="") {
window.alert ("请输入您的真实姓名 !")
return false
}
if (document.registerForm.city.value=="") {
window.alert ("请选择您所在城市 !")
return false
}
if (document.registerForm.address.value=="") {
window.alert ("请输入您的详细地址 !")
return false
}
if (document.registerForm.snumber.value=="") {
window.alert ("请输入身份证号码 !")
return false
}
if (document.registerForm.zip.value=="") {
window.alert ("请输入您的邮编 !")
return false
}
if (document.registerForm.phone.value=="") {
window.alert ("请输入您的电话 !")
return false
}
return true
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="2" marginwidth="0" marginheight="0">
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" height="258" class="bk1">
<tr>
<td valign="top" height="267" width="165">
<p> </p>
<table width="143" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><a href="loginok.asp"><img src="images/myziliao.gif" width="165" height="53" border="0"></a></td>
</tr>
<tr>
<td height="23"><a href="myorder.asp"><img src="images/myorder.gif" width="165" height="53" border="0"></a></td>
</tr>
<tr>
<td height="2"><a href="mycart.asp"><img src="images/myCART.gif" width="165" height="53" border="0"></a></td>
</tr>
<tr>
<td height="43"><a href="order.asp"><img src="images/gosyt.gif" width="165" height="53" border="0"></a></td>
</tr>
<tr>
<td height="38"><a href="default.asp"><img src="images/maidx.gif" width="165" height="53" border="0"></a></td>
</tr>
<tr>
<td><a href="<%=MM_Logout%>"><img border=0 src="images/loginout.gif" width="165" height="53"></a></td>
</tr>
</table>
</td>
<td valign="top" height="267" width="631">
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="registerForm" onSubmit="return checkdata()">
<table width="568" border="0" cellspacing="2" cellpadding="0" align="center" class="dfont" bordercolor="#000000">
<tr bgcolor="#99CC00">
<td colspan="2" height="13"><b><font color="#FF0000"><%=(user.Fields.Item("user").Value)%></font><font color="#000000">以下是您购买的商品:</font></b></td>
</tr>
<% For UCCart1__i=0 To UCCart1.GetItemCount()-1 %>
<tr>
<td width="295" height="4">商品名称:<%=(UCCart1.GetColumnValue("productName",UCCart1__i))%></td>
<td height="4" width="255">商品编号:<%=(UCCart1.GetColumnValue("ProductID",UCCart1__i))%></td>
</tr>
<tr>
<td width="295" height="1"> 单价:<%=(UCCart1.GetColumnValue("Price",UCCart1__i))%>元</td>
<td height="1" width="255">重量: <%=(UCCart1.GetColumnValue("weight",UCCart1__i))%></td>
</tr>
<tr>
<td width="295" height="0">数量:<%=(UCCart1.GetColumnValue("Quantity",UCCart1__i))%></td>
<td height="0" width="255">费用:<%=(UCCart1.GetColumnValue("Total",UCCart1__i))%>元</td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="2"></td>
</tr>
<% Next 'UCCart1__i %>
<tr>
<td colspan="2" height="10"> <b>您一个购买了<%=(UCCart1.GetColumnTotal("Quantity"))%>个商品,总重量为<%=(UCCart1.GetColumnTotal("totalweight"))%>KG合计费用:<%=(UCCart1.GetColumnTotal("Total"))%>元</b></td>
</tr>
</table>
<br>
<table width="568" border="0" cellspacing="2" cellpadding="0" align="center" class="dfont">
<tr bgcolor="#99CC00">
<td colspan="2"><b>请认真填写以下信息:</b></td>
</tr>
<tr>
<td height="11" width="258">收货人姓名:
<input type="text" name="username" value="<%=(user.Fields.Item("username").Value)%>">
</td>
<td height="11" width="380">所在城市:
<input type="text" name="city" value="<%=(user.Fields.Item("city").Value)%>">
</td>
</tr>
<tr>
<td height="13" width="258">收货人电话:
<input type="text" name="phone" value="<%=(user.Fields.Item("phone").Value)%>">
</td>
<td height="13" width="380">邮政编码:
<input type="text" name="zip" value="<%=(user.Fields.Item("zip").Value)%>">
</td>
</tr>
<tr>
<td height="7" width="258">身份证号码:
<input type="text" name="snumber" value="<%=(user.Fields.Item("snumber").Value)%>">
</td>
<td height="7" width="380"> </td>
</tr>
<tr>
<td height="5" colspan="2">收货人地址: </td>
</tr>
<tr>
<td height="5" colspan="2">
<textarea name="address" cols="40" rows="4"><%=(user.Fields.Item("address").Value)%></textarea>
</td>
</tr>
<tr>
<td height="6" colspan="2">付款方式:
<select name="select">
<%
While (NOT paymethod.EOF)
%>
<option value="<%=(paymethod.Fields.Item("paymethodid").Value)%>" ><%=(paymethod.Fields.Item("paymethodname").Value)%></option>
<%
paymethod.MoveNext()
Wend
If (paymethod.CursorType > 0) Then
paymethod.MoveFirst
Else
paymethod.Requery
End If
%>
</select>
送货方式:
<select name="select2">
<%
While (NOT shopping.EOF)
%>
<option value="<%=(shopping.Fields.Item("shippingid").Value)%>" ><%=(shopping.Fields.Item("shipname").Value)%></option>
<%
shopping.MoveNext()
Wend
If (shopping.CursorType > 0) Then
shopping.MoveFirst
Else
shopping.Requery
End If
%>
</select>
</td>
</tr>
<tr>
<td height="53" colspan="2">
<div align="center">
<input type="hidden" name="user" value="<%=(user.Fields.Item("user").Value)%>">
<input type="hidden" name="orderid" value="<%= Session("orderid") %>">
<input type="submit" name="Submit" value="提交">
</div>
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="true">
</form>
</td>
</tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>
<%
paymethod.Close()
%>
<%
shopping.Close()
%>
<%
user.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -