📄 thankyou.asp
字号:
return this.SC[0].length
}
function GetColumnTotal(colName){
// Generic column Total function
var colTotal = 0.0;
index = this.GetIndexOfColName(colName);
for (var i=0; i<this.SC[index].length; i++)
colTotal += parseFloat(this.SC[index][i]);
return colTotal
}
function DeleteLineItem(row){
assert(!isNaN(row), "Failure in call to DeleteLineItem - row is not a number");
assert(row>=0 && row <this.GetItemCount(), "failure in call to DeleteLineItem (internal error 121)");
var tmpSC= new Array(this.numCols);
var iDest = 0;
for (var iCol=0; iCol<this.numCols; iCol++) tmpSC[iCol] = new Array();
for (var iRow=0; iRow<this.GetItemCount(); iRow++) {
if (iRow != row) {
for (iCol=0; iCol<this.numCols; iCol++) {
tmpSC[iCol][iDest] = this.SC[iCol][iRow];
}
iDest++;
}
}
this.SC = tmpSC;
this.persist();
}
function UCGetColNamesSerial(colDelim) {
var serialCols = "";
for (var iCol=0; iCol<this.numCols; iCol++) {
if (iCol != 0) serialCols += colDelim;
serialCols += this.colNames[iCol];
}
return serialCols;
}
function UCGetContentsSerial(colDelim, rowDelim) {
var serialCart = "";
for (var iRow=0; iRow<this.GetItemCount(); iRow++) {
if (iRow != 0) serialCart += rowDelim
for (var iCol=0; iCol<this.numCols; iCol++) {
if (iCol != 0) serialCart += colDelim;
serialCart += this.SC[iCol][iRow];
}
}
return serialCart;
}
function UCSetContentsSerial(serialCart, colDelim, rowDelim) {
var Rows = String(serialCart).split(rowDelim)
for (iRow = 0; iRow < Rows.length; iRow++) {
if (Rows[iRow] != "undefined" && Rows[iRow] != "") {
Cols = Rows[iRow].split(colDelim)
iCol = 0
for (iCol = 0; iCol<Cols.length; iCol++) {
this.SC[iCol][iRow] = Cols[iCol]
}
}
}
this.persist();
}
function SetCookie(){
var cookieName = this.GetCookieName()
var cookieStr = this.GetContentsSerial(this.cookieColDel, this.cookieRowDel)
var cookieExp = GetCookieExp(this.cookieLifetime)
Response.Cookies(cookieName) = cookieStr
Response.Cookies(cookieName).expires = cookieExp
}
function GetCookieName(){
var server = Request.ServerVariables("SERVER_NAME");
return server + this.Name;
}
function UCDestroyCookie(){
cookieName = this.GetCookieName();
Response.Cookies(cookieName) = ""
Response.Cookies(cookieName).expires = "1/1/90"
}
function PopulateFromCookie(cookieStr){
this.SetContentsSerial(cookieStr, this.cookieColDel, this.cookieRowDel)
}
// ***************** debug code ********************
function assert(bool, msg) {
if (!bool) {
Response.Write("<BR><BR>An error occured in the UltraDev shopping cart:<BR>" + msg + "<BR>");
//Response.End();
}
}
function AssertCartValid(colNames, msg) {
// go through all cart data structures and insure consistency.
// For example all column arrays should be the same length.
// this function should be called often, especially just after
// makeing changes to the data structures (adding, deleting, etc.)
// also verify we always have the required columns:
// ProductID, Quantity, Price, Total
// the input arg is some I add as I code this package like
// "Prior to return from AddToCart"
//
var ERR_COOKIE_SETTINGS = "Cookie settings on this page are inconsistent with those stored in the session cart<BR>";
var ERR_BAD_NAME = "Cart name defined on this page is inconsistent with the cart name stored in the session<BR>";
var ERR_COLUMN_COUNT = "The number of cart columns defined on this page is inconsistent with the cart stored in the session<BR>";
var ERR_REQUIRED_COLUMNS = "Too few columns; minimum number of columns is 4<BR>";
var ERR_REQUIRED_COLUMN_NAME = "Required Column is missing or at the wrong offset: ";
var ERR_COLUMN_NAMES = "Cart column names defined on this page are inconsistent with the cart stored in the session";
var ERR_INCONSISTENT_ARRAY_LENGTH = "Length of the arrays passed to cart constructor are inconsistent<BR>"
var errMsg = "";
var sessCart = Session(this.Name);
if (sessCart != null) { // Validate inputs against session cart if it exists
if (sessCart.Name != this.Name) errMsg += ERR_BAD_NAME;
if (this.numCols < 4) errMsg += ERR_REQUIRED_COLUMNS;
if (sessCart.numCols != this.numCols) errMsg += "Column Name Array: " + ERR_COLUMN_COUNT;
if (sessCart.numCols != this.colComputed.length) errMsg += "Computed Column Array: " + ERR_COLUMN_COUNT;
if (sessCart.bStoreCookie != this.bStoreCookie) errMsg += "Using Cookies: " + ERR_COOKIE_SETTINGS;
if (sessCart.cookieLifetime != this.cookieLifetime) errMsg += "Cookie Lifetime: " + ERR_COOKIE_SETTINGS;
// check that required columns are in the same place
var productIndex = this.GetIndexOfColName(this.PRODUCTID);
var quantityIndex = this.GetIndexOfColName(this.QUANTITY);
var priceIndex = this.GetIndexOfColName(this.PRICE);
var totalIndex = this.GetIndexOfColName(this.TOTAL);
if (colNames[productIndex] != "ProductID") errMsg += ERR_REQUIRED_COLUMN_NAME + "ProductID<BR>";
if (colNames[quantityIndex] != "Quantity") errMsg += ERR_REQUIRED_COLUMN_NAME + "Quantity<BR>";
if (colNames[priceIndex] != "Price") errMsg += ERR_REQUIRED_COLUMN_NAME + "Price<BR>";
if (colNames[totalIndex] != "Total") errMsg += ERR_REQUIRED_COLUMN_NAME + "Total<BR>";
}
else { // if cart doesn't exist in session, validate input array lengths and presence of reqiured columns
if (this.numCols != this.colComputed.length) errMsg += ERR_INCONSISTENT_ARRAY_LENGTH;
var bProductID = false, bQuantity = false, bPrice = false, bTotal = false;
for (var j = 0; j < colNames.length; j++) {
if (colNames[j] == "ProductID") bProductID = true;
if (colNames[j] == "Quantity") bQuantity= true;
if (colNames[j] == "Price") bPrice = true;
if (colNames[j] == "Total") bTotal = true;
}
if (!bProductID) errMsg += ERR_REQUIRED_COLUMN_NAME + "ProductID<BR>";
if (!bQuantity) errMsg += ERR_REQUIRED_COLUMN_NAME + "Quantity<BR>";
if (!bPrice) errMsg += ERR_REQUIRED_COLUMN_NAME + "Price<BR>";
if (!bTotal) errMsg += ERR_REQUIRED_COLUMN_NAME + "Total<BR>";
}
if (errMsg != "") {
Response.Write(msg + "<BR>");
Response.Write(errMsg + "<BR>");
Response.End();
}
}
function VBConstuctCart(Name, cookieLifetime, vbArrColNames, vbArrColComputed){
var myObj;
var a = new VBArray(vbArrColNames);
var b = new VBArray(vbArrColComputed);
eval("myObj = new UC_ShoppingCart(Name, cookieLifetime, a.toArray(), b.toArray())");
return myObj;
}
</SCRIPT>
<SCRIPT LANGUAGE=vbscript runat=server NAME="UC_CART">
Function GetCookieExp(expDays)
vDate = DateAdd("d", CInt(expDays), Now())
GetCookieExp = CStr(vDate)
End Function
</SCRIPT>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT NAME="UC_CART">
function DoNumber(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
DoNumber = FormatNumber(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
End Function
function DoCurrency(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
DoCurrency = FormatCurrency(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
End Function
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
function DoPercent(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
DoPercent = FormatPercent(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)
End Function
function DoTrim(str, side)
dim strRet
strRet = str
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
%>
<%
'
'Update Stock and Sell for each ProductID in the cart
'
set UpdateStock = Server.CreateObject("ADODB.Command")
UpdateStock.ActiveConnection = MM_conn_STRING
For UCCart1__i=0 To UCCart1.GetItemCount()-1
if (UCCart1.GetColumnValue("ProductID",UCCart1__i)) <> "" then
UpdateStock.CommandText = "UPDATE Product SET Stock = Stock - " &(UCCart1.GetColumnValue("Quantity",UCCart1__i))& " ,Sell = Sell + " &(UCCart1.GetColumnValue("Quantity",UCCart1__i))& " WHERE ProductID = '" & (UCCart1.GetColumnValue("ProductID",UCCart1__i))& "'"
UpdateStock.CommandType = 1
UpdateStock.CommandTimeout = 0
UpdateStock.Prepared = true
UpdateStock.Execute()
end if
next
UpdateStock.ActiveConnection.Close
%>
<%
Dim pay__MMColParam
pay__MMColParam = "1"
if (Session("mm_username") <> "") then pay__MMColParam = Session("mm_username")
%>
<%
set pay = Server.CreateObject("ADODB.Recordset")
pay.ActiveConnection = MM_conn_STRING
pay.Source = "SELECT * FROM orders inner join shipping on orders.shippingid=shipping.shippingid WHERE user = '" + Replace(pay__MMColParam, "'", "''") + "' ORDER BY autonumberid DESC"
pay.CursorType = 0
pay.CursorLocation = 2
pay.LockType = 3
pay.Open()
pay_numRows = 0
%>
<%
' *** 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
%>
<html>
<head>
<title>定单号</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="2" >
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" class="bk">
<tr>
<td>
<div align="center">
<p> </p>
<p><b>感谢您的惠顾!</b></p>
<p><b>您的定单号为<font color="#FF0000"><%= Session("OrderID") %></font>,请牢记以供查询。</b></p>
<table width="569" border="0" cellspacing="2" cellpadding="0" align="center" class="bk" bordercolor="#000000">
<tr bgcolor="#99CC00">
<td colspan="2" height="13"><b><font color="#FF0000"></font><font color="#000000">以下是您购买的商品:</font></b></td>
</tr>
<% For UCCart1__i=0 To UCCart1.GetItemCount()-1 %>
<tr>
<td width="383" height="4">商品名称:<%=(UCCart1.GetColumnValue("productName",UCCart1__i))%></td>
<td height="4" width="330">商品编号:<%=(UCCart1.GetColumnValue("ProductID",UCCart1__i))%></td>
</tr>
<tr>
<td width="383" height="1"> 单价:<%=(UCCart1.GetColumnValue("Price",UCCart1__i))%>元</td>
<td height="1" width="330">重量: <%=(UCCart1.GetColumnValue("weight",UCCart1__i))%></td>
</tr>
<tr>
<td width="383" height="0">数量:<%=(UCCart1.GetColumnValue("Quantity",UCCart1__i))%></td>
<td height="0" width="330">费用:<%=(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 合计费用:<font color="#FF0000"><%=(UCCart1.GetColumnTotal("Total"))%>元+<%=(pay.Fields.Item("shipprice").Value)%>元(<%=(pay.Fields.Item("shipname").Value)%>)</font></b></td>
</tr>
</table>
<br>
<% If (pay.Fields.Item("paymethodid").Value) = (2) Then 'script %>
<table width="569" border="0" cellspacing="0" cellpadding="0" class="bk">
<tr>
<td height="118">支付方式:银行电汇 <br>
<br>
汇款账户信息如下:<br>
户 名:蔡懿<br>
开户行:工商银行柳州分行<br>
帐 号:0123 4567 8901 4343(请您在办理电汇时,在您的电汇单“事由”一栏处注明您的会员名和订单号)<br>
您选用了“银行电汇”支付方式支付您的商品货款,需要二至七个工作日才能确认到款,<br>
我们会在款到后立即通知厂商发货。如果十个工作日后未仍未到,<br>
系统将自动取消您所下的订单,请您到本站"<a href="orderxx.asp">查询定单</a>”里及时查看您的订单信息。多谢!<br>
</td>
</tr>
</table>
<% End If ' end If (pay.Fields.Item("paymethodid").Value) = (2) script %>
<% If (pay.Fields.Item("paymethodid").Value) = (4) Then 'script %>
<table width="563" border="0" cellspacing="0" cellpadding="0" height="43" class="bk">
<tr>
<td height="72">支付方式:邮局汇款<br>
<br>
款项邮汇至: <br>
[广西机电职业技术学院 69# 蔡懿(收)[邮编]:530007<br>
请将订单号、会员名或其它要求填写在汇款简短留言中</td>
</tr>
</table>
<% End If ' end If (pay.Fields.Item("paymethodid").Value) = (4) script %>
<p><b><a href="default.asp">返回首页</a></b></p>
<p> </p>
</div>
</td>
</tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>
<%
pay.Close()
%>
<%
UCCart1.Destroy()
%>
<% Session.Abandon %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -