diff --git a/WebContent/adminLogin.jsp b/WebContent/adminLogin.jsp index ffd6dc8..de40b3c 100644 --- a/WebContent/adminLogin.jsp +++ b/WebContent/adminLogin.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess" %> +<%@ page import = "database.*" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import = "java.sql.*" %> @@ -9,7 +9,7 @@ Cookie adminCookie; ssoNum = Integer.parseInt(request.getParameter("ssoNum2")); pass = request.getParameter("pass"); MySQLAccess myaccess = new MySQLAccess(); -Statement statement = myaccess.connectDB(); +Statement statement = myaccess.getStatement(); ResultSet result; result = statement.executeQuery("select * FROM admin where Admin_ID='" + ssoNum + "' AND Password='" + pass + "'"); @@ -20,7 +20,7 @@ if (result.next()){ adminCookie.setMaxAge(30*60); response.addCookie(adminCookie); statement.close(); - response.sendRedirect("html/webpages/admin.html"); + response.sendRedirect("html/webpages/admin.jsp"); } else { statement.close(); response.sendRedirect("index.jsp"); diff --git a/WebContent/html/javascript/navbar.js b/WebContent/html/javascript/navbar.js deleted file mode 100644 index 07b0906..0000000 --- a/WebContent/html/javascript/navbar.js +++ /dev/null @@ -1,2 +0,0 @@ -document.getElementById('navbaruniversal').innerHTML = '
' - diff --git a/WebContent/html/javascript/request.jsp b/WebContent/html/javascript/request.jsp index b1cca96..086c24f 100644 --- a/WebContent/html/javascript/request.jsp +++ b/WebContent/html/javascript/request.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess,entities.ListedDevice" %> +<%@ page import = "database.*,entities.ListedDevice" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -8,8 +8,7 @@ <% -MySQLAccess myaccess = new MySQLAccess(); -ListedDevice[] mydevices = myaccess.getAllDevices(); +ListedDevice[] mydevices = DeviceQueries.getAllDevices(); //string representation of array. String deviceString = ListedDevice.arrayToString(mydevices); diff --git a/WebContent/html/webpages/admin.html b/WebContent/html/webpages/admin.jsp similarity index 93% rename from WebContent/html/webpages/admin.html rename to WebContent/html/webpages/admin.jsp index 312348b..d3992f8 100644 --- a/WebContent/html/webpages/admin.html +++ b/WebContent/html/webpages/admin.jsp @@ -1,90 +1,90 @@ - - - - - - - - - -Synchrony Financial - - - - - - - - - - - - - -
-

Welcome to the admin page

-
-
- - - - - - + + + + + + + + + +Synchrony Financial + + + + + + + + + + + + + +
+

Welcome to the admin page

+
+
+ + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/adminApprove.html b/WebContent/html/webpages/adminApprove.jsp similarity index 93% rename from WebContent/html/webpages/adminApprove.html rename to WebContent/html/webpages/adminApprove.jsp index f73865e..3efebf8 100644 --- a/WebContent/html/webpages/adminApprove.html +++ b/WebContent/html/webpages/adminApprove.jsp @@ -1,83 +1,83 @@ - - - - - - - - - - Synchrony Financial - - - - - - - - - - - - -
-

Admin View Approvals

-
-
- -
-

Approved!

-
- - - - + + + + + + + + + + Synchrony Financial + + + + + + + + + + + + +
+

Admin View Approvals

+
+
+ +
+

Approved!

+
+ + + \ No newline at end of file diff --git a/WebContent/html/webpages/adminLocation.jsp b/WebContent/html/webpages/adminLocation.jsp index f4e9834..3462a71 100644 --- a/WebContent/html/webpages/adminLocation.jsp +++ b/WebContent/html/webpages/adminLocation.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess,entities.Location" %> +<%@ page import = "database.*,entities.Location" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -42,6 +42,7 @@ @@ -256,10 +257,9 @@ <% -//database connection -MySQLAccess myaccess = new MySQLAccess(); + //database query -Location[] locations = myaccess.getAdminLocations(); +Location[] locations = LocationQueries.getAdminLocations(); //string representation of array. String locationString = Location.arrayToString(locations); locationString = locationString.replace("'","\\'"); @@ -332,6 +332,5 @@ function closeModifyModal(){ - \ No newline at end of file diff --git a/WebContent/html/webpages/index.jsp b/WebContent/html/webpages/index.jsp index e31fe6f..0f23040 100644 --- a/WebContent/html/webpages/index.jsp +++ b/WebContent/html/webpages/index.jsp @@ -67,7 +67,7 @@

Just curious to see what devices we have to offer? You've come to the right place.

- + diff --git a/WebContent/html/webpages/orderFormHandler.jsp b/WebContent/html/webpages/orderFormHandler.jsp index aee91c6..1f13065 100644 --- a/WebContent/html/webpages/orderFormHandler.jsp +++ b/WebContent/html/webpages/orderFormHandler.jsp @@ -1,5 +1,4 @@ - -<%@ page import = "database.MySQLAccess" %> +<%@ page import = "database.*" %> <%@ page import = "entities.User" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -11,7 +10,6 @@ pageEncoding="ISO-8859-1"%> - - - - - - - - - - - - - - - - - - - - - -
-
- -
- -
-
-

Change profile image:

-
-
- -
-

Profile Settings

-
- - - -
-
- - - -
-
- - -
-
- - -
- -
-
- - - - - - + + + + + + + + + + Synchrony Financial + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+

Change profile image:

+
+
+ +
+

Profile Settings

+
+ + + +
+
+ + + +
+
+ + +
+
+ + +
+ +
+
+ + + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/requestPage.jsp b/WebContent/html/webpages/requestPage.jsp index d9f010f..e6d30e3 100644 --- a/WebContent/html/webpages/requestPage.jsp +++ b/WebContent/html/webpages/requestPage.jsp @@ -62,6 +62,7 @@ <%@ include file="../javascript/request.jsp" %> - \ No newline at end of file diff --git a/WebContent/html/webpages/returnComplete.jsp b/WebContent/html/webpages/returnComplete.jsp index 08a267d..4ed52d5 100644 --- a/WebContent/html/webpages/returnComplete.jsp +++ b/WebContent/html/webpages/returnComplete.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess,entities.RentedDevice" %> +<%@ page import = "database.*,entities.RentedDevice" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -20,6 +20,7 @@ @@ -27,13 +28,10 @@

Thanks for returning some devices!

<% -//make instance -MySQLAccess myaccess = new MySQLAccess(); //get string from request form String devices = request.getParameter("devicesToReturn"); -myaccess.returnDevices(devices); +DeviceQueries.returnDevices(devices); %> - \ No newline at end of file diff --git a/WebContent/html/webpages/returnPage.jsp b/WebContent/html/webpages/returnPage.jsp index 7cf5b9f..15bdf43 100644 --- a/WebContent/html/webpages/returnPage.jsp +++ b/WebContent/html/webpages/returnPage.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess,entities.RentedDevice" %> +<%@ page import = "database.*,entities.RentedDevice" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -75,6 +75,7 @@ } @@ -125,11 +126,9 @@ <% -//database connection -MySQLAccess myaccess = new MySQLAccess(); //String userID = cookie implementation exists here. //19 is just for testing purposes. Replaced by userID later. -RentedDevice[] mydevices = myaccess.getUserDevices("19"); +RentedDevice[] mydevices = DeviceQueries.getUserDevices("19"); //string representation of array. String deviceString = RentedDevice.arrayToString(mydevices); %> @@ -272,7 +271,5 @@ function arrayToString(array){ return sb; } - - \ No newline at end of file diff --git a/WebContent/html/webpages/shoppingCart.jsp b/WebContent/html/webpages/shoppingCart.jsp index 7649ec2..49fa859 100644 --- a/WebContent/html/webpages/shoppingCart.jsp +++ b/WebContent/html/webpages/shoppingCart.jsp @@ -1,4 +1,4 @@ -<%@ page import = "database.MySQLAccess" %> +<%@ page import = "database.*" %> <%@ page import = "entities.User" %> <%@ page import = "entities.Location" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" @@ -195,7 +195,6 @@ if(c.getName().equals("ssoNum")) sso = Integer.parseInt(c.getValue()); -