diff --git a/WebContent/html/webpages/redirect/orderFormHandler.jsp b/WebContent/html/webpages/redirect/orderFormHandler.jsp index aff74f9..afca845 100644 --- a/WebContent/html/webpages/redirect/orderFormHandler.jsp +++ b/WebContent/html/webpages/redirect/orderFormHandler.jsp @@ -1,5 +1,4 @@ -<%@ page import = "database.*,entities.Location" %> -<%@ page import = "entities.User" %> +<%@ page import = "database.*,entities.*,utilities.*" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -42,13 +41,13 @@ String phone = request.getParameter("phone"); String email = request.getParameter("email"); String[] options = request.getParameterValues("checkboxes"); int perm = 0; -int urgent = 0; +boolean urgent = false; if(options != null){ for(int j = 0; j < options.length; j++){ if(options[j].equals("perm")) perm = 1; if(options[j].equals("urgent")) - urgent = 1; + urgent = true; } } // read location ID, but only if we haven't already generated it when adding new location to db @@ -73,19 +72,49 @@ for(int i=0; i= 0; i--) { + AdminNotificationQueue Q = new AdminNotificationQueue(admins[i],instructions,tickets); + Q.start(); +} %> window.location.replace("../shoppingCart.jsp"); diff --git a/WebContent/html/webpages/shoppingCart.jsp b/WebContent/html/webpages/shoppingCart.jsp index 8b5a3e3..8b698df 100644 --- a/WebContent/html/webpages/shoppingCart.jsp +++ b/WebContent/html/webpages/shoppingCart.jsp @@ -76,9 +76,10 @@ pageEncoding="ISO-8859-1"%> - + - + + Your name @@ -96,10 +97,7 @@ pageEncoding="ISO-8859-1"%> - - Location Name - - + @@ -173,6 +171,11 @@ pageEncoding="ISO-8859-1"%> Zip + + + + Location Name + @@ -250,6 +253,7 @@ var employee = { var checked = new Array(); var locations = getLocations(); +var cart = getCartItems(); show(); //on load, we want to show everything @@ -271,7 +275,7 @@ function setCart(cartArray) { This function displays a list of devices that a user has currently in their shopping cart. **/ function show(){ - var cart = getCartItems(); //get all the cart items you want to show + cart = getCartItems(); //get all the cart items you want to show var html = ''; //html string initially empty var part1 = "nhpup.popup('"; var part2 = "');" @@ -347,12 +351,12 @@ function orderAll_showPopup() { // If true, submitting the form will order everything in the cart. If false it only orders selected devices. function showPopup(orderAllBool){ if(checked.length==0 && !orderAllBool){ - $('#Submit').attr('disabled',true); - $('#Submit').attr('title',"There aren't any devices selected to order!"); + $('#Submit').attr('disabled',true); + $('#Submit').attr('title',"There aren't any devices selected to order!"); } else{ - $('#Submit').attr('disabled',false); - $('#Submit').removeAttr('title'); + $('#Submit').attr('disabled',false); + $('#Submit').removeAttr('title'); } orderForm.style.display = "block"; autoFillFields(orderAllBool); @@ -474,6 +478,7 @@ function forceUpdateLocationMetadata() { var selectedDeviceString=JSON.stringify(checked); document.orderForm.deviceIDs.value=selectedDeviceString; + // Finally remove selected items from the cart deleteSelected(false); return true; @@ -535,6 +540,9 @@ function deleteAll(){ function getUserID() { return <%=sso%>; } + function function_name(argument) { + // body... + }