<%-- welcome.jsp Alan Pinder - April 14th 2005 This is the welcome/index page. It's the first page the user sees This page shows the user's private messages. From here they can compose new messages, view their messages, and delete them. Classes Used: None Attributes Used: None Parameters Get: loginMessage - Message to display --%> <%-- Standard page declarations --%> <%@ page import="apz.db.*" %> <%@ page session="true" %> <%@ page errorPage="error.jsp" %> <%-- Static function to generate a human-readable status from the order object--%> <%! private static String parseOrderStatus(DbUser.Order pOrder) throws DbException { // Check the order item ID points to a valid item // If it doesn't throw an error // ^^ Means bad stuff happened DbItem pItem = DB.getItem(pOrder.getItemID()); if (pItem == null) throw new DbItemNotFoundException(pOrder.getItemID()); // Create the string and return it String tempString = "Your order of " + pOrder.getQuantity() + " x " + pItem.getName() + " is currently "; if (pOrder.getOrderStatus() == DbConstants.OrderStatus.COMPLETED) tempString += "completed. You should have recieved the item(s)"; if (pOrder.getOrderStatus() == DbConstants.OrderStatus.PLACED) tempString += "being processed by our computers"; if (pOrder.getOrderStatus() == DbConstants.OrderStatus.PROCESSING) tempString += "being processed by our sales team"; if (pOrder.getOrderStatus() == DbConstants.OrderStatus.WAREHOUSE) tempString += "being stored in our warehouse awaiting despatch"; if (pOrder.getOrderStatus() == DbConstants.OrderStatus.TRANSIT) tempString += "in transit. You should recieve the item(s) soon"; return tempString; } %> <%-- Start of main page --%> <% // Global (to page) object references // Please note these are only meaningful if the user is logged-in DbUser currentUser = null; DbUser.Order[] currentOrders = null; // Check whether use is logged in/not boolean isActive = (session.getAttribute("isActive") != null); if (isActive) { // Load user from session currentUser = (DbUser)session.getAttribute("userObject"); // Read outstanding orders currentOrders = currentUser.getOrders(); } %> Welcome to Pirisale
<% if (isActive) { out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write(""); } %>
. : | Welcome to PiriSale | : .
Pioraj Welcome to PiriSale.com, the worlds biggest store of Internet Pioraj!
SPECIAL EASTER SALE! - ALL PIORAJ 50% OFF!
<% // Retrieve all threads, but only display annoucement messages DbThread[] threadArray = DB.getThreads(); for(int i=0; i\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); } %>
Latest News
" + threadArray[i].getAuthor() + "" + threadArray[i].getTitle() + "
\r\n"); out.write("\r\n"); out.write("\r\n"); if (currentOrders.length == 0) out.write("\r\n"); for(int i=0; i\r\n"); } out.write("\r\n"); out.write("
Current Orders
You currently have no active orders
* " + parseOrderStatus(currentOrders[i]) + "
\r\n"); out.write("
Frequently asked questions
Help! I'm a new user!Click here to register for a free PiriSale account. This allows you to purchase Pioraj, participate in our discussion forums, write product reviews, and perform many more exicting activities!
OK, so I've created my account...When creating your account you should have been asked for a user name and a password. Click here and enter these values when asked. You should notice the screen and navigation bar change to reflect the fact you are now a signed-in user
I have a suggestion for improvement!Click here to contact us and leave any comments/constructive critisicm you may have