Skip to content

Bris branch #7

Merged
merged 2 commits into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
65 changes: 36 additions & 29 deletions WebContent/html/javascript/listing.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
//get all the option buttons
var options = document.getElementsByClassName('option');

var dev0 = {
name: window.myname,
description: window.mydesc,
hardware: window.myhard,
software:"potato"
};

var dev1 = {
name:"George",
description:"George is probably the coolest iPhone to exist. Ever. Point blank, period.",
hardware:"iphone",
software:"apple"
name:"George",
description:"George is probably the coolest iPhone to exist. Ever. Point blank, period.",
hardware:"iphone",
software:"apple"
};

var dev2 = {
name:"Greyson",
description:"Greyson is pretty cool.. I guess.",
hardware:"iphone",
software:"apple"
name:"Greyson",
description:"Greyson is pretty cool.. I guess.",
hardware:"iphone",
software:"apple"
};

var dev3 = {
name:"Linkin Park",
description:'"The hardest part of ending is starting again."',
hardware:"ipad",
software:"apple"
name:"Linkin Park",
description:'"The hardest part of ending is starting again."',
hardware:"ipad",
software:"apple"
};

var dev4 = {
name:"Abercrombie",
description:"To all the people that hated me in high school, I have the prettiest clothes you all wear now!!",
hardware:"ipad",
software:"apple"
name:"Abercrombie",
description:"To all the people that hated me in high school, I have the prettiest clothes you all wear now!!",
hardware:"ipad",
software:"apple"
};

var dev5 = {
name:"Hulk",
description:"Go ahead and HULK SMASH! this awesome computer stick into your USB.",
hardware:"computerStick",
software:"intel"
name:"Hulk",
description:"Go ahead and HULK SMASH! this awesome computer stick into your USB.",
hardware:"computerStick",
software:"intel"
};

var dev6 = {
name:"Captain America",
description:'"Make America Great Again. Wait, thats someone else.."',
hardware:"computerStick",
software:"intel"
name:"Captain America",
description:'"Make America Great Again. Wait, thats someone else.."',
hardware:"computerStick",
software:"intel"
};

var devices = [dev1, dev2, dev3, dev4, dev5, dev6];
var devices = [dev0, dev1, dev2, dev3, dev4, dev5, dev6];
options[0].addEventListener('click', showAll);
for(var a = 1; a < options.length; a++){
options[a].addEventListener('click', show);
Expand All @@ -53,11 +60,11 @@ showAll();

function showAll(){
var html = '';

for(var i = 0; i < devices.length; i++){
html += '<div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/' + devices[i].hardware + '.png" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i+1) + '"></div></div></div><br><br>';
}

document.getElementById('devContainer').innerHTML = html;

var unavailable = getUnavailableItems();
Expand All @@ -81,13 +88,13 @@ function showAll(){
function show(){
var type = this.getAttribute('data-type');
var html = '';

for(var i = 0; i < devices.length; i++){
if(type.localeCompare(devices[i].hardware) == 0 || type.localeCompare(devices[i].software) == 0){
html += '<div class = "deviceContainer"><div class = "imgContainer"><img src="../imgs/' + devices[i].hardware + '.png" class = "device">' + devices[i].name + '</div><div class = "deviceDescp"><p>' + devices[i].description + '</p><div class = "availableAnchor" id = "' + (i+1) + '"></div></div></div><br><br>'
}
}

document.getElementById('devContainer').innerHTML = html;

var unavailable = getUnavailableItems();
Expand Down
29 changes: 29 additions & 0 deletions WebContent/html/javascript/request.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
//get all the option buttons
var options = document.getElementsByClassName('option');

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;
}
}

}
var dev1 = {
id: 1,
name:"George",
Expand Down
19 changes: 18 additions & 1 deletion WebContent/index.jsp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%@ page import = "database.MySQLAccess" %>
<%@ 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">
Expand All @@ -7,6 +8,22 @@
<title>Insert title here</title>
</head>
<body>

<%
MySQLAccess myaccess = new MySQLAccess();
myaccess.connectDB();
String name = myaccess.getResult()[0][0];
String description = myaccess.getResult()[0][1];
String hardware = myaccess.getResult()[0][2];
out.println(name);
out.println(description);
out.println(hardware);
%>
<script type=text/javascript>
(function(){
window.myname = "<%=name%>";
window.mydesc = "<%=description%>";
window.myhard = "<%=hardware%>";
})();
</script>
</body>
</html>
Binary file modified db/Workbench Schema.mwb
Binary file not shown.
Binary file modified db/Workbench Schema.mwb.bak
Binary file not shown.
Binary file added db/seniordesign.mwb
Binary file not shown.
Loading