%@ 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"))) %>
| 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. |
| "&rsOrder("TheDate")&" | ORDER ID: "&OrderID&" |
| BILL TO | " Response.Write "**SHIP TO | " Response.Write "
| "&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")&" | "
'Ship-To Info
Response.Write " "&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 | |
| SKU | " Response.Write "Product | " Response.Write "Status | " Response.Write "Carrier | " Response.Write "Tracking# | " Response.Write "Price | " Response.Write "Qty | " Response.Write "Total | |
| " & rsOrderItem("SKU") & " | " End If Response.Write ""&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 = " " & 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")&" | " Response.Write ""&IIf(IsNull(rsOrderItem("Carrier")), " ", rsOrderItem("Carrier"))&" | " Response.Write ""&IIf(IsEmpty(strTrackNum), " ", strTrackNum)&" | " Response.Write ""&strCostPerUnit&" | " Response.Write ""&rsOrderItem("Quantity")&" | " Response.Write ""&strCost&" | " 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 "
| PAYMENT INFO | ||
| Paying With: | " Response.Write ""&strCCNum&" | |
| TYPE | " Response.Write ""&strPayTypeName&" | |
| NAME ON CARD | " Response.Write ""&strPayName&" | |
| PURCHASE ORDER NUMBER | " Response.Write ""&strCCNum&" | |
| CARD NUMBER | " Response.Write ""&Left(strCCNum, 2)&"..."&Right(strCCNum, 4)&" | |
| EXPIRES | " Response.Write ""&strExpMonth&"/"&strExpYear&" | " Response.Write "|
| Via Pay Flow Link On-line credit card processing service | ||
| **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 " |
| This receipt constitutes agreement with the "&g("COMPANY_NAME")
Response.Write " Returns and Refunds policies. © Copyright 2003-"&Year(Date())&" ASPilot - All Rights Reserved Worldwide. | ||||
| ||||
| "&UPSTradeMarkNotice&" | ||||
| ||||
« To continue shopping, please click here. | "
Response.Write "Click here to print this page. | |||