<%try{%> <%@ page import="sitoca.Login, sitoca.ProductList, sitoca.ShoppingCart, java.sql.*,java.text.*,java.util.*,java.beans.*"%> <% out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write("
"); if ((session.getAttribute("SessionLogin")) == null) { out.write("Please LOGIN before placing orders. Click HERE if you need to register."); } out.write("

"); //String header = (String)session.getAttribute("sessionCategory"); // Put codings to display header here out.write(""); out.write("

"); out.write("
"); // out.write(""); out.write(""); out.write(""); out.write(""); out.write("
"); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); // end of form at 49 out.write(""); out.write(""); out.write("
"); //************************************** Start of Codes *************************************** out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write("
"); out.write("
Click on the name of the product to view its specifications.
"); out.write("
"); out.write(""); out.write(""); out.write(""); out.write(""); out.write("
"); out.write("
"); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); //loop through each cart item display the item number, the item name, an editable count field and a price per item field int iQuantityCount, count,iNoOfProductCount; iQuantityCount = count = iNoOfProductCount = 0; double total = 0.00; String productNo, productName, productCost, productColour, productModel, productDimension, productQuantity, productOptional, productImage, Quantity, oTotal; oTotal = ""; String startFont = ""; String openWindow1 = ""; String TDStart = ""); } else { vShoppingCart = (Vector)session.getAttribute("SessionShoppingCart"); if (vShoppingCart.elementAt(0) == null) { out.write(""); } else { //for(int x = 0;x < vShoppingCart.size();++x) //{ Vector vMainCart = new Vector(); Vector vOptionalCart = new Vector(); Vector vAccessoriesCart = new Vector(); int x = 0; for(int i = 0;i < 3;++i) { String strType = ""; vOptionalCart = ((Vector)vShoppingCart.elementAt(i)); for(int a = 0;a < vOptionalCart.size();++a) { // Vector has 3 level, 1st level consist of many carts added by order item // Vector 2 level is divided into Main, Optional and Accessories // Level 3 consist of numerous items in Main, Optional or Accessories vMainCart = (Vector)vOptionalCart.elementAt(a); productNo = (String)vMainCart.elementAt(0); productName = (String)vMainCart.elementAt(1); productCost = (String)vMainCart.elementAt(2); productColour = (String)vMainCart.elementAt(3); productModel = (String)vMainCart.elementAt(4); productDimension = (String)vMainCart.elementAt(5); productQuantity = (String)vMainCart.elementAt(6); if ((x%2) == 0){out.write("");}else{out.write("");} out.write(""); if (i == 0){strType = " (Main)";} else if (i == 1){strType = " (Opt)";} else if (i == 2){strType = " (Acc)";} else{strType = "";} x++; if ((productQuantity.length() > 0) && (Double.parseDouble(productQuantity) > 0)) { total = total + (Double.parseDouble(productQuantity) * Double.parseDouble(productCost)); } // Product Name out.write(""); // Product Cost out.write(TDStart + "width=\"10%\">" +startFont + "$"+productCost+ ""); // Product Colour out.write(TDStart + "width=\"10%\" >"+startFont + productColour + ""); // Product Dimension out.write(TDStart + "width=\"20%\" >"+startFont + productDimension + ""); // Product Quantity out.write(""); } } //} //S$30 delivery charges total = total + 30; NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(2); nf.setMaximumFractionDigits(2); oTotal = nf.format(total); String strWithGSTTotal = nf.format(total * 1.05); //-- display total -- out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write(""); out.write("
Product Description Cost Colour Dimension Ordered Quantity
There are no items in the Shopping Cart.
There are no items in the Shopping Cart.
"+startFont + "[Series " + productModel + "] " + openWindow1 + "viewImage.jsp?productNo=" + productNo + openWindow2 + productName + "" + strType +""); out.write("
 Delivery Charges: S$30.00*
Sub Total: S$" + oTotal + " (Without 5% GST)
Total: S$" + strWithGSTTotal + " (With 5% GST)
*S$30.00 delivery charges to Singapore Mainland applies during office hour per address.
"); // end of table at line 50 out.write("
"); // end of table at 46 out.write("
"); //-- create table for action buttons -- out.write(""); out.write(""); out.write(""); out.write(""); if((session.getAttribute("SessionLogin")) != null) { out.write(""); out.write(""); } out.write(""); } // close bracket for testing if element in session shopping cart is empty } // close bracket for testing if session shopping cart is empty out.write("
"); // end of table at 217 out.write("
"); // end of table at 27 out.write("
");// end of table at 24 %> <%}catch(Exception e){%><%}%>