Skip to content

Commit

Permalink
Website Reorganization
Browse files Browse the repository at this point in the history
Files are more organized now
  • Loading branch information
clj13001 committed Apr 15, 2017
1 parent 410de8b commit 048eabc
Show file tree
Hide file tree
Showing 26 changed files with 240 additions and 165 deletions.
4 changes: 2 additions & 2 deletions WebContent/adminLogin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ if (result.next()){
if(result.getInt("Password_Flag") == 1){
stmt.close();
connection.close();
response.sendRedirect("html/webpages/admin.jsp");
response.sendRedirect("html/webpages/administration/admin.jsp");
return;
}
else{
stmt.close();
connection.close();
response.sendRedirect("html/webpages/adminpassword.jsp");
response.sendRedirect("html/webpages/administration/adminpassword.jsp");
return;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/stylesheet.css">
<link rel="stylesheet" type="text/css" href="../../css/stylesheet.css">
<link rel="shortcut icon"
href="../imgs/synchrony-financial-logo-dlpx_1.ico">
href="../../imgs/synchrony-financial-logo-dlpx_1.ico">
<style>
div.deviceContainer {
border: solid;
Expand Down Expand Up @@ -67,25 +67,19 @@ div.approveConfirm {

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
<%@ include file="../components/adminnavbar.jsp"%>
</nav>

<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="adminApprove.jsp">Approve Devices</a></li>
<!-- will add in when maegan is done <li class="option"><a href="#">Manage Admins</a></li> -->
<li class="option"><a href="adminDeviceSettings.jsp">Manage Devices</a></li>
<li class="option"><a href="adminLocation.jsp">Manage Locations</a></li>
</ul>
<%@ include file="../components/adminsidebar.jsp" %>
</div>
<div class="displayDevice">
<h2>Welcome to the admin page</h2>
<div id="admin"></div>
</div>


<script src="../javascript/admin.js"></script>
<script src="../javascript/nhpup_1.1.js"></script>
<script src="../../javascript/admin.js"></script>
<script src="../../javascript/nhpup_1.1.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel = "stylesheet" type = "text/css" href = "../css/stylesheet.css">
<link rel = "shortcut icon" href = "../imgs/synchrony-financial-logo-dlpx_1.ico">
<link rel = "stylesheet" type = "text/css" href = "../../css/stylesheet.css">
<link rel = "shortcut icon" href = "../../imgs/synchrony-financial-logo-dlpx_1.ico">
<style>
div.deviceContainer{
border: solid;
Expand Down Expand Up @@ -82,17 +82,11 @@

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
<%@ include file="../components/adminnavbar.jsp"%>
</nav>

<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="adminApprove.jsp">Approve Devices</a></li>
<!-- will add in when maegan is done <li class="option"><a href="#">Manage Admins</a></li> -->
<li class="option"><a href="adminDeviceSettings.jsp">Manage Devices</a></li>
<li class="option"><a href="adminLocation.jsp">Manage Locations</a></li>
</ul>
<%@ include file="../components/adminsidebar.jsp" %>
</div>

<!-- Modal for choosing ticket action. -->
Expand All @@ -104,7 +98,7 @@
</div><br>
<div class="modal-body">
<!-- Where new information is added. -->
<form ACTION = "ticketAdminRedirect.jsp" METHOD = "POST">
<form ACTION = "../redirect/ticketAdminRedirect.jsp" METHOD = "POST">
<table style = 'margin: 0 auto;' class="table table-bordered table-hover">
<thead>
<tr>
Expand Down Expand Up @@ -147,16 +141,17 @@
</table>
</div>

<%TicketQueries query = new TicketQueries();
Ticket[] tickets = query.getTickets();
User[] users = EmployeeQueries.getAllUsers();
Location[] locations = LocationQueries.getAllLocations();
Device[] devices = DeviceQueries.getAllDevices();
String ticketStr = Ticket.arrayToString(tickets);
String userStr = User.arrayToString(users);
String locationStr = Location.arrayToString(locations).replace("'","\\'");
String deviceStr = Device.arrayToString(devices);
%>
<%
TicketQueries query = new TicketQueries();
Ticket[] tickets = query.getTickets();
User[] users = EmployeeQueries.getAllUsers();
Location[] locations = LocationQueries.getAllLocations();
Device[] devices = DeviceQueries.getAllDevices();
String ticketStr = Ticket.arrayToString(tickets);
String userStr = User.arrayToString(users);
String locationStr = Location.arrayToString(locations).replace("'","\\'");
String deviceStr = Device.arrayToString(devices);
%>

<script>
window.json = '<%=ticketStr%>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ pageEncoding="ISO-8859-1"%>
<meta name="author" content="">

<title>Synchrony Financial</title>

<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel = "stylesheet" type = "text/css" href = "../css/stylesheet.css">
<link rel = "shortcut icon" href = "../imgs/synchrony-financial-logo-dlpx_1.ico">
<!-- Can later determine which style tags are not needed! -->
<link rel = "stylesheet" type = "text/css" href = "../../css/stylesheet.css">
<link rel = "shortcut icon" href = "../../imgs/synchrony-financial-logo-dlpx_1.ico">
<style>
/* Elements inside forms */
.form-control{
Expand Down Expand Up @@ -68,19 +65,13 @@ pageEncoding="ISO-8859-1"%>
</style>
<!-- Header -->
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
<%@ include file="../components/adminnavbar.jsp"%>
</nav>
</head>
<body>
<!-- Side bar -->
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="adminApprove.jsp">Approve Devices</a></li>
<!-- will add in when maegan is done <li class="option"><a href="#">Manage Admins</a></li> -->
<li class="option"><a href="adminDeviceSettings.jsp">Manage Devices</a></li>
<li class="option"><a href="adminLocation.jsp">Manage Locations</a></li>
</ul>
<%@ include file = "../components/adminsidebar.jsp" %>
</div>

<!-- Modal for adding new device. -->
Expand All @@ -92,7 +83,7 @@ pageEncoding="ISO-8859-1"%>
</div><br>
<div class="modal-body">
<!-- Where new information is added. -->
<form ACTION = "deviceRedirect.jsp" METHOD = "POST">
<form ACTION = "../redirect/deviceRedirect.jsp" METHOD = "POST">
<div class = "form-group">
<label for="addName">Device Name *</label>
<input style = "width: 150px;" name = "name" class="form-control" id="addName" placeholder="Device Name" required = "true">
Expand Down Expand Up @@ -147,7 +138,7 @@ pageEncoding="ISO-8859-1"%>
</div><br>
<div class="modal-body">
<!-- Where information is modified. -->
<form ACTION = "deviceRedirect.jsp" METHOD = "POST">
<form ACTION = "../redirect/deviceRedirect.jsp" METHOD = "POST">
<div class = "form-group">
<label for="modifyName">Device Name *</label>
<input style = "width: 150px;" name = "name" class="form-control" id="modifyName" placeholder="Device Name" required = "true">
Expand Down Expand Up @@ -252,7 +243,6 @@ populateDevices(devices);
//adds event listeners to all table records
$("tr.entry").click(modifyModal);
//Exits modal when x is clicked.
$("#closeModifyForm").click(closeModifyModal);
//Open the add modal
Expand All @@ -263,6 +253,7 @@ $("#closeAddForm").click(closeAddModal);
window.onkeydown = function(e){if (e.keyCode == 27){closeAddModal();closeModifyModal();}}
//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();}}
//set up options in modals
var manuHTML = '<option value="" disabled selected>Choose Manufacturer</option>';
var hardwareHTML = '<option value="" disabled selected>Choose Hardware</option>';
Expand Down Expand Up @@ -430,6 +421,7 @@ function modifyModal(){
if(id == devices[i].id)
break;
}
//autofill modal
$("#modifyName").val(devices[i].name.replace(/&quot;/g,"\""));
$("#modifyDesc").val(devices[i].description.replace(/&quot;/g,"\""));
$("#modifyAvailability").val(devices[i].status);
Expand All @@ -443,10 +435,12 @@ function modifyModal(){
$("#modifyModal").show();
}
//close modify modal
function closeModifyModal(){
$("#modifyModal").hide();
}
//find if a string is in the array
function findInArray(string,array){
if (array.length == 0)
return false
Expand All @@ -458,6 +452,6 @@ function findInArray(string,array){
}
</script>
<script src="../javascript/lib/fuzzy.js"></script>
<script src="../../javascript/lib/fuzzy.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
<meta name="author" content="">

<title>Synchrony Financial</title>

<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel = "stylesheet" type = "text/css" href = "../css/stylesheet.css">
<link rel = "shortcut icon" href = "../imgs/synchrony-financial-logo-dlpx_1.ico">
<!-- Can later determine which style tags are not needed! -->
<link rel = "stylesheet" type = "text/css" href = "../../css/stylesheet.css">
<link rel = "shortcut icon" href = "../../imgs/synchrony-financial-logo-dlpx_1.ico">
<style>
/* Elements inside forms */
.form-control{
margin: auto;
text-align: center;
Expand All @@ -42,31 +39,25 @@
</style>
<!-- Header -->
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.jsp"%>
<%@ include file="../components/adminnavbar.jsp"%>
</nav>
</head>
<body>
<!-- Sidebar -->
<!-- Side bar -->
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="adminApprove.jsp">Approve Devices</a></li>
<!-- will add in when maegan is done <li class="option"><a href="#">Manage Admins</a></li> -->
<li class="option"><a href="adminDeviceSettings.jsp">Manage Devices</a></li>
<li class="option"><a href="adminLocation.jsp">Manage Locations</a></li>
</ul>
</div>
<%@ include file="../components/adminsidebar.jsp" %>
</div>

<!-- Modal for adding new location. -->
<div id="addModal" class="modal">
<div class="modal-content">
<div class="modal-head">
<span id="closeAddForm" class="close">&times;</span>
<h4>Add a New Location Below<h4>
<h4>Add a New Location Below</h4>
</div><br>
<div class="modal-body">
<!-- Where new information is added. -->
<form ACTION = "locationRedirect.jsp" METHOD = "POST">
<form ACTION = "../redirect/locationRedirect.jsp" METHOD = "POST">
<div class = "form-group">
<label for="addName">Location Name *</label>
<input style = "width: 150px;" name = "name" class="form-control" id="addName" placeholder="Location Name" required = "true">
Expand Down Expand Up @@ -151,11 +142,11 @@
<div class="modal-content">
<div class="modal-head">
<span id="closeModifyForm" class="close">&times;</span>
<h4>Modify Location Below<h4>
<h4>Modify Location Below</h4>
</div><br>
<div class="modal-body">
<!-- Where information is modified. -->
<form ACTION = "locationRedirect.jsp" METHOD = "POST">
<form ACTION = "../redirect/locationRedirect.jsp" METHOD = "POST">
<div class = "form-group">
<label for="modifyName">Location Name *</label>
<input style = "width: 150px;" name = "name" class="form-control" id="modifyName" required = "true">
Expand Down Expand Up @@ -238,10 +229,9 @@
</div>
</div>
</div>
<!-- Body where locations are displayed -->
<div class = "displayDevice">
<!-- Main body! -->
<h2>Location Listing</h2>
<!-- Location information placed here. -->
<table class="table table-bordered table-hover" id = "tabledisplay">
<thread>
<tr>
Expand All @@ -252,14 +242,15 @@
<th>Zip Code</th>
</tr>
</thread>
<!-- Location information placed here. -->
<tbody id="tablebodymain">
</tbody>
</table>
<button id ="add" class="btn btn-primary">Add Location</button>
</div>
<%
//database query
//database query to get locations that all employees can access
Location[] locations = LocationQueries.getAdminLocations();
//string representation of array.
String locationString = Location.arrayToString(locations);
Expand Down Expand Up @@ -318,13 +309,15 @@ function modifyModal(){
if(id == locations[i].id)
break;
}
//autofill all information from what you clicked on into modal
$("#modifyName").val(locations[i].name.replace(/&quot;/g,"\""));
$("#modifyAddress").val(locations[i].address.replace(/&quot;/g,"\""));
$("#modifyTown").val(locations[i].town.replace(/&quot;/g,"\""));
$("#modifyState").val(locations[i].state);
$("#modifyZip").val(locations[i].zip);
$("#modifyID").val(locations[i].id);
//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!');
Expand All @@ -336,11 +329,11 @@ function modifyModal(){
$("#modifyModal").show();
}
//close the modify modal
function closeModifyModal(){
$("#modifyModal").hide();
}
</script>
<!-- Navbar generation. -->
</body>
</html>
Loading

0 comments on commit 048eabc

Please sign in to comment.