Skip to content

Bug #84

Merged
merged 6 commits into from Apr 7, 2017
Merged

Bug #84

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 1 addition & 17 deletions WebContent/html/css/stylesheet.css
Expand Up @@ -14,7 +14,6 @@ div.sidebar{
border-right-style: solid;
height: 100vh;
background-color: #E9EAEB;
width: 300px;
position: fixed;
}

Expand Down Expand Up @@ -59,7 +58,7 @@ div.modal-content{
padding: 10px;
border: 1px solid #888;
width: 80%;
max-height: 80%;
max-height: 100%;
text-align: center;
vertical-align: center;
align-items: center;
Expand All @@ -70,21 +69,6 @@ div.modal-body{
overflow: auto;
}

input[type=text]{
margin: 0 auto;
width: 60%;
}

input[type=tel]{
margin: 0 auto;
width: 60%;
}

input[type=number]{
margin: 0 auto;
width: 60%;
}

textarea{
margin: 0 auto;
}
Expand Down
37 changes: 0 additions & 37 deletions WebContent/html/javascript/profileIcon.js

This file was deleted.

86 changes: 0 additions & 86 deletions WebContent/html/javascript/profileSettings.js

This file was deleted.

40 changes: 9 additions & 31 deletions WebContent/html/javascript/request.jsp
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<%
Device[] mydevices = DeviceQueries.getAllDevices();
Device[] mydevices = DeviceQueries.getAvailableDevices();
//string representation of array.
String deviceString = Device.arrayToString(mydevices);
//out.println(description);
Expand All @@ -21,35 +21,6 @@ var devices = makeDeviceArray();
//get all the option buttons
var hardwareOptions = document.getElementsByClassName('hw-data-type');
var softwareOptions = document.getElementsByClassName('sw-data-type');
function ajaxFunction(){
var request;
try {
request = new XMLHttpRequest();
}
catch(e){
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try {
request = new ActiveXObject(Microsoft.XMLHTTP);
} catch(e) {
alert("Something is wrong with your browser");
return false;
}

}
}


request.onreadystatechange = function(){
if(request.readyState == 4){
var display = document.getElementById('ajaxDiv');
display.innerHTML = request.responseText;
}
}

}
//add event listeners to the options in the left sidebar
for(var a = 0; a < hardwareOptions.length; a++){
hardwareOptions[a].addEventListener('click', refresh);
Expand Down Expand Up @@ -179,7 +150,8 @@ function addToCart(){
if(!inCart(id)){ //if not in the cart
var cart = getCartItems(); //this is an array
id = parseInt(id,10); //this gets just the numerical value from the id!
cart.push(devices[id - 1]); //push to bottom of cart
var device = getDevice(id);
cart.push(device); //push to bottom of cart
localStorage.setItem('cart', JSON.stringify(cart));
$('#added').fadeIn(1000);
$('#added').fadeIn(1000);
Expand Down Expand Up @@ -218,6 +190,12 @@ function makeDeviceArray(){
window.json = '<%=deviceString%>';
return JSON.parse(window.json);
}
function getDevice(id){
for(var i = 0; i < devices.length; i++){
if(id == devices[i].id)
return devices[i];
}
}
//this code allows a message to appear that indicates that the item was successfully placed in the shopping cart.
</script>
<script src="../javascript/lib/fuzzy.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/admin.jsp
Expand Up @@ -67,7 +67,7 @@ div.approveConfirm {

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

<div class="col-sm-3 col-md-2 sidebar">
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/adminApprove.jsp
Expand Up @@ -80,7 +80,7 @@
</head>

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

Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/adminDeviceSettings.jsp
Expand Up @@ -68,7 +68,7 @@ pageEncoding="ISO-8859-1"%>
</style>
<!-- Header -->
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.html"%>
<%@ include file="navbar.jsp"%>
</nav>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/adminLocation.jsp
Expand Up @@ -42,7 +42,7 @@
</style>
<!-- Header -->
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.html"%>
<%@ include file="navbar.jsp"%>
</nav>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/index.jsp
Expand Up @@ -42,7 +42,7 @@
<body>

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

<div class = "menuBox">
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/listingPage.jsp
Expand Up @@ -51,7 +51,7 @@

<body>
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal">
<%@ include file="navbar.html"%>
<%@ include file="navbar.jsp"%>
</nav>
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
Expand Down
4 changes: 2 additions & 2 deletions WebContent/html/webpages/locationRedirect.jsp
Expand Up @@ -20,7 +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.html"%>
<%@ include file="navbar.jsp"%>
</nav>
</head>
<body>
Expand All @@ -36,7 +36,7 @@ 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);
Location location = new Location(name,address,town,state,zip,0);
LocationQueries.addLocation(location);
}
//modify form was submitted
Expand Down
2 changes: 1 addition & 1 deletion WebContent/html/webpages/map.jsp
Expand Up @@ -37,7 +37,7 @@
<body>

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

<h2>Our Wonderful Synchrony Financial Map!</h2>
Expand Down
@@ -1,3 +1,5 @@
<%@ page import = "database.*,entities.User" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand All @@ -7,7 +9,9 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../webpages/admin.jsp">
<img src="../imgs/synchrony-financial-logo-dlpx_1.png" style = "height: 100%;">
<img src="../imgs/synchrony-financial-logo-dlpx_1.png" style = "height: 100%; display: inline-block;">
&nbsp;&nbsp;&nbsp;&nbsp;
<p style = "display: inline-block" id = "user"></p>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse" aria-expanded="false">
Expand All @@ -19,4 +23,20 @@
<li><a href="shoppingCart.jsp">Shopping Cart</a></li>
</ul>
</div>
<%
Cookie[] usercookies = request.getCookies();
int navsso = 0;
for(Cookie c : usercookies){
if(c.getName().equals("ssoNum")){
navsso = Integer.parseInt(c.getValue());
break;
}
}
User self = EmployeeQueries.getEmployeeByID(navsso);
String navname = self.getName();
%>
</div>
<script>
var name = '<%=navname%>';
document.getElementById('user').innerHTML = "Hi " + name + "!";
</script>