<%@ Language=VBScript %> <% '----------------------------------------------------------- ' HasDownloads ' ------------ ' Tells whether an order has downloadable items. '----------------------------------------------------------- Function HasDownloads(lngOrderID) Dim strSQL, rs strSQL = "SELECT COUNT(*) FROM tblOrdersItems toi INNER JOIN tblInventory tinv ON toi.ItemID = tinv.ItemID WHERE toi.OrderID "& CSQLEq(ELng(lngOrderID)) &" AND tinv.Downloadable <> 0" Set rs = OpenFastRS(strSQL) HasDownloads = (rs(0) > 0) rs.Close: Set rs = Nothing End Function Dim rsOrder, rsOrderItem, rsShip, curGrandTotal, curDiscGrandTotal, UPSYes, UPSTrack Dim strTrackNum, strCostPerUnit, strCost, curSaleDisc, curCostPerUnit, curCost Dim curCoupDisc, curPriceDisc, curTax, curSelShip, curFlatShip, curHandling Dim strShipping, strCCNum, strPayType, arShipping PilotInitialize LoadPageSettings "default" OrderID = ELng(Request("OrderID")) If IsEmpty(OrderID) Then Response.Redirect "pilot.asp?pg=gateway" Set rsOrder = GetOrderRS(OrderID) If Not HasRecords(rsOrder) Then Response.Redirect g.HomePageURL & "pilot.asp?pg=gateway" GetCurrentCustomer MarkCurrentCustomerActive If rsOrder("CustID") <> cid Then Response.Redirect g.HomePageURL & "pilot.asp?pg=gateway" Set rsOrderItem = GetOrderItemsRS(OrderID) curGrandTotal = CCur(rsOrder("LineItemCost") - ECur(rsOrder("PricingDiscount")) - ECur(rsOrder("CouponDiscount"))) curGrandTotal = CCur(curGrandTotal + ECur(rsOrder("Tax")) + ECur(rsOrder("SelShipCost")) + ECur(rsOrder("FlatRateShipCost")) + ECur(rsOrder("HandlingCost"))) curDiscGrandTotal = CCur(ECur(rsOrder("Tax")) + ECur(rsOrder("SelShipCost")) + ECur(rsOrder("FlatRateShipCost")) + ECur(rsOrder("HandlingCost"))) %> <%=g("company_name")%> - Order ID: <%=OrderID%> "> <% If g("Address1")&"X"="X" Then Address1 = "" Else Address1 = g("Address1") If g("Address2")&"X"="X" Then Address2 = "" Else Address2 = g("Address2")&"
" If g("City")&"X"="X" Then City = "" Else City = g("City") If g("State_Code")&"X"="X" Then State_Code = "" Else State_Code = g("State_Code") If g("Zip")&"X"="X" Then Zip = "" Else Zip = g("Zip") If g("Country_Code")&"X"="X" Then Country_Code = "" Else Country_Code = g("Country_Code")&"
" If g("Phone1")&"X"="X" Then Phone1 = "" Else Phone1 = "Phone: "&g("Phone1")&"
" If g("Fax")&"X"="X" Then Fax = "" Else Fax = "Fax: "&g("Fax")&"
" If g("Email1")&"X"="X" Then Email1 = "" Else Email1 = "Email: "&g("Email1")&"
" Response.Write "" Response.Write "
" Response.Write ""&g("company_name")&"
" Response.Write Address1&"
" Response.Write Address2 Response.Write City&", "&State_Code&" "&Zip&" "&Country_Code Response.Write Phone1 Response.Write Fax Response.Write Email1&"
" Response.Write "
THANK YOU FOR YOUR ORDER! " If HasDownloads(OrderID) And Not rsOrder("CCFailed") Then Response.Write "You will receive a ""Status Update"" email with your download link. Once you receive that email, you can either refresh this page (and the red download icon will appear by the SKU), or just go to our Gateway at that time, Login to your account, access your Order, and click on the red download icon from there. You must receive the Status Update (Ready for Download) email before the red download icon will appear by the SKU." End If Response.Write "Please SAVE and/or PRINT this page for your records.

" Response.Write "" Response.Write "
"&rsOrder("TheDate")&"ORDER ID: "&OrderID&"
" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" 'Bill-To Info Response.Write "" 'Ship-To Info Response.Write "" _ & "
BILL TO**SHIP TO
 "&rsOrder("BillFName")&" "&rsOrder("BillLName")&"
" strCompanyTitleLine = "" If Not IsNull(rsOrder("BillTitle")) Then strCompanyTitleLine = strCompanyTitleLine & " "&rsOrder("BillTitle")&"
" If Not IsNull(rsOrder("BillCompany")) Then strCompanyTitleLine = strCompanyTitleLine & " "&rsOrder("BillCompany")&"
" If strCompanyTitleLine&"x"<>"x" Then Response.Write strCompanyTitleLine Response.Write " "&rsOrder("BillAddr1") If Not IsNull(rsOrder("BillAddr2")) Then Response.Write "
 "&rsOrder("BillAddr2") Response.Write "
 "&rsOrder("BillCity") If Not IsNull(rsOrder("BillState")) Then Response.Write", "&rsOrder("BillState") Response.Write " "&rsOrder("BillZip")&" "&rsOrder("BillCountry")&"
 "&rsOrder("BillPhone")&"
 "&rsOrder("ShipFName")&" "&rsOrder("ShipLName")&"
" strCompanyTitleLine = "" If Not IsNull(rsOrder("ShipTitle")) Then strCompanyTitleLine = strCompanyTitleLine & " "&rsOrder("ShipTitle")&"
" If Not IsNull(rsOrder("ShipCompany")) Then strCompanyTitleLine = strCompanyTitleLine & " "&rsOrder("ShipCompany")&"
" If strCompanyTitleLine&"x"<>"x" Then Response.Write strCompanyTitleLine Response.Write " "&rsOrder("ShipAddr1") If Not IsNull(rsOrder("ShipAddr2")) Then Response.Write"
 "&rsOrder("ShipAddr2") Response.Write "
 "&rsOrder("ShipCity") If Not IsNull(rsOrder("ShipState")) Then Response.Write", "&rsOrder("ShipState") Response.Write " "&rsOrder("ShipZip")&" "&rsOrder("ShipCountry")&"
 "&rsOrder("ShipPhone")&"
**Special Addresses From Multiple Ship To Orders Might Be Listed Below  

" LinkCount = 0 totalWeight = 0 Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Do Until rsOrderItem.EOF If LinkCount Mod 2 = 0 Then bgColor = " bgcolor=""#"&clr2&"""" Else bgColor = "" Response.Write"" If rsOrderItem("Downloadable") And (rsOrderItem("Status") = "Ready for Download" Or rsOrderItem("Status") = "Shipped") Then Response.Write "" Else Response.Write "" End If Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" rsOrderItem.MoveNext LinkCount = LinkCount + 1 Loop rsOrderItem.Close: Set rsOrderItem = Nothing Response.Write "
SKUProductStatusCarrierTracking#PriceQtyTotal
" & rsOrderItem("SKU") & "" & rsOrderItem("SKU") & ""&Trim(rsOrderItem("ManufName"))&" "&Left(rsOrderItem("ITEMNAME"), 30) Response.Write "
" & rsOrderItem("ModDescription") Set rsInv = OpenUpdateableRS("SELECT * FROM tblInventory WHERE ItemID = " & rsOrderItem("ItemID")) if rsOrderItem("option_input1") <> "" then Response.Write "
" & rsInv("option_label1")& " " & rsOrderItem("option_input1") end if if rsOrderItem("option_input2") <> "" then Response.Write "
" & rsInv("option_label2")& " " & rsOrderItem("option_input2") end if if rsOrderItem("option_input3") <> "" then Response.Write "
" & rsInv("option_label3")& " " & rsOrderItem("option_input3") end if rsInv.Close:Set rsInv = Nothing 'Show the multiple ship to informaiton If rsOrderItem("ShipToID")>0 Then strVia = "" If rsOrderItem("ShippingService") <> "" Then strVia = "
via: "&rsOrderItem("ShippingService")&"
for: "&FormatGlobalCurrency(rsOrderItem("ShippingServiceCost")) Set rsAB = cnPILOT.Execute("SELECT NICKNAME FROM TBLADDRESSBOOK WHERE ID="&rsOrderItem("ShipToID")) NICKNAME = rsAB("NICKNAME") rsAB.Close : Set rsAB = Nothing End If Response.Write "
Ship To "&NICKNAME&strVia&"" End If If rsOrderItem("Carrier") = "UPS" Then UPSYes = True 'Show appropriate link for tracking based on carrier strTrackNum = EStr(rsOrderItem("TrackingNumber")) If Not IsEmpty(strTrackNum) Then Select Case rsOrderItem("Carrier") Case "UPS" UPSTrack = True strTrackNum = ""&strTrackNum&"" Case "Canada Post" strTrackNum = ""&strTrackNum&"" Case "U.S.P.S." strTrackNum = ""&strTrackNum&"" End Select End If curCostPerUnit = CCur(rsOrderItem("CostPerUnit") - ECur(rsOrderItem("PricingDiscount")) / rsOrderItem("Quantity")) strCostPerUnit = IIf(curCostPerUnit > 0, FormatGlobalCurrency(curCostPerUnit), "FREE") curSaleDisc = ECur(rsOrderItem("SaleDiscount")) If curSaleDisc > 0 Then strCostPerUnit = "" & strCostPerUnit & "
" & FormatGlobalCurrency(curCostPerUnit - (curSaleDisc / rsOrderItem("Quantity"))) End If curCost = CCur(curCostPerUnit * rsOrderItem("Quantity") - curSaleDisc) If rsorderItem("ShippingServiceCost") > 0 Then curCost = curCost + rsorderItem("ShippingServiceCost") strCost = IIf(curCost > 0, FormatGlobalCurrency(curCost), "FREE") curCoupDisc = ECur(rsOrderItem("CouponDiscount")) If curCoupDisc > 0 Then strCost = "Originally: " & strCost & "
" & FormatGlobalCurrency(rsOrderItem("Cost")) End If Response.Write "
"&rsOrderItem("Status")&""&IIf(IsNull(rsOrderItem("Carrier")), " ", rsOrderItem("Carrier"))&""&IIf(IsEmpty(strTrackNum), " ", strTrackNum)&""&strCostPerUnit&""&rsOrderItem("Quantity")&""&strCost&"
" curCoupDisc = ECur(rsOrder("CouponDiscount")) If curCoupDisc > 0 Then Response.Write "" curPriceDisc = ECur(rsOrder("PricingDiscount")) If curPriceDisc > 0 Then Response.Write "" Response.Write "" curTax = ECur(rsOrder("Tax")) Response.Write "" curFlatRate = ECur(rsOrder("FlatRateShipCost")) curEntireCartHandling =rsOrder("CartHandlingCost") If curFlatRate > 0 Then Response.Write "" curSelShip = ECur(rsOrder("SelShipCost")) strShipping = EStr(rsOrder("Shipping")) If Trim(strShipping&"X") <> "X" Then Response.Write"" Else Response.Write"Shipping:  "&shipMethod&" = FREE" End If End If curHandling = ECur(rsOrder("HandlingCost")) If curHandling > 0 Then Response.Write"" Response.Write "" Response.Write "
Coupon Discount:  (" & FormatGlobalCurrency(curCoupDisc) & ")
Pricing Discount:  (" & FormatGlobalCurrency(curPriceDisc) & ")
Sub-Total:  " & IIf((curPriceDisc + curCoupDisc) > rsOrder("LineItemCost"), "FREE", FormatGlobalCurrency(rsOrder("LineItemCost") - curCoupDisc - curPriceDisc)) & "
Tax:  "&FormatGlobalCurrency(curTax)&"
Flat Rate Shipping:  "&FormatGlobalCurrency(curFlatRate)&"
" If Left(strShipping, 3) = "UPS" Then UPSYes = True arShipping = Split(strShipping&":", ":") shipMethod = arShipping(0)&" "&arShipping(1) If curSelShip > 0 then Response.Write"Shipping:  "&shipMethod&" = "&FormatGlobalCurrency(curSelSHip)&"
Handling:  "&FormatGlobalCurrency(curHandling)&"
Grand Total:  "&IIf((curPriceDisc + curCoupDisc) > rsOrder("LineItemCost"), FormatGlobalCurrency(curDiscGrandTotal), FormatGlobalCurrency(curGrandTotal))&"

" Response.Write "" If g("CardProcessing") <> "payflowlink" Then strCCNum = EStr(rsOrder("CCNum")) strPayType = EStr(rsOrder("CardType")) Dim rsCCName, strPayTypeName Set rsCCName = OpenFastRs("SELECT Card FROM TBLCARDTYPES WHERE ABBREV = '"&strPayType&"'") strPayTypeName = rsCCName(0) rsCCName.Close : Set rsCCName = Nothing strPayName = EStr(rsOrder("NameOnCard")) strExpMonth = Right("00" & rsOrder("ExpireMonth"), 2) strExpYear = EStr(rsOrder("ExpireYear")) If LCase(Left(strCCNum, 4)) = "cash" Or LCase(Left(strCCNum, 5)) = "check" Then Response.Write "" Response.Write "" Else Response.Write "" Response.Write "" If Trim(strPayName&"X") <> "X" Then Response.Write "" Response.Write "" End If If Trim(strCCNum&"X") <> "X" Then If strPayType = "PO" then ' Start 05/13/03 added If stmt and for PO Response.Write "" Response.Write "" Else Response.Write "" Response.Write "" End If End If If Trim(strExpYear) <> "0" And Trim(strExpMonth) <> "00" Then Response.Write "" Response.Write "" Response.Write "" End If End If Else Response.Write "" End If 'Write out the multiple ship to sections if applicable Set rsOrderItem = GetOrderItemsRS(OrderID) Do Until rsOrderItem.EOF If rsOrderItem("ShipToID")>0 Then Set rsAB = cnPILOT.Execute("SELECT NICKNAME, CONTACTID FROM TBLADDRESSBOOK WHERE ID="&rsOrderItem("ShipToID")) NICKNAME = rsAB("NICKNAME") CONTACTID = rsAB("CONTACTID") Set rsCN = cnPILOT.Execute("SELECT * FROM TBLCONTACTS WHERE CONTACTID="&CONTACTID) rsAB.Close : Set rsAB = Nothing Response.Write "
PAYMENT INFO
Paying With: "&strCCNum&"
TYPE "&strPayTypeName&"
NAME ON CARD "&strPayName&"
PURCHASE ORDER NUMBER "&strCCNum&"
CARD NUMBER "&Left(strCCNum, 2)&"..."&Right(strCCNum, 4)&"
EXPIRES "&strExpMonth&"/"&strExpYear&"
Via Pay Flow Link On-line credit card processing service
" Response.Write "" Response.Write "
**Ship To Information For "&NICKNAME&"
 "&rsCN("FName")&" "&rsCN("LName") Response.Write "
 "&rsCN("Address1") If Trim(rsCN("Address2"))&"X" <> "X" Then Response.Write "
 "&rsCN("Address2") Response.Write "
 "&rscn("City") If Not IsNull(rsCN("State")) Then Response.Write", "&rsCN("State") Response.Write " "&rsCN("Zip")&" "&rsCN("Country")&"
 "&rsCN("Phone") Response.Write "

" rsCN.Close : Set rsCN = Nothing End If rsOrderItem.MoveNext Loop rsOrderItem.Close : Set rsOrderItem = Nothing Response.Write "" Response.Write "" If UPSTrack Then Response.Write "" Response.Write "" End If If UPSYes And Not UPSTrack Then Response.Write "" End If Response.Write "" Response.Write "" Response.Write "
This receipt constitutes agreement with the "&g("COMPANY_NAME") Response.Write " Returns and Refunds policies.
© Copyright 2003-"&Year(Date())&" ASPilot - All Rights Reserved Worldwide.
" Response.Write "
"&UPSTradeMark("")&""&UPSTrackingNotice&"
"&UPSTradeMarkNotice&"
" Response.Write "
"&UPSTradeMark("")&""&UPSTradeMarkNotice&"

« To continue shopping, please click here.

Click here to print this page.
" 'Conversion Ruler Code If g("CONVERSIONRULER_USE") Then strConversionRuler_SiteID = g("CONVERSIONRULER_SITEID") If LCase(Request.QueryString("cr")) = "yes" Then DisplayConversionRuler "order", lngGrandTotal End If End If 'End Conversion Ruler Code Response.Write "" %>