Skip to content

Commit

Permalink
Couple temp fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
clj13001 committed Apr 17, 2017
1 parent 6cb7e19 commit d2f31f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions WebContent/html/javascript/listing.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function showAll(){
var part1 = "nhpup.popup('";
var part2 = "');"
for(var i = 0; i < devices.length; i++){
html += '<a class = "divlink" href = "#" onmouseover = "'+ part1 + 'Hardware type: ' + devices[i].hardware + '<br><br>' + 'Manufacturer: ' + devices[i].manufacturer + part2 + '"><div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/my-icons-collection-devices/png/' + devices[i].hardware + '.png" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i) + '"></div></div></div></a><br><br>';
html += '<a class = "divlink" href = "#" onmouseover = "'+ part1 + 'Hardware type: ' + devices[i].hardware + '<br><br>' + 'Manufacturer: ' + devices[i].manufacturer + part2 + '"><div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/my-icons-collection-devices/png/' + devices[i].hardware + '.png" onerror="this.src=\'../imgs/synchrony-financial-logo-dlpx_1.png\';" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i) + '"></div></div></div></a><br><br>';
}
document.getElementById('devContainer').innerHTML = html;
var anchors = document.getElementsByClassName('availableAnchor');
Expand Down Expand Up @@ -67,7 +67,7 @@ function show(deviceArray){
var part2 = "');"
for (var i = 0; i < deviceArray.length; i++)
{
html += '<div class = "deviceContainer"><a class = "divlink" href = "#" onmouseover = "'+ part1 + 'Hardware type: ' + deviceArray[i].hardware + '<br><br>' + 'Manufacturer: ' + deviceArray[i].manufacturer + part2 + '"><div class = "imgContainer"><img src="../imgs/my-icons-collection-devices/png/' + deviceArray[i].hardware + '.png" class = "device">' + deviceArray[i].name + '</div><div class = "deviceDescp"><p>' + deviceArray[i].description + '</p><div class = "availableAnchor" id = "' + (deviceArray[i].id) + '"></div></div></a></div><br><br>'
html += '<div class = "deviceContainer"><a class = "divlink" href = "#" onmouseover = "'+ part1 + 'Hardware type: ' + deviceArray[i].hardware + '<br><br>' + 'Manufacturer: ' + deviceArray[i].manufacturer + part2 + '"><div class = "imgContainer"><img src="../imgs/my-icons-collection-devices/png/' + deviceArray[i].hardware + '.png" onerror="this.src=\'../imgs/synchrony-financial-logo-dlpx_1.png\';" class = "device">' + deviceArray[i].name + '</div><div class = "deviceDescp"><p>' + deviceArray[i].description + '</p><div class = "availableAnchor" id = "' + (deviceArray[i].id) + '"></div></div></a></div><br><br>'
}
document.getElementById('devContainer').innerHTML = html;
var anchors = document.getElementsByClassName('availableAnchor');
Expand Down
29 changes: 14 additions & 15 deletions WebContent/html/javascript/statistics.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ displayData();
function displayData() {
var html = "";
var totalDevices = 0;
var availableDevices;
var loanDevices;
var lostDevices;
var availableDevices=0;
var loanDevices=0;
var lostDevices=0;
//umbrella sections
var pendingDevices;
var unavailDevices;
var returnDevices;
var brokenDevices;
var pendingDevices=0;
var unavailDevices=0;
var returnDevices=0;
var brokenDevices=0;
if (statistics.status != "" && statistics.count != ""){
for (var i = 0; i<statistics.length; i++){
totalDevices = totalDevices + statistics[i].count;
}
//data for info section
availableDevices = statistics[1].count;
loanDevices = statistics[3].count;
lostDevices = statistics[2].count;
returnDevices = statistics[6].count;
availableDevices = statistics[0].count;
loanDevices = statistics[1].count;
//lostDevices = statistics[2].count;
//returnDevices = statistics[6].count;
//umbrella divisions
pendingDevices = statistics[0].count;
unavailDevices = statistics[2].count + statistics[4].count + statistics[5].count;
//pendingDevices = statistics[0].count;
unavailDevices = statistics[2].count;
Expand All @@ -67,8 +67,7 @@ function displayData() {
data.addColumn('string', 'Status');
data.addColumn('number', 'Count');
data.addRows([['Available Devices', availableDevices],['Unavailable Devices',unavailDevices],
['Loaned Devices',loanDevices],['Pending Devices',pendingDevices],
['Broken Devices',lostDevices]]);
['Loaned Devices',loanDevices]]);
// Set chart options
var options = {'title':'Chart of Devices',
Expand Down

0 comments on commit d2f31f3

Please sign in to comment.