aboutsummaryrefslogtreecommitdiffstats
path: root/csci4131/hw7/public
diff options
context:
space:
mode:
Diffstat (limited to 'csci4131/hw7/public')
-rw-r--r--csci4131/hw7/public/addContact.html106
-rw-r--r--csci4131/hw7/public/contacts.html78
-rw-r--r--csci4131/hw7/public/stock.html1
3 files changed, 0 insertions, 185 deletions
diff --git a/csci4131/hw7/public/addContact.html b/csci4131/hw7/public/addContact.html
deleted file mode 100644
index 629f9b2..0000000
--- a/csci4131/hw7/public/addContact.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!doctype html>
-<html lang="en">
-
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <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>
- </head>
-
- <body>
- <nav class="navbar navbar-default">
- <div class="container-fluid">
- <ul class="nav navbar-nav">
- <li><a href="/"><b>Home</b></a></li>
- <li><a href="contacts"><b>Contacts</b></a></li>
- <li><a href="addContact"><b>Add Contact</b></a></li>
- <li><a href="stock"><b>Stock Page</b></a></li>
- <li><a href="logout"><b>Logout</b></a></li>
- </ul>
- </div>
- </nav>
- <br><br>
-
- <div class="container">
- <div class="row">
- <p><br /></p>
- </div>
-
- <div class="row">
- <div class="col-md-4"></div>
- <div class="col-md-4">
- <div class="panel panel-default">
- <form name="addContact" method="post" action="/api/addContact">
- <p></p>
- <table class="table table-bordered table-hover">
- <tbody>
- <tr>
- <td class="col-md-6">Name</td>
- <td class="col-md-6">
- <div class="form-group">
- <input type="text" class="form-control" name="name" required>
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6">Category</td>
- <td class="col-md-6">
- <div class="form-group">
- <select class="form-control" name="category">
- <option>Personal</option>
- <option>Academic</option>
- <option>Industry</option>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6">Location</td>
- <td class="col-md-6">
- <div class="form-group">
- <input type="text" class="form-control" name="location" required>
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6">Contact Information</td>
- <td class="col-md-6">
- <div class="form-group">
- <input type="text" class="form-control" name="contact" required>
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6">Email</td>
- <td class="col-md-6">
- <div class="form-group">
- <input type="email" class="form-control" name="email" required>
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6">Website Name</td>
- <td class="col-md-6">
- <div class="form-group">
- <input type="url" class="form-control" name="website_name" required maxlength="100">
- </div>
- </td>
- </tr>
- <tr>
- <td class="col-md-6"></td>
- <td class="col-md-6">
- <input type="submit" value="Submit">
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
- </div>
- <div class="col-md-4"></div>
- </div>
- </div>
- </body>
-</html>
diff --git a/csci4131/hw7/public/contacts.html b/csci4131/hw7/public/contacts.html
deleted file mode 100644
index 5cd2907..0000000
--- a/csci4131/hw7/public/contacts.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <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>
- <script type="text/javascript" defer>
- //Get JSON
- var xmlhttp = new XMLHttpRequest();
- var url = "api/contacts";
- xmlhttp.onreadystatechange = function () {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var parse = JSON.parse(xmlhttp.responseText);
- process(parse);
- }
- }
- xmlhttp.open("GET", url, true);
- xmlhttp.send();
-
- function process(a) {
- var table = document.getElementsByTagName("tbody")[0];
- var contacts = a;
- for (let i = 0; i < contacts.length; i++) {
- var contact = contacts[i];
- var row = table.insertRow();
- for (var j in contact) {
- if (j === "contact_id") continue;
- if (j === "website_url") {
- var url = row.insertCell();
- url.innerHTML = "<a href =" + contact[j] + ">" + contact[j] + "</a>";
- } else if (j === "email") {
- var email = row.insertCell();
- email.innerHTML = "<a href =mailto://" + contact[j] + ">" + contact[j] + "</a>";
- } else {
- var value = row.insertCell();
- value.innerHTML = contact[j];
- }
- }
- }
- }
-
- </script>
- </head>
- <body>
- <nav class="navbar navbar-default">
- <div class="container-fluid">
- <ul class="nav navbar-nav">
- <li><a href="/"><b>Home</b></a></li>
- <li><a href="contacts"><b>Contacts</b></a></li>
- <li><a href="addContact"><b>Add Contact</b></a></li>
- <li><a href="stock"><b>Stock Page</b></a></li>
- <li><a href="logout"><b>Logout</b></a></li>
- </ul>
- </div>
- </nav>
- <br><br>
-
- <div class="container">
- <table class="table" id="contactsTable">
- <thead>
- <tr>
- <th scope="col">Name</th>
- <th scope="col">Category</th>
- <th scope="col">Location</th>
- <th scope="col">Contact Information</th>
- <th scope="col">Email</th>
- <th scope="col">Website <br> (URL) </th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </div>
- <script type="text/javascript">
-
- </script>
- </body>
-</html>
diff --git a/csci4131/hw7/public/stock.html b/csci4131/hw7/public/stock.html
index d63b233..ae9d077 100644
--- a/csci4131/hw7/public/stock.html
+++ b/csci4131/hw7/public/stock.html
@@ -28,7 +28,6 @@
<ul class="nav navbar-nav">
<li><a href="/"><b>Home</b></a></li>
<li><a href="contacts"><b>Contacts</b></a></li>
- <li><a href="addContact"><b>Add Contact</b></a></li>
<li><a href="stock"><b>Stock Page</b></a></li>
<li><a href="logout"><b>Logout</b></a></li>
</ul>