diff --git a/WebContent/html/webpages/adminLocation.jsp b/WebContent/html/webpages/adminLocation.jsp new file mode 100644 index 0000000..7e8db38 --- /dev/null +++ b/WebContent/html/webpages/adminLocation.jsp @@ -0,0 +1,389 @@ +<%@ page import = "database.MySQLAccess,entities.Location" %> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + + + + Synchrony Financial + + + + + + + + + + + + + + + + + + + + + +
+ +

Location Listing

+ + + + + + + + + + + + + +
NameAddressTownStateZip Code
+ +
+<% +//database connection +MySQLAccess myaccess = new MySQLAccess(); +//database query +Location[] locations = myaccess.getLocations(); +//string representation of array. +String locationString = Location.arrayToString(locations); +locationString = locationString.replace("'","\\'"); +%> + + + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/locationRedirect.jsp b/WebContent/html/webpages/locationRedirect.jsp new file mode 100644 index 0000000..967f9da --- /dev/null +++ b/WebContent/html/webpages/locationRedirect.jsp @@ -0,0 +1,64 @@ +<%@ page import = "database.MySQLAccess,entities.Location" %> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + + + + Synchrony Financial + + + + + + + + + + +

Redirect Page

+

You shouldn't be seeing this page :)

+ +<% +//make instance +MySQLAccess myaccess = new MySQLAccess(); +String name = request.getParameter("name").replace("\"","\\\""); +String address = request.getParameter("address").replace("\"","\\\""); +String town = request.getParameter("town").replace("\"","\\\""); +String state = request.getParameter("state"); +String zip = request.getParameter("zip"); +//add form was submitted +if(request.getParameter("add") != null){ + Location location = new Location(name,address,town,state,zip); + myaccess.addLocation(location); +} +//modify form was submitted +if(request.getParameter("modify") != null){ + //getParameter() always returns string + String strID = request.getParameter("id"); + //turn to int for constructor + int id = Integer.parseInt(strID); + Location location = new Location(id,name,address,town,state,zip); + myaccess.modifyLocation(location); +} +//delete form was submitted +if(request.getParameter("delete") != null){ + String strID = request.getParameter("id"); + int id = Integer.parseInt(strID); + myaccess.deleteLocation(id); +} +%> + + + + + \ No newline at end of file diff --git a/WebContent/html/webpages/profileSettings.html b/WebContent/html/webpages/profileSettings.html index b907797..ea0abb4 100644 --- a/WebContent/html/webpages/profileSettings.html +++ b/WebContent/html/webpages/profileSettings.html @@ -57,8 +57,10 @@ + + +