<%@ LANGUAGE="VBSCRIPT" %> <%Option Explicit%> <% Response.Buffer = True Response.Expires = 0 %> <% ' Declare Variables ' ------------------------------------------------- Dim theRecords ' the recordset retrieved from the stored proc Dim sqlText Dim currentProductID ' the current productID name Dim currentQty ' the qty of the current product Dim currentPrice ' the price of the current product Dim extendedPrice ' the line total Dim totalPrice ' the order total Dim strCurrentPrice ' the string to display Dim strExtendedPrice ' the ext price to display Dim numberOfRecords ' the total records returned by the query 'row color variables Dim rowColor ' the current row color Dim currentRowNumber ' tracks the current row number of invoice Dim oddRowColor ' the row color for odd numbered rows Dim evenRowColor ' the row color for even numbered rows ' Initialize Variables ' ------------------------------------------------- currentRowNumber = 0 oddRowColor = "FFFFFF" evenRowColor = "FFCC00" ' Open the database, grab all products ' ------------------------------------------------- set theRecords = Server.CreateObject("ADODB.Recordset") sqlText = "SELECT Products.ProductID, ProductCateogries.ProductCategoryName, Products.ProductDescription, Products.ProductSize, Products.ProductPrice, Products.ProductDiscontinued, Products.ProductWeight FROM ProductCateogries INNER JOIN Products ON ProductCateogries.ProductCategoryID = Products.ProductCategoryID WHERE (((Products.ProductDiscontinued)=0))" theRecords.Open sqlText, "Driver={MySQL};Server=sql.megasqlservers.com;Db=primary_goodpet_com;UID=dbm.goodpet.com;pwd=goo2002;" %> Dr. Goodpet - View Cart
Goodpet's Story Goodpet Products Ordering Goodpet Outlets Recipes Links Search Goodpet View Cart
 
INVOICE
 
 
<% ' Compare productID between recordset and sesson variables ' if the session productID has quantity > 0, display information Do Until (theRecords.EOF) currentProductID = theRecords.Fields("ProductID") If ( Session(currentProductID) > 0 ) Then 'set variable values currentQty = Ccur(Session(currentProductID)) 'Apply discount to quantities greater than 11. if currentQty > 11 OR (((theRecords.Fields("ProductID") = "PS112") OR (theRecords.Fields("ProductID") = "MX115")) and currentQty > 5) then currentPrice = Ccur(theRecords.Fields("ProductPrice")) * .8 else currentPrice = Ccur(theRecords.Fields("ProductPrice")) end if extendedPrice = currentPrice * currentQty totalPrice = totalPrice + extendedPrice strCurrentPrice = FormatCurrency(currentPrice) strExtendedPrice = FormatCurrency(extendedPrice) 'set row color currentRowNumber = currentRowNumber + 1 rowColor = SetOddEvenRowColor (currentRowNumber, oddRowColor, evenRowColor) 'display product info and quantity Response.Write ("") Response.Write ("") Response.Write ("") End If theRecords.MoveNext Loop numberOfRecords = currentRowNumber theRecords.close %>
Qty Product Description Price Extended
") Response.Write ( Session(currentProductID)) 'write quantity Response.Write ("") Response.Write theRecords.Fields("ProductID") 'write ProductID Response.Write ("") Response.Write theRecords.Fields("ProductDescription") 'write ProductDescription if currentQty > 11 OR (((theRecords.Fields("ProductID") = "PS112") OR (theRecords.Fields("ProductID") = "MX115")) and currentQty > 5) then Response.Write " (20% discount)" end if Response.Write ("") Response.Write (strCurrentPrice) 'write Price Response.Write ("") Response.Write (strExtendedPrice) 'write Extended Price Response.Write ("
------
Total: <%Response.Write(FormatCurrency(totalPrice))%>
<% 'Open the database, grab all products '------------------------------------------------- sqlText = "SELECT Products.ProductID, ProductCateogries.ProductCategoryName, Products.ProductDescription, Products.ProductSize, Products.ProductPrice, Products.ProductDiscontinued, Products.ProductWeight FROM ProductCateogries INNER JOIN Products ON ProductCateogries.ProductCategoryID = Products.ProductCategoryID WHERE (((Products.ProductDiscontinued)=0))" theRecords.Open sqlText, "Driver={MySQL};Server=sql.megasqlservers.com;Db=primary_goodpet_com;UID=dbm.goodpet.com;pwd=goo2002;" Do Until (theRecords.EOF) currentProductID = theRecords.Fields("ProductID") If ( Session(currentProductID) > 0 ) Then 'set variable values CurrentQty = Ccur(Session(currentProductID)) 'write a hidden form element for each product with qty > 0 %> <% End If theRecords.MoveNext Loop numberOfRecords = currentRowNumber theRecords.close %>

SPECIAL! - Test our new odor remover Stink Off! and get a 10% DISCOUNT!
Just add one to your current order and a 10% discount will be applied to your invoice.

DISCOUNTS WILL BE DEDUCTED DIRECTLY FROM THE INVOICE THAT ACCOMPANIES YOUR ORDER


Any information you submit will be secured by 128 bit encryption.


Our products are all guaranteed 100% or your money back!

Shipping - $5.00 for less than 1 lb. and $6.00 for over 1 lb.
All orders sent Priority Mail or UPS

A discount of 20% will be applied to case lot orders
(12 bottles per case). XL products (6 bottles per case).
Free freight on orders over $100.00 (except international)

Back to Dr. Goodpet's homepage




© 2004 Dr. Goodpet. All rights reserved.