<% ' Declare all global variables here dim vDateNow ' Today's date dim vProductID ' Current Promotion ID dim vCartItemRS ' Recordset for the Promotion descriptions dim vAttributeRS ' Recordset for the Promotion Graphics and descriptions dim vFeatureRS ' Recordset for the Promotion Qty Category and Prices dim vGraphicRS ' Product ID of the current product being displayed dim vItemPriceRS ' price of the item dim vDisplaySide ' Which side of table to display Graphic on dim vRunMode ' Test or production dim vItemSets() ' Array for managing totals entered by the client dim vTotSub dim vMessageProducts dim vResult vDisplaySide = 0 ' Initialize to 0 - 0 (left side) 1 (right side) vRunMode = "Test" %> <% ' Get the current customers ID. If it is not found then create one. vCookieCustomerID = Request.Cookies("TBDStore")("CustomerID") ' ' Get the path for the root directory for the site and connect to ' the database. ' vResult = Server.MapPath("/") response.write("") Set Conn = Server.CreateObject("ADODB.Connection") vResult = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & vResult & "\Database\db1.mdb" Conn.Open vResult if (request("Update") = "upd") then vResult = fUpdateCart() end if %> Personal Elegance - Personalized Cards and Stationery
 
<% vResult = fGetCartItems() if not(vCookieCustomerID >" ") or (vCartItemRS.EOF and vCartItemRS.BOF) then %> You have not selected any items to order.

browse our catalog
<% response.end end if %>

If you wish to make changes to your order, use your back button and re-enter your order.

<% vResult = fGetCartItems() vGroupSub = 0 vTotalCost = 0 vUnitPrice = 0 vEnvPrice = 0 vMessageProducts = "" vMessageProductsDisp = "" do until vCartItemRS.EOF vGroupSub = vGroupSub + 1 vUnitPrice = 0 vEnvPrice = 0 vResult = fGetGraphic(vCartItemRS("ProductID")) %> <% vCartItemRS.MoveNext loop %>
<% if (vGraphicRS.EOF and vGraphicRS.BOF) Then Response.Write("No Graphic Available") else %> " border="0" alt="<%= vCartItemRS("ProductID") %>" VSPACE="5">     <% End If %>
" type="text" onBlur="fCheckQuantity(this)">    
Enter 0 (zero)
to delete this selection "> ">
<% ' calculate the cost of the item vResult = fGetItemsPrice(vCartItemRS("ProductID")) if (vItemPriceRS.eof and vItemPriceRS.bof) then vUnitPrice = (vCartItemRS("OrderQty") * 3) else If vCartItemRS("OrderQty") = vItemPriceRS("RegQuantity") then vTotalCost = vTotalCost + vItemPriceRS("CardPrice") vUnitPrice = vItemPriceRS("CardPrice") If vCartItemRS("EnvelopesWanted") = "Yes" then vTotalCost = vTotalCost + vItemPriceRS("EnvelopePrice") vEnvPrice = vEnvPrice + vItemPriceRS("EnvelopePrice") End If Else 'response.write("t1-" & vTotalCost) vTotalCost = vTotalCost + vItemPriceRS("CardPrice") + (vItemPriceRS("AdditionalPrice") * ((vCartItemRS("OrderQty") - vItemPriceRS("RegQuantity"))/vItemPriceRS("AdditionalQuantity"))) vUnitPrice = vItemPriceRS("CardPrice") + (vItemPriceRS("AdditionalPrice") * ((vCartItemRS("OrderQty") - vItemPriceRS("RegQuantity")))/vItemPriceRS("AdditionalQuantity")) If vCartItemRS("EnvelopesWanted") = "Yes" then 'response.write("t2-" & vTotalCost) vTotalCost = vTotalCost + vItemPriceRS("EnvelopePrice") + (vItemPriceRS("AdditionalEnv") * ((vCartItemRS("OrderQty") - vItemPriceRS("RegQuantity"))/vItemPriceRS("AdditionalQuantity"))) vEnvPrice = vEnvPrice + vItemPriceRS("EnvelopePrice") + (vItemPriceRS("AdditionalEnv") * ((vCartItemRS("OrderQty") - vItemPriceRS("RegQuantity"))/vItemPriceRS("AdditionalQuantity"))) End If End if end if %> <% vInsideName = vCartItemRS("CardInsideName")%> "> "> "> "> "> "> "> "> "> "> "> <% if vCartItemRS("PartID") > 0 then vcheck = vCartItemRS("ProductNameShort") & " (" & vCartItemRS("ProductDescription") & ")" if instr(vcheck, "&") then response.write("here") end if %> "> <% Else %> "> <% End If ' vTotalCost = vTotalCost + (vCartItemRS("UnitPrice") * vCartItemRS("OrderQty")) vMessageProducts = "" vMessageProducts = vMessageProducts & "Item " & vGroupSub & " is as follows" & vbCRLF vMessageProducts = vMessageProducts & "ProductID" & " = " & vCartItemRS("ProductID") & vbCRLF vMessageProducts = vMessageProducts & "DesiredVerseColor" & " = " & vCartItemRS("DesiredVerseColor") & vbCRLF vMessageProducts = vMessageProducts & "qty" & " = " & vCartItemRS("OrderQty") & vbCRLF vMessageProducts = vMessageProducts & "Costs" & " = " & vbCRLF vMessageProducts = vMessageProducts & " Card Price" & " = " & CheckDicimal(vUnitPrice) & vbCRLF vMessageProducts = vMessageProducts & " Envelope Price" & " = " & CheckDicimal(vEnvPrice) & vbCRLF if vCartItemRS("ProofWanted") = "ProofWanted" then vMessageProducts = vMessageProducts & " Proof wanted" & " = 15.00" & vbCRLF else vMessageProducts = vMessageProducts & " No Proof wanted" & " = 0.00" & vbCRLF end if ' vMessageProducts = vMessageProducts & " TotCost" & vGroupSub & " = " & CheckDicimal(vUnitPrice) & vbCRLF vMessageProducts = vMessageProducts & "Verse Alignment" & " = " & vCartItemRS("VerseAlignment") & vbCRLF vMessageProducts = vMessageProducts & "Card Personalization" & " = " & vbCRLF vMessageProducts = vMessageProducts & vInsideName & vbCRLF vMessageProducts = vMessageProducts & "EnvelopesWanted" & " = " & vCartItemRS("EnvelopesWanted") & vbCRLF if vCartItemRS("EnvelopesWanted") <> "No" then vMessageProducts = vMessageProducts & "Envelopes Address Placement" & " = " & vCartItemRS("EnvAddressPlc") & vbCRLF vMessageProducts = vMessageProducts & "Envelope Address" & " = " & vbCRLF vMessageProducts = vMessageProducts & " EnvLine01" & " = " & vCartItemRS("EnvLine01") & vbCRLF vMessageProducts = vMessageProducts & " EnvLine02" & " = " & vCartItemRS("EnvLine02") & vbCRLF vMessageProducts = vMessageProducts & " EnvLine03" & " = " & vCartItemRS("EnvLine03") & vbCRLF vMessageProducts = vMessageProducts & " EnvLine04" & " = " & vCartItemRS("EnvLine04") & vbCRLF ' vMessageProducts = vMessageProducts & "EnvLine05" & vGroupSub & " = " & vCartItemRS("EnvLine05") & vbCRLF ' vMessageProducts = vMessageProducts & "EnvLine06" & vGroupSub & " = " & vCartItemRS("EnvLine06") & vbCRLF end if vMessageProducts = vMessageProducts & vbCRLF vMessageProductsDisp = vMessageProductsDisp & vMessageProducts %> <%=vCartItemRS("CardInsideName")%>
<%= vMessageProducts %>

Your Contact Address

Boxes with a * must be filled in.
No PO Box addresses, please. Shipping must be to a street address.

Dept./FCS Code:
First Name:*
Last Name:*
Company:
Address Line #1:*
Address Line #2:
City:*
State:*
Zip Code:*
Country:*
Phone:*
Fax:
E-mail address:*


Payment Method We will contact you for you payment information.

Note: Freight & Applicable Sales Tax will be added to your invoice. All orders will be billed individually.

You may pay by credit card. We accept:


MasterCard,
VISA,
American Express,
Discover


Comments / Feedback:








©2001 - 2003 PersonalElegance.com, All Rights Reserved 

PDR Consulting <% 'All functions called by this page are to reside in this area (at the end of the pages). ' 'This function will update the items in the shopping cart 'Check to make sure item exists prior to updating it function fUpdateCart() dim vCheckCartRS SQL = " SELECT ProductID " SQL = SQL & " FROM tblShoppingCart " SQL = SQL & " WHERE (CustomerID='" & vCookieCustomerID & "') " SQL = SQL & " AND (ProductID='" & request("ProductID") & "') " SQL = SQL & " AND (PersonalizationID= " & request("PersonalizationID") & " ) " SQL = SQL & " ; " response.write("") Set vCheckCartRS = Conn.Execute(SQL) if (vCheckCartRS.EOF and vCheckCartRS.BOF) then fUpdateCart = "Not" else if request("qty") > 0 then SQL = " UPDATE tblShoppingCart SET " SQL = SQL & " OrderQty = " & request("qty") & " " SQL = SQL & " WHERE (CustomerID='" & vCookieCustomerID & "') " SQL = SQL & " AND (ProductID='" & request("ProductID") & "') " SQL = SQL & " AND (PersonalizationID= " & request("PersonalizationID") & " ) " SQL = SQL & " ; " else SQL = " DELETE * " SQL = SQL & " FROM tblShoppingCart " SQL = SQL & " WHERE (CustomerID='" & vCookieCustomerID & "') " SQL = SQL & " AND (ProductID='" & request("ProductID") & "') " SQL = SQL & " AND (PersonalizationID= " & request("PersonalizationID") & " ) " SQL = SQL & " ; " end if response.write("") Conn.Execute(SQL) fUpdateCart = "Updated" end if end function ' 'This function will retrieve the items in the shopping cart ' function fGetCartItems() SQL = " SELECT tblShoppingCart.ProductID, " SQL = SQL & " 0 as PartID, " SQL = SQL & " tblPersonalization.CardInsideName, " SQL = SQL & " tblShoppingCart.OrderQty, " SQL = SQL & " tblPersonalization.PersonalizationID, " SQL = SQL & " tblPersonalization.PrintedEnvelopes as EnvelopesWanted, " SQL = SQL & " tblPersonalization.EnvAddressPlc, " SQL = SQL & " tblPersonalization.ProofWanted, " SQL = SQL & " tblPersonalization.DesiredVerseColor, " SQL = SQL & " tblPersonalization.VerseAlignment, " SQL = SQL & " tblPersonalization.EnvLine01, " SQL = SQL & " tblPersonalization.EnvLine02, " SQL = SQL & " tblPersonalization.EnvLine03, " SQL = SQL & " tblPersonalization.EnvLine04, " SQL = SQL & " tblPersonalization.EnvLine05, " SQL = SQL & " tblPersonalization.EnvLine06, " SQL = SQL & " Products.ProductID as VendorProdID, " SQL = SQL & " Products.ProductNameShort, " SQL = SQL & " Products.ProductDescription, " SQL = SQL & " Products.UnitPrice, " SQL = SQL & " Products.uom " SQL = SQL & " FROM tblShoppingCart, tblPersonalization, Products " SQL = SQL & " WHERE tblShoppingCart.ProductID = Products.PEProdID " SQL = SQL & " AND tblShoppingCart.PartID = '0' " SQL = SQL & " AND tblShoppingCart.CustomerID = '" & vCookieCustomerID & "' " SQL = SQL & " AND tblPersonalization.PersonalizationID = tblShoppingCart.PersonalizationID " SQL = SQL & " " SQL = SQL & " ; " %> <% Set vCartItemRS = Conn.Execute(SQL) if (vCartItemRS.EOF and vCartItemRS.BOF) Then fGetCartItems = False else fGetCartItems = True End If end function ' 'This function will retrieve the price of the items in the shopping cart function fGetItemsPrice(vProduct) SQL = " SELECT Pricing.PEProdID, " SQL = SQL & " Pricing.RegQuantity, " SQL = SQL & " Pricing.AdditionalQuantity, " SQL = SQL & " Pricing.CardPrice, " SQL = SQL & " Pricing.AdditionalPrice, " SQL = SQL & " Pricing.EnvelopePrice, " SQL = SQL & " Pricing.AdditionalEnv, " SQL = SQL & " Pricing.Notes " SQL = SQL & " FROM Pricing " SQL = SQL & " WHERE Pricing.PEProdID = '" & vCartItemRS("VendorProdID") & "' " SQL = SQL & " AND ((Pricing.RegQuantity = " & vCartItemRS("OrderQty") & ") " SQL = SQL & " OR (Pricing.RegQuantity = (select max(Pricing.RegQuantity) " SQL = SQL & " FROM Pricing " SQL = SQL & " WHERE Pricing.PEProdID = '" & vCartItemRS("VendorProdID") & "'))) " SQL = SQL & " ORDER BY RegQuantity " SQL = SQL & " ; " 'response.write(SQL) Set vItemPriceRS = Conn.Execute(SQL) if (vItemPriceRS.EOF and vItemPriceRS.BOF) Then fGetItemsPrice = False else fGetItemsPrice = True End If end function ' 'This function will retrieve the price of the items in the shopping cart function fGetGraphic(vProduct) SQL = " SELECT tblProductGraphics.GraphicDirectory, " SQL = SQL & " tblProductGraphics.GraphicSmFV " SQL = SQL & " FROM tblProductGraphics " SQL = SQL & " WHERE tblProductGraphics.ProductNumber = '" & vCartItemRS("VendorProdID") & "' " SQL = SQL & " ; " 'response.write(SQL) Set vGraphicRS = Conn.Execute(SQL) end function ' ' The Following function will insure two places to the right of the decimal ' Function CheckDicimal(sText) Dim sChar i = 1 ' Check for embeded single quotes and ' and duplicate them. CheckDicimal = "" CountDec = "N" DecPlace = 0 Do while i <= Len(sText) sChar = Mid(sText, i, 1) If (CountDec = "Y") then DecPlace = DecPlace + 1 end if If (sChar = ".") Then CountDec = "Y" End If CheckDicimal = CheckDicimal & sChar i = i + 1 loop If (DecPlace = 0) then CheckDicimal = CheckDicimal & ".00" else If (DecPlace < 2) then CheckDicimal = CheckDicimal & "0" end if End If End Function %>