<%@ page language="java" errorPage="ErrorPage.jsp" import="java.sql.*,java.sql.ResultSet,java.sql.Statement,javax.servlet.*,java.util.*,java.net.URL,com.massagestore.*"%> <%@ include file="hometop.jsp" %> <% LogManager.logMessage(new Exception(), "Test Exception"); Vector V1=new Vector(); Vector V2=new Vector(); String cat_desc=null; String cat_img=null; String subCategory = null; int i=0; subCategory = request.getParameter("subcat_name"); // get the category name from the querystring String cat_name=request.getParameter("cat_name"); %>
<% String cat=null; try { V1=Category.getAllMainCategories(); int count=V1.size(); while (i <% //if category name matches with the name send in querystring then display subcategories if(cat.equals(cat_name)) { V2=Category.getAllSubCategories(cat); int count2=V2.size(); int j=0; while( j <% }//end of inner while }//end of if }//end of outer while }//end of try catch( Exception e ) { System.err.println(e.getMessage()); } //*******************End Of Sub Category**************************** %> <% if(cart.getTotalItems()!=0) { %> <% } %>
<%=cat%>
  <%=name%>
Featured Items
Special Items
Home Page
Contact Us
Check Out
<% //************** Buy Button Functionality ***************** String itemCodeBuy = null; itemCodeBuy = request.getParameter("itemCode"); if (itemCodeBuy != null) { int item_Code = 0; item_Code = Integer.parseInt(itemCodeBuy); Item item = new com.massagestore.Item(item_Code); cart.addItem(item); response.sendRedirect("Item.jsp?subcat_name=" + subCategory + "&cat_name="+cat_name); }//End of If //*******************************END OF BUY BUTTON********* //******************************Getting the Details of Sub Category************************ Vector v = Category.getItems(subCategory); Iterator itr = v.iterator(); String tempType = null; String type = null; String itemName = null; String tempItemName = null; float discount = 0.0f; String imageSmall = null; String price = null; int stock = 0; String spec = null; int itemCode = 0; String disc_price=null; boolean first = true; while(itr.hasNext()) { Item item = (com.massagestore.Item) itr.next(); type = item.getType(); //tempType = type; spec = item.getSpecification(); itemName = item.getName(); imageSmall = item.getImageSmall(); discount = item.getDiscount(); price = item.getDisplaySellingPrice(); stock = item.getQtyInStock(); itemCode = item.getSkuNo(); disc_price=item.getFinalDisplayPrice(); if (first) { out.print(""); first = false; } if (!(type.equals(tempType))) { // Reset the item name tempItemName = ""; %> <% }//End of If tempType = type; %> <% if(spec != null && spec.length() != 0) { %> <% }// End of If else { %> <% }//End oF Else }//End of While %>
" + item.getCategory() + ": " + item.getSubCategory() + "

<%out.println(type);%>
<% if(!(itemName.equals(tempItemName))) out.println(itemName); tempItemName = itemName; %>
<% out.println(spec); if (discount != 0) { out.println("
"); out.print("Sale " +disc_price+""); } %>
<% out.println(price); %> <% if (item.getQtyInStock() == 0) { out.println("Out Of Stock"); } else { %> <% } %>
<% if(imageSmall != null && !imageSmall.equalsIgnoreCase("image/")) { %> <% if (item.getImageCaption()!= null) { %>
<%=item.getImageCaption()%> <% } }else { %> <% }//End of Else %>
<%out.println(itemName);%>

<% if (discount != 0){ out.println(""); out.print("Sale " +disc_price+""); } %>
<% out.println(price); %>

<% if (stock==0) { out.println("Out Of Stock"); } else { %> <% } %>

<%@ include file="homefooter.jsp" %>