Skip to content

Commit

Permalink
Enhancements annd Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
clj13001 committed Apr 12, 2017
1 parent 8bfbed6 commit 2afb2eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
3 changes: 3 additions & 0 deletions WebContent/html/webpages/adminDeviceSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ window.onclick = function(e){var add = document.getElementById('addModal'); var
var manuHTML = '<option value="" disabled selected>Choose Manufacturer</option>';
var hardwareHTML = '<option value="" disabled selected>Choose Hardware</option>';
var availabilityHTML = '<option value="" disable selected>Choose Availability</option>';
manufacturers.sort();
for(var i = 0; i < manufacturers.length; i++)
manuHTML += '<option value="' + manufacturers[i] + '">' + manufacturers[i] + '</option>';
hardwares.sort();
for(var i = 0; i < hardwares.length; i++)
hardwareHTML += '<option value="' + hardwares[i] + '">' + hardwares[i] + '</option>';
availabilities.sort();
for(var i = 0; i < availabilities.length; i++)
availabilityHTML += '<option value="' + availabilities[i] + '">' + availabilities[i] + '</option>';
document.getElementById('addManu').innerHTML = manuHTML;
Expand Down
1 change: 1 addition & 0 deletions WebContent/html/webpages/deviceRedirect.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<link rel = "stylesheet" type = "text/css" href = "../css/stylesheet.css">
<link rel = "shortcut icon" href = "../imgs/synchrony-financial-logo-dlpx_1.ico">
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
</nav>
</head>
<body>
Expand Down
17 changes: 6 additions & 11 deletions WebContent/html/webpages/orderFormHandler.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
</nav>
<script type="text/javascript">
<%
Cookie[] cookies = request.getCookies();
int sso = 0;
for(Cookie c : cookies)
{
if(c.getName().equals("ssoNum")) sso = Integer.parseInt(c.getValue());
}
// If location id is 0, it is a custom location which must be added to the database before employee preffered location can be updated
int location=-1;
if(Integer.parseInt(request.getParameter("location_dropdown"))==0)
Expand All @@ -28,7 +23,7 @@ if(Integer.parseInt(request.getParameter("location_dropdown"))==0)
request.getParameter("address"),
request.getParameter("town"),
request.getParameter("zip"),
sso
Integer.parseInt(navsso)
);
}
Expand All @@ -38,7 +33,7 @@ String phone = request.getParameter("phone");
String email = request.getParameter("email");
// read location ID, but only if we haven't already generated it when adding new location to db
if(location==-1){ location = Integer.parseInt(request.getParameter("location_dropdown"));}
EmployeeQueries.updateEmployee(sso, userName, phone, location, email);
EmployeeQueries.updateEmployee(Integer.parseInt(navsso), userName, phone, location, email);
System.out.print("updated employee "+userName);
// And now for the ticket
Expand All @@ -59,7 +54,7 @@ for(int i=0; i<idStringArray.length; i++)
// Now just call generateTicket once for each device
for(int i=0; i<devIDs.length; i++)
{
TicketQueries.generateTicket(sso, location, devIDs[i], request.getParameter("timeNeeded"));//TODO get ID somehow
TicketQueries.generateTicket(Integer.parseInt(navsso), location, devIDs[i], request.getParameter("timeNeeded"));//TODO get ID somehow
}
%>
Expand Down
13 changes: 2 additions & 11 deletions WebContent/html/webpages/shoppingCart.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">

<%
Cookie[] cookies = request.getCookies();
int sso = 0;
for(Cookie c : cookies)
{
if(c.getName().equals("ssoNum")) sso = Integer.parseInt(c.getValue());
}
%>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -85,7 +75,7 @@ if(c.getName().equals("ssoNum")) sso = Integer.parseInt(c.getValue());
</div>
<div class="form-group row">
<label for="phone">Phone Number</label><br/>
<input type="tel" class="form-control" name="phone" placeholder="203-867-5309" style="margin: 0 auto; width:60%" required>
<input type="tel" class="form-control" name="phone" placeholder="xxx-xxx-xxxx" style="margin: 0 auto; width:60%" required>
</div>
<div class="form-group row">
<label for="email">Email</label><br/>
Expand Down Expand Up @@ -354,6 +344,7 @@ function hidePopup(){
function autoFillFields(orderAllBool) {
// get employee
<%
int sso = Integer.parseInt(navsso);
User employee = EmployeeQueries.getEmployeeByID(sso);
int locationID = employee.getLocation();
String name = employee.getName();
Expand Down

0 comments on commit 2afb2eb

Please sign in to comment.