Skip to content

Commit

Permalink
So much refactoring
Browse files Browse the repository at this point in the history
MySQLAccess is now split up into many smaller classes in the database
package, and I updated all MySQLAccess references to the appropriate new
class.

Killed navbar.js. All .html pages are now .jsp pages so that they can
<%@include file navbar.html%>
  • Loading branch information
arc12012 committed Apr 1, 2017
1 parent bc2bd0c commit 7b24880
Show file tree
Hide file tree
Showing 25 changed files with 736 additions and 738 deletions.
6 changes: 3 additions & 3 deletions WebContent/adminLogin.jsp
Original file line number Diff line number Diff line change
@@ -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.*" %>
Expand All @@ -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 + "'");
Expand All @@ -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");
Expand Down
5 changes: 2 additions & 3 deletions WebContent/html/javascript/listing.jsp
Original file line number Diff line number Diff line change
@@ -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"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
Expand All @@ -8,8 +8,7 @@
</head>
<body>
<%
MySQLAccess myaccess = new MySQLAccess();
ListedDevice[] mydevices = myaccess.getAllDevices();
ListedDevice[] mydevices = DeviceQueries.getAllDevices();
//string representation of array.
String deviceString = ListedDevice.arrayToString(mydevices);
Expand Down
2 changes: 0 additions & 2 deletions WebContent/html/javascript/navbar.js

This file was deleted.

5 changes: 2 additions & 3 deletions WebContent/html/javascript/request.jsp
Original file line number Diff line number Diff line change
@@ -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"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
Expand All @@ -8,8 +8,7 @@
</head>
<body>
<%
MySQLAccess myaccess = new MySQLAccess();
ListedDevice[] mydevices = myaccess.getAllDevices();
ListedDevice[] mydevices = DeviceQueries.getAllDevices();
//string representation of array.
String deviceString = ListedDevice.arrayToString(mydevices);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">

<title>Synchrony Financial</title>

<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">
<style>
div.deviceContainer {
border: solid;
border-width: thin;
padding: 15px;
background-color: #E9EAEB;
display: inline-block;
}

div.imgContainer {
display: inline-block;
text-align: center;
}

img.device {
display: block;
}

div.deviceDescp {
display: inline-block;
width: 200px;
text-align: center;
}

button.approvebutton {
display: block;
margin: auto;
}

div.approveConfirm {
display: none;
top: 50%;
left: 50%;
position: fixed;
width: 155px;
height: 85px;
line-height: 85px;
text-align: center;
background-color: #FBC600;
border: solid;
border-color: #3B3C43;
border-radius: 5px;
}

</style>
</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
</nav>

<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="../webpages/adminApprove.html">Approve Devices</a></li>
<li class="option"><a href="#">Manage Admins</a></li>
<li class="option"><a href="#">Manage Devices</a></li>
</ul>
</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/navbar.js"></script>
<script src="../javascript/nhpup_1.1.js"></script>
</body>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">

<title>Synchrony Financial</title>

<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">
<style>
div.deviceContainer {
border: solid;
border-width: thin;
padding: 15px;
background-color: #E9EAEB;
display: inline-block;
}
div.imgContainer {
display: inline-block;
text-align: center;
}
img.device {
display: block;
}
div.deviceDescp {
display: inline-block;
width: 200px;
text-align: center;
}
button.approvebutton {
display: block;
margin: auto;
}
div.approveConfirm {
display: none;
top: 50%;
left: 50%;
position: fixed;
width: 155px;
height: 85px;
line-height: 85px;
text-align: center;
background-color: #FBC600;
border: solid;
border-color: #3B3C43;
border-radius: 5px;
}
</style>
</head>

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

<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<h4>Admin Options</h4>
<li class="option"><a href="../webpages/adminApprove.html">Approve Devices</a></li>
<li class="option"><a href="#">Manage Admins</a></li>
<li class="option"><a href="#">Manage Devices</a></li>
</ul>
</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>
</body>
</html>
Loading

0 comments on commit 7b24880

Please sign in to comment.