Skip to content

Commit

Permalink
Multiple Important Changes
Browse files Browse the repository at this point in the history
Making sure everything works after the amazing great merge.
  • Loading branch information
clj13001 committed Mar 24, 2017
1 parent 08176ab commit 0a91d1b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
2 changes: 2 additions & 0 deletions WebContent/adminLogin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ if (result.next()){
adminCookie = new Cookie("ssoNum", Integer.toString(ssoNum));
adminCookie.setMaxAge(30*60);
response.addCookie(adminCookie);
statement.close();
response.sendRedirect("html/webpages/admin.html");
} else {
statement.close();
response.sendRedirect("index.jsp");
}
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/adminLocation.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
//database connection
MySQLAccess myaccess = new MySQLAccess();
//database query
Location[] locations = myaccess.getLocations();
Location[] locations = myaccess.getAdminLocations();
//string representation of array.
String locationString = Location.arrayToString(locations);
locationString = locationString.replace("'","\\'");
Expand Down
5 changes: 2 additions & 3 deletions WebContent/html/webpages/index.jsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD:WebContent/html/webpages/index.jsp
<html lang="en">
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -48,13 +47,13 @@

<div class = "menuBox">
<div>
<a class = "divlink" href = "requestPage.html">
<a class = "divlink" href = "requestPage.jsp">
<div class = "menuOption">
<h2>Request</h2>
<p>Check out our selection of devices that YOU have the chance to check out!</p>
</div>
</a>
<a class = "divlink" href="returnPage.html">
<a class = "divlink" href="returnPage.jsp">
<div class = "menuOption">
<h2>Return</h2>
<p>All set with a device? No problem! You can return it here!</p>
Expand Down
4 changes: 2 additions & 2 deletions WebContent/html/webpages/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<div id="navbar" class="navbar-collapse collapse" aria-expanded="false">
<ul class="nav navbar-nav navbar-right">
<li><a href="../webpages/">Home</a></li>
<li><a href="requestPage.html">Device</a></li>
<li><a href="returnPage.html">Return Device</a></li>
<li><a href="requestPage.jsp">Request Device</a></li>
<li><a href="returnPage.jsp">Return Device</a></li>
<li><a href="listingPage.jsp">Device Listing</a></li>
<li><a href="shoppingCart.jsp">Shopping Cart</a></li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion WebContent/html/webpages/orderFormHandler.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ String phone = request.getParameter("phone");
if(location==-1){ location = Integer.parseInt(request.getParameter("location_dropdown"));}
access.updateEmployee(1, userName, phone, location); //TODO get ID somehow
System.out.print("updated employee "+userName);
%>alert("updated employee "+userName);<%
// And now for the ticket
Expand All @@ -56,7 +55,9 @@ for(int i=0; i<devIDs.length; i++)
{
access.generateTicket(1, location, devIDs[i], request.getParameter("timeNeeded"));//TODO get ID somehow
}
%>
window.location.replace("shoppingCart.jsp");
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion WebContent/html/webpages/shoppingCart.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var employee = {
var checked = new Array();
var locations = getLocations();
debug_add_items_to_cart();
//debug_add_items_to_cart();
show(); //on load, we want to show everything
Expand Down
4 changes: 3 additions & 1 deletion WebContent/userLogin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ if (result.next()){
userCookie = new Cookie("ssoNum", Integer.toString(ssoNum));
userCookie.setMaxAge(30*60);
response.addCookie(userCookie);
response.sendRedirect("html/webpages/index.html");
statement.close();
response.sendRedirect("html/webpages/index.jsp");
} else {
statement.close();
response.sendRedirect("index.jsp");
}
Expand Down
8 changes: 7 additions & 1 deletion src/database/MySQLAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ public RentedDevice[] getUserDevices(String userID) throws SQLException, ClassNo
counter++;
}

stmt.close();
connect.close();

return devices;
}

Expand All @@ -258,6 +261,8 @@ public ListedDevice[] getAllDevices() throws SQLException, ClassNotFoundExceptio
counter++;
}

stmt.close();
connect.close();
return devices;
}

Expand All @@ -281,7 +286,8 @@ public void returnDevices(String devices) throws ClassNotFoundException, SQLExce
//update statement
stmt.executeUpdate("UPDATE devices SET Status = \"Returning\" WHERE Device_ID = " + deviceArray[i]);
}
System.out.println("\nUpdates complete\n");
stmt.close();
connect.close();
}

/**
Expand Down

0 comments on commit 0a91d1b

Please sign in to comment.