From 366d9051559ef97132388e62990a83f019ef57ce Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Tue, 25 Apr 2017 00:13:46 -0400 Subject: [PATCH] Add/Remove Admin & bug fixes --- .../webpages/administration/adminApprove.jsp | 2 - .../webpages/administration/adminLocation.jsp | 16 +- .../webpages/administration/adminThings.jsp | 75 ------ .../webpages/administration/approveAdmin.jsp | 240 ------------------ .../html/webpages/administration/newadmin.jsp | 239 +++++++++++++++++ .../webpages/administration/ticketApprove.jsp | 4 +- .../html/webpages/components/adminnavbar.jsp | 2 +- .../html/webpages/components/adminsidebar.jsp | 2 +- .../html/webpages/components/navbar.jsp | 2 +- .../html/webpages/redirect/createProfile.jsp | 2 +- .../webpages/redirect/newadminRedirect.jsp | 83 ++++++ .../webpages/redirect/ticketAdminRedirect.jsp | 21 +- WebContent/index.jsp | 4 +- WebContent/passwordreset.jsp | 4 +- src/database/AdminQueries.java | 131 ++++++++++ src/database/AdminQuery.java | 152 ----------- src/database/EmployeeQueries.java | 145 ++++++----- src/database/TicketQueries.java | 6 +- src/entities/Admin.java | 32 ++- src/entities/User.java | 4 - src/utilities/Mail.java | 2 +- 21 files changed, 604 insertions(+), 564 deletions(-) delete mode 100644 WebContent/html/webpages/administration/adminThings.jsp delete mode 100644 WebContent/html/webpages/administration/approveAdmin.jsp create mode 100644 WebContent/html/webpages/administration/newadmin.jsp create mode 100644 WebContent/html/webpages/redirect/newadminRedirect.jsp delete mode 100644 src/database/AdminQuery.java diff --git a/WebContent/html/webpages/administration/adminApprove.jsp b/WebContent/html/webpages/administration/adminApprove.jsp index 4eafaf7..d6a304e 100644 --- a/WebContent/html/webpages/administration/adminApprove.jsp +++ b/WebContent/html/webpages/administration/adminApprove.jsp @@ -147,8 +147,6 @@ String ticketStr = Ticket.arrayToString(tickets); /* Managing the event listeners on the page. */ - // Adds event listeners to all table records, so you can approve/reject it. - $("tr.entry").click(ticketAction); // Exits modal when x is clicked. $("#closeForm").click(closeModal); diff --git a/WebContent/html/webpages/administration/adminLocation.jsp b/WebContent/html/webpages/administration/adminLocation.jsp index 9bb08d9..b2bc45a 100644 --- a/WebContent/html/webpages/administration/adminLocation.jsp +++ b/WebContent/html/webpages/administration/adminLocation.jsp @@ -296,20 +296,20 @@ var locations = makeLocationArray(); //Populate locations into table! populateLocations(); -//geocode listeners +// geocode listeners $("#addZip").keyup(geocodeTown); $("#modifyZip").keyup(geocodeTown); -//adds event listeners to all table records +// adds event listeners to all table records $("tr.entry").click(modifyModal); -//Exits modal when x is clicked. +// Exits modal when x is clicked. $("#closeModifyForm").click(closeModifyModal); -//Open the add modal +// Open the add modal $("#add").click(addModal); -//Event listener exits modal when x is clicked. +// Event listener exits modal when x is clicked. $("#closeAddForm").click(closeAddModal); -//Event listener exits modal when esc key pressed. +// Event listener exits modal when esc key pressed. window.onkeydown = function(e){if (e.keyCode == 27){closeAddModal();closeModifyModal();}} -//Event listener exits modal when click outside modal. +// Event listener exits modal when click outside modal. window.onclick = function(e){var add = document.getElementById('addModal'); var modify = document.getElementById('modifyModal'); if(e.target == add || e.target == modify) {closeAddModal();closeModifyModal();}} // Event listener for table records. @@ -341,7 +341,7 @@ $('#tabledisplay').bootstrapTable({onClickRow: function(row,$element){ $('#thedeletebutton').attr('title','Cannot delete because devices and/or employees are at this location!'); } else{ - $('#thedeletebutton').attr('disabled',false); + $('#thedeletebutton').removeAttr('disabled'); $('#thedeletebutton').removeAttr('title'); } $("#modifyModal").show(); diff --git a/WebContent/html/webpages/administration/adminThings.jsp b/WebContent/html/webpages/administration/adminThings.jsp deleted file mode 100644 index 587e09a..0000000 --- a/WebContent/html/webpages/administration/adminThings.jsp +++ /dev/null @@ -1,75 +0,0 @@ - - -<%@ page import = "database.*,entities.*" %> -<%@ page import = "java.util.Random" %> -<%@ page import = "database.*" %> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> -<%@ page import = "java.sql.*" %> -<%@ page import = "java.security.MessageDigest" %> -<%@ page import = "java.security.NoSuchAlgorithmException" %> - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WebContent/html/webpages/administration/approveAdmin.jsp b/WebContent/html/webpages/administration/approveAdmin.jsp deleted file mode 100644 index 8c67fd7..0000000 --- a/WebContent/html/webpages/administration/approveAdmin.jsp +++ /dev/null @@ -1,240 +0,0 @@ -<%@ page import="database.*,entities.*"%> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - - - - - - - - -Synchrony Financial - - - - - - - - - - - - - - -
- - - - - - - - -
NameSSOFinger Print
- - -
- - - -