Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #2 from donalus/master #83

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
115 changes: 114 additions & 1 deletion assignment_1/table_manager.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
<html>
<head>
<title>INST377: Assignment 1</title>
<!-- CSS -->
<style type="text/css">
div {
margin-bottom: 20px;
}
h1 {
text-align: center;
font-family: sans-serif;
font-size: 55px;
color: coral;
text-decoration: underline;
}
h2 {
text-align: center;
font-family: sans-serif;
font-size: 30px;
color: steelblue;
text-decoration:overline underline;
}
table {
font-family: sans-serif;
width: 750px;
border: 3px solid;
border-collapse: collapse;
}
#qnatable {
margin: auto;
}
th {
text-align: center;
text-decoration: underline;
border: 3px solid;
padding: 10px 10px 10px 10px;
}
td {
text-align: left;
border: 3px solid;
padding: 10px 10px 10px 10px;
}
table tr:nth-child(odd) {
background-color: mediumspringgreen;
}
</style>

<!-- Data -->
Expand Down Expand Up @@ -200,7 +238,38 @@

<body>
<!-- Feel free to add empty tags. Data shouldn't be here. -->
<div id="org_table"></div>
<div id="org_table"></div>

<h1>Assignment 1: Javascript</h1>

<h2>by Lyndon Ross II</h2>

<table id="qnatable">
<tr>
<th>Organization Summary Questions</th>
<th>Amount</th>
</tr>
<tr>
<td>How many non-profit organizations are listed?</td>
<td id="question1"></td>
</tr>
<tr>
<td>How many organizations are less than 10 years old?</td>
<td id="question2"></td>
</tr>
<tr>
<td>How many of these organizations are North American?</td>
<td id="question3"></td>
</tr>
<tr>
<td>How many organizations used the 'Transportation' type of data?</td>
<td id="question4"></td>
</tr>
<tr>
<td>How many organizations are located in ciites that do no belong to a State/Region?</td>
<td id="question5"></td>
</tr>
</table>

<script>
// outputs the first item of the organizations array. Just for testing.
Expand All @@ -209,8 +278,52 @@

// Your JavaScript code goes here

// counter variables for each of the questions
var non_profit = 0;
var under10 = 0;
var nAmerica = 0;
var transpo = 0;
var noState = 0;

// Loop that iterates through the entire index
for(var x=0; x < organizations.length; x++) {
// conditionals
if(organizations[x]["Organization Type"] === "Nonprofit") {
non_profit++;
document.getElementById("question1").innerHTML = "There are <b><u>" + non_profit + "</u></b> non-profit organizations.";
}

if(2018 - organizations[x]["Founding Year"] < 10) {
under10++;
document.getElementById("question2").innerHTML = "There are <b><u>" + under10 + "</u></b> organizations that are less than 10 years old.";
}

if(organizations[x].Region === "North America") {
nAmerica++;
document.getElementById("question3").innerHTML = "There are <b><u>" + nAmerica + "</u></b> organizations in the North American region.";
}

if(organizations[x]["Type of Data Used"].search("Transportation") > -1) {
transpo++;
document.getElementById("question4").innerHTML = "There are <b><u>" + transpo + "</u></b> organizations that use 'Transportation' type data.";
}

if(organizations[x]["State/Region"] === "") {
noState++;
document.getElementById("question5").innerHTML = "There are <b><u>" + noState + "</u></b> organizations that are located in cities that do not belong to a State/Region.";
}

}
console.log(non_profit);
console.log(under10);
console.log(nAmerica);
console.log(transpo);
console.log(noState);


</script>



</body>
</html>
1 change: 1 addition & 0 deletions html_css/external.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
h2 { text-align: center; color: darkmagenta}
Binary file added html_css/images/HTML5_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions html_css/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>377 World</title>
<link href="external.css" type="text/css" rel="stylesheet">
<style>
p { color: green; font-size: 16px}
</style>
</head>
<body> <!-- you's a hoeee! -->
<h1>Hello World!</h1>
<p><i>This is INST377 and we are learning HTML &amp; CSS.</i></p>
<h2>Translations of Greetings</h2>
<p>English: Hello World.</p>
<p>Hawaiian: Aloha Houna</p>
<p>Luxembourgish: Moien Welt</p>
<p>Swahili: Salamu Dunia</p>
<ul style="color: gold">
<li>English: Hello World.</li>
<li>Hawaiian: Aloha Houna</li>
<li>Luxembourgish: Moien Welt</li>
<li>Swahili: Salamu Dunia</li>
</ul>
<ol style="color: skyblue">
<li>English: Hello World.</li>
<li>Hawaiian: Aloha Houna</li>
<li>Luxembourgish: Moien Welt</li>
<li>Swahili: Salamu Dunia</li>
</ol>
<img scr="/images/HTML5_logo.png" alt="HTML5 Logo" />
</body>
</html>
8 changes: 7 additions & 1 deletion php_databases/db_demo/organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,15 @@ static function fetchTotalCount(mysqli $conn) {

// TODO #1: Implement a function to save an new organization
// return number of rows inserted

public function insert(mysqli $conn) {
$stmt = $conn->prepare("INSERT INTO")
}

// TODO #2: Implement a function to delete an organization.
// return number of rows deleted
public function delete(mysqli $conn) {

}

// TODO #3: Implement a function to save changes to an existing organization
// return number of rows updated
Expand Down