Shopping Basket

<% function formatDec(n, d){ with (Math) { // Separate the sign from the number var sign = (n < 0) ? "-" : ""; var num = abs(n); // Separate whole number from decimal var whole = floor(num); var frac = round((num - whole) * pow(10,d)).toString(); } // Zero-fill decimal for ( ; frac.length < d ; ) frac = "0" + frac; // Put it all back together return sign + whole + "." + frac; } var priceCounter = 0.00 %> <% var addShip addShip = 0 var con = Server.CreateObject("ADODB.Connection"); con.Open(zmConn); var rs = Server.CreateObject("ADODB.Recordset"); var zmSQL = "SELECT tblSectionDetails.CatID, tblProductDetails.Price, tblProductDetails.Title, tblPurchases.PurchaseID, tblPurchases.SessionID, tblPurchases.Image, tblPurchases.PhotoID, tblPurchases.Message, tblPurchases.Message2, tblPurchases.Quantity, tblProductDetails.Icon, tblProductDetails.ProductID FROM tblSectionDetails, tblProductDetails, tblPurchases WHERE tblProductDetails.ProductID = tblPurchases.ProductID AND tblPurchases.SessionID = " + Session.sessionID + " AND tblPurchases.Complete = 1 AND tblProductDetails.SectionID = tblSectionDetails.SectionID" rs.Open(zmSQL, con, adOpenKeyset, adLockOptimistic); if(rs.EOF){%> <%} var mess1 var mess2 while(!rs.EOF){ if(rs("Message").value == "-1"){ mess1 = "" }else{ mess1 = rs("Message").value; } if(rs("Message2").value == "-1"){ mess2 = "" }else{ mess2 = rs("Message2").value; }%> <% rs.MoveNext() }%> <% var shipping shipping = 0.00 if(addShip != "0"){ shipping = 2.95 }%> <% var finalPrice finalPrice = priceCounter + shipping%>
Thumbnail Title Quantity Update Remove Price
There is nothing in your shopping cart.
">" alt="<%=rs("Title").value%>" border="0"> "><%=rs("Title").value%> <%if(rs("Image").value == "1"){%>
','Print','425','450','yes')">Check uploaded image<%}%> <%if(rs("PhotoID").value != "0"){%>
','Print','425','450','yes')">Check image<%}%> <%if((mess1 != "") || (mess2 != "")){%>
&Type=View','Print','425','450','yes')">Review/Update Messages<%}%> <%if(rs("CatID").value != "4"){ addShip++; }%>
"> "> ">Remove <% priceCounter = priceCounter + (rs("Price").value * rs("Quantity").value)%> £<%=formatDec(rs("Price").value * rs("Quantity").value,2)%>
Shipping: £<%=formatDec(shipping,2)%>
Total: £<%=formatDec(finalPrice,2)%>
<%rs.Close(); con.Close();%>