diff --git a/WebContent/html/imgs/loader.gif b/WebContent/html/imgs/loader.gif new file mode 100644 index 0000000..9bfca92 Binary files /dev/null and b/WebContent/html/imgs/loader.gif differ diff --git a/WebContent/html/javascript/request.jsp b/WebContent/html/javascript/request.jsp index d8d3640..daffd7d 100644 --- a/WebContent/html/javascript/request.jsp +++ b/WebContent/html/javascript/request.jsp @@ -11,6 +11,7 @@ Device[] mydevices = DeviceQueries.getAvailableDevices(); //string representation of array. String deviceString = Device.arrayToString(mydevices); +deviceString = deviceString.replace("'","\\'"); //out.println(description); //out.println(hardware); %> diff --git a/WebContent/html/webpages/administration/adminApprove.jsp b/WebContent/html/webpages/administration/adminApprove.jsp index af64ee3..d6a304e 100644 --- a/WebContent/html/webpages/administration/adminApprove.jsp +++ b/WebContent/html/webpages/administration/adminApprove.jsp @@ -11,13 +11,18 @@ pageEncoding="ISO-8859-1"%> - Innovation Hub - - - - - - + Innovation Hub + + + + + + + + + + + @@ -93,16 +107,16 @@ pageEncoding="ISO-8859-1"%>
- +
- - - - - - - + + + + + + + @@ -133,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); @@ -147,6 +159,18 @@ String ticketStr = Ticket.arrayToString(tickets); var searchbar = document.getElementsByName('searchBar'); searchbar[0].onkeyup = refresh; + // Set up table record event listeners + $('#tabledisplay').bootstrapTable({onClickRow: function(row,$element){ + var id = $element[0].getAttribute('id'); + var html = ""; + document.getElementById("tablemodal").innerHTML = html; + $("#ticketIDfield").val(ticks[id].id); + $("#deviceIDfield").val(ticks[id].deviceID); + $("#locationIDfield").val(ticks[id].location); + $("#permField").val(ticks[id].permanent); + $("#Modal").show(); + }}); + /* Params: tickets - array of objects, formatted as tickets. This function will display tickets in a table on the webpage. diff --git a/WebContent/html/webpages/administration/adminLocation.jsp b/WebContent/html/webpages/administration/adminLocation.jsp index 4868e39..b2bc45a 100644 --- a/WebContent/html/webpages/administration/adminLocation.jsp +++ b/WebContent/html/webpages/administration/adminLocation.jsp @@ -15,11 +15,17 @@ + + + + + + + + - -
Ticket IDRequestor NameLocation NameDevice NameStatusPermanent?Return DateTicket IDRequestor NameLocation NameDevice NameStatusPermanent?Return Date
" + ticks[id].id + "" + ticks[id].username + "" + ticks[id].locationname + "" + ticks[id].devicename + "" + ticks[id].status + "" + ticks[id].permanent + "" + ticks[id].return + "
- - - - - - - - - - - - +
NameAddressTownStateZip Code
+ + + + + + + + + + + +
NameAddressTownStateZip Code
@@ -281,22 +296,57 @@ 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. +$('#tabledisplay').bootstrapTable({onClickRow: function(row,$element){ + var id = $element[0].getAttribute('id'); + for(var i = 0; i < locations.length; i++){ + if(id == locations[i].id) + break; + } + //autofill all information from what you clicked on into modal + $("#modifyName").val(locations[i].name.replace(/"/g,"\"")); + $("#modifyAddress").val(locations[i].address.replace(/"/g,"\"")); + $("#modifyTown").val(locations[i].town.replace(/"/g,"\"")); + $("#modifyState").val(locations[i].state); + $("#modifyZip").val(locations[i].zip); + $("#modifyID").val(locations[i].id); + + var geocoder = new google.maps.Geocoder(); + //this function assumes that you are using a proper zip code... + geocoder.geocode({'address':locations[i].zip}, function(results,status) + {if (status == google.maps.GeocoderStatus.OK) + {$("#modifylat").val(results[0].geometry.location.lat()); + $("#modifylng").val(results[0].geometry.location.lng());} + }); + + //if the location has a foreign key constraint, then the delete button should be restricted + if(locations[i].numDevices > 0 || locations[i].numEmployees > 0){ + $('#thedeletebutton').attr('disabled',true); + $('#thedeletebutton').attr('title','Cannot delete because devices and/or employees are at this location!'); + } + else{ + $('#thedeletebutton').removeAttr('disabled'); + $('#thedeletebutton').removeAttr('title'); + } + $("#modifyModal").show(); +}}); + //Places all locations from query into page function populateLocations(){ var html = ""; diff --git a/WebContent/html/webpages/administration/allTickets.jsp b/WebContent/html/webpages/administration/allTickets.jsp index 339bfb0..0ea097a 100644 --- a/WebContent/html/webpages/administration/allTickets.jsp +++ b/WebContent/html/webpages/administration/allTickets.jsp @@ -29,10 +29,6 @@ pageEncoding="ISO-8859-1"%> text-align: center; } - tr.entry{ - cursor: pointer; - } - .table{ width: auto; background-color: #E9EAEB; @@ -42,13 +38,15 @@ pageEncoding="ISO-8859-1"%> text-align: left; } - .btn{ - margin-top: 15px; - } - body{ overflow: visible; } + + div.displayDevice{ + padding-right: 30px; + padding-bottom: 30px; + } + @@ -69,7 +67,8 @@ pageEncoding="ISO-8859-1"%>
-
+ +
@@ -85,6 +84,7 @@ pageEncoding="ISO-8859-1"%>
+
<% diff --git a/WebContent/html/webpages/administration/newadmin.jsp b/WebContent/html/webpages/administration/newadmin.jsp new file mode 100644 index 0000000..a9a8675 --- /dev/null +++ b/WebContent/html/webpages/administration/newadmin.jsp @@ -0,0 +1,239 @@ +<%@ page import="database.*,entities.*"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + + + + + Synchrony Financial + + + + + + + + + + + + + + + + + + + + + +
+

Administrator Management Settings

+ + + + + + + + + + +
NameSSOFingerprint Registered?
+ +
+ + + + + + + +<% + Admin[] admins = AdminQueries.getAllAdmins(); + String adminString = Admin.arrayToString(admins); + adminString = adminString.replace("'", "\\'"); +%> + + + + diff --git a/WebContent/html/webpages/administration/ticketApprove.jsp b/WebContent/html/webpages/administration/ticketApprove.jsp index 7116095..72a968a 100644 --- a/WebContent/html/webpages/administration/ticketApprove.jsp +++ b/WebContent/html/webpages/administration/ticketApprove.jsp @@ -20,7 +20,7 @@ + + + + + + + +
+

My Tickets

+ +
+ +
+ + + + + + + + + + + + + + +
Ticket IDRequestor NameLocation NameDevice NameStatusPermanent?Return Date
+
+ +<% +/* + Get all tickets in users name. +*/ +Ticket[] tickets = TicketQueries.getAllTickets(Integer.parseInt(navsso)); +String ticketStr = Ticket.arrayToString(tickets); +%> + + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/redirect/adminpasswordchange.jsp b/WebContent/html/webpages/redirect/adminpasswordchange.jsp index b0181bb..5d226df 100644 --- a/WebContent/html/webpages/redirect/adminpasswordchange.jsp +++ b/WebContent/html/webpages/redirect/adminpasswordchange.jsp @@ -76,7 +76,9 @@ if(request.getParameter("submit") != null){ } } ResultSet result; - result = stmt.executeQuery("select * FROM admin where Admin_ID='" + navsso + "' AND Password='" + generatedOldPass + "'"); + String query = "select * FROM admin where Admin_ID='" + navsso + "' AND Password='" + generatedOldPass + "'"; + result = stmt.executeQuery(query); + System.out.println("Executing query: "+query); if(result.next()){//if old password is accurate if (!old.equals(newpass) && newpass.equals(confirm) && pincode.length() == 4 && AdminQueries.pincodeInt(pincode)){//if the password is new AND both news ones are equal AND pincode is 4 digits AND pincode is a number try { diff --git a/WebContent/html/webpages/redirect/adminpasswordupdate.jsp b/WebContent/html/webpages/redirect/adminpasswordupdate.jsp index 5dc7241..b8b9363 100644 --- a/WebContent/html/webpages/redirect/adminpasswordupdate.jsp +++ b/WebContent/html/webpages/redirect/adminpasswordupdate.jsp @@ -87,8 +87,9 @@ if(request.getParameter("password") != null){ } } ResultSet result; - result = stmt.executeQuery("select * FROM admin where Admin_ID='" + navsso + "' AND Password='" + generatedOldPass + "'"); - + String query = "select * FROM admin where Admin_ID='" + navsso + "' AND Password='" + generatedOldPass + "'"; + result = stmt.executeQuery(query); + System.out.println("Executing query: "+query); /* If the old password is correct, then we can continue to change the password. */ diff --git a/WebContent/html/webpages/redirect/createProfile.jsp b/WebContent/html/webpages/redirect/createProfile.jsp index e3f9b4c..af9796c 100644 --- a/WebContent/html/webpages/redirect/createProfile.jsp +++ b/WebContent/html/webpages/redirect/createProfile.jsp @@ -35,7 +35,7 @@ String ph = request.getParameter("ph"); String email = request.getParameter("email"); //form was submitted if(request.getParameter("submit") != null){ - EmployeeQueries.addEmployee(sso,loc,name,ph,email); + EmployeeQueries.addEmployee(Integer.parseInt(sso),Integer.parseInt(loc),name,ph,email); request.getSession(); session.setAttribute("ssoNum", sso); userCookie = new Cookie("ssoNum", sso); diff --git a/WebContent/html/webpages/redirect/newadminRedirect.jsp b/WebContent/html/webpages/redirect/newadminRedirect.jsp new file mode 100644 index 0000000..12e7e93 --- /dev/null +++ b/WebContent/html/webpages/redirect/newadminRedirect.jsp @@ -0,0 +1,83 @@ +<%@ 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" %> +<%@ page import = "utilities.Mail" %> + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp b/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp index 2ab57a0..45df66c 100644 --- a/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp +++ b/WebContent/html/webpages/redirect/ticketAdminRedirect.jsp @@ -14,9 +14,9 @@ Synchrony Financial + -