From 1efe7494fe4ef37ad7c9c53e267cc6092eacc9be Mon Sep 17 00:00:00 2001 From: Adam R Claxton Date: Tue, 25 Apr 2017 00:28:53 -0400 Subject: [PATCH] Urgent order option does what it's supposed to now. Implemented admin email, only for urgent orders Still need to do queued admin notifications and improve email quality --- .../webpages/redirect/orderFormHandler.jsp | 39 ++++++++++-- WebContent/html/webpages/shoppingCart.jsp | 30 +++++---- src/database/EmployeeQueries.java | 29 +++++++++ src/entities/Ticket.java | 3 + src/utilities/AdminNotificationQueue.java | 62 +++++++++++++++++++ src/utilities/Mail.java | 57 +++++++++++++++++ 6 files changed, 204 insertions(+), 16 deletions(-) create mode 100644 src/utilities/AdminNotificationQueue.java 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"%>