Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kcalmes/a-team
base: 9a1ff42944
...
head fork: kcalmes/a-team
compare: master
  • 17 commits
  • 25 files changed
  • 0 commit comments
  • 3 contributors
View
2  addResource.html
@@ -3,7 +3,7 @@
<title>Add a new Resource</title>
<script type="text/javascript">
function sendData() {
- var url = "addWebsite.php";
+ var url = "http://williamsware.com/cs/new/addWebsite.php";
var urlInput = document.getElementById("url").value;
var title = document.getElementById("title").value;
var tags = document.getElementById("tags").value;
View
30 css/custom.css
@@ -87,7 +87,7 @@
#main-content{
/*background-color: black;*/
- margin-bottom: 70px;
+ margin-bottom: 90px;
width: 100%;
/*min-height: 570px;*/
position: relative;
@@ -96,9 +96,13 @@
#main-content-login{
/*background-color: black;*/
- width: 100%;
+ bottom: 0;
+ left: 0;
min-height: 800px;
- position: relative;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 100%;
z-index: 0;
}
@@ -115,8 +119,28 @@ footer{
footer .form-search{
margin: 0px;
}
+.menu ul li{
+ cursor: pointer;
+}
#doc-upload > * {
display: inline-block;
vertical-align: middle;
+}
+
+#doc-upload .btn {
+ margin-left: 10px;
+}
+
+#edit-btns .btn {
+ width: 100px;
+}
+
+#doc-save {
+ margin-left: 25px;
+}
+
+#resourceList .apt-row:hover {
+ background-color: #C8E5FF;
+ cursor: pointer;
}
View
132 css/dave-custom.css
@@ -1,70 +1,96 @@
-#adv-upcoming {
- background-color: white;
- color: black;
- font-weight: normal;
-}
+@media all {
+
+ #adv-upcoming {
+ background-color: white;
+ color: black;
+ font-weight: normal;
+ }
-#main-content {
- color: black;
-}
+ #main-content {
+ color: black;
+ }
-.table-row {
- /*display: table-row;*/
- padding: 0;
- width: 100%;
-}
+ .table-row {
+ /*display: table-row;*/
+ padding: 0;
+ width: 100%;
+ }
-.acc-row > div,
-.acc-inner-row > div {
- display: inline-block;
- vertical-align: top;
- width: 49%;
-}
+ .acc-row > div,
+ .acc-inner-row > div {
+ display: inline-block;
+ vertical-align: top;
+ width: 49%;
+ }
-.acc-inner-row > div {
- padding: 8px 0;
-}
+ .acc-inner-row > div {
+ padding: 8px 0;
+ }
-.dis-table {
- display: table;
- padding: 8px 15px;
- width: 100%;
-}
+ .dis-table {
+ display: table;
+ padding: 8px 15px;
+ width: 100%;
+ }
-a.acc-row:hover {
- text-decoration: none !important;
-}
+ a.acc-row:hover {
+ text-decoration: none !important;
+ }
-#adv-upcoming tbody tr:hover {
- background-color: #C8E5FF;
- cursor: pointer;
-}
+ #adv-upcoming tbody tr:hover {
+ background-color: #C8E5FF;
+ cursor: pointer;
+ }
-#adv-upcoming tbody tr:active {
- background-color: #7CC1FF;
-}
+ #adv-upcoming tbody tr:active {
+ background-color: #7CC1FF;
+ }
-.apt-selected {
- background-color: #7CC1FF !important;
-}
+ .apt-selected {
+ background-color: #7CC1FF !important;
+ }
-#form-sesh > * {
- display: inline-block;
- vertical-align: top;
-}
+ #form-sesh > * {
+ display: inline-block;
+ vertical-align: top;
+ }
+
+ #netid {
+ /*width: 50%;*/
+ }
-#netid {
- /*width: 50%;*/
+ #manage-recs .btn {
+ width: 115px;
+ }
}
-#menu-depts {
- margin-top: -295px;
+@media (min-width: 979px) {
+
+ #menu-depts {
+ margin-top: -295px;
+ }
+
+ #menu-car {
+ margin-top: -260px;
+ }
+
+ #menu-acad {
+ margin-top: -330px;
+ }
}
-#menu-car {
- margin-top: -260px;
+@media (max-width: 978px) {
+
+ #menu-depts {
+ margin-top: -375px;
+ }
+
+ #menu-car {
+ margin-top: -280px;
+ }
+
+ #menu-acad {
+ margin-top: -390px;
+ }
}
-#menu-acad {
- margin-top: -330px;
-}
View
14 css/theme.css
@@ -7,10 +7,11 @@
}
.header-texture {
position: relative;
-color: white;
+/*color: white;*/
text-align: center;
background-image: url(../img/top_grad.png);
background-size: 100% 100%;
+/*background-repeat: no-repeat;*/
/*box-shadow: 0px 2px 4px #7C7C7C;*/
}
.body-texture {
@@ -72,12 +73,15 @@ background-size: 100% 100%;
#edit-header {
background-image: url(../img/top_grad.png);
- /*background-size: 100% 100%;*/
+ background-size: 100% 100%;
color: white;
height: 70px;
+ left: 0;
padding-top: 10px;
- position: relative;
+ position: fixed;
+ right: 0;
text-align: center;
+ top: 0;
}
#edit-footer {
@@ -91,4 +95,8 @@ background-size: 100% 100%;
position: fixed;
right: 0;
text-align: center;
+}
+
+#main-content.edit-doc {
+ margin-top: 100px;
}
View
6 edit.html
@@ -27,7 +27,7 @@
*/
}
</style>
- <link href="./css/bootstrap-responsive.css" rel="stylesheet">
+ <!--<link href="./css/bootstrap-responsive.css" rel="stylesheet">-->
<link href="./css/theme.css" rel="stylesheet">
<link href="./css/custom.css" rel="stylesheet">
<link href="./css/dave-custom.css" rel="stylesheet">
@@ -49,12 +49,12 @@
<div class="container">
<div class="row">
<div class="span8 offset2">
- <h3>Edit Document</h3>
+ <h3 id="edit-title"></h3>
</div>
</div>
</div>
</div>
- <div id="main-content">
+ <div id="main-content" class="edit-doc">
</div>
<div id="edit-footer">
View
4 index.html
@@ -22,6 +22,7 @@
padding-top: 60px;
padding-bottom: 40px;
*/
+
}
</style>
<script>
@@ -58,7 +59,6 @@
</head>
<body>
-
<div id="main-content-login" class="header-texture">
<div class="login_container">
@@ -70,5 +70,3 @@
</div>
</body>
</html>
->
-</html>
View
58 js/application.js
@@ -45,14 +45,15 @@ $(function(){
$('footer .row').append(html);
});
+ $('body').on('click', '.input-append button', function() {
+ var query = $(this).siblings('input').val()
+ loadDocSearch(query);
+ });
+
$('footer').on('click', '#end-sesh', function() {
$('#end-sesh').remove();
window.location.assign('#advisors');
});
-
- $('.input-append button').click(function() {
- loadDocSearch($(this).siblings('input').val());
- });
});
function clickOnResource(urlToGoTo) {
@@ -75,7 +76,7 @@ function clickOnResource(urlToGoTo) {
}
}
-function loadDocSearch(searchQuery) {
+function loadDocSearch2(searchQuery) {
new EJS({url: './pages/advisors/aResource.ejs'})
.update('content', '../searchService.php?query=' + searchQuery);
}
@@ -86,6 +87,47 @@ function loadDocCategory(searchQuery, headerToClose) {
$('#' + headerToClose).trigger('click');
}
-//24 - 16 - 11
-
-//1250 + 1000
+// A second method for retrieving the stuff from Lawrence's webservice, and we can all test it
+// It doesn't quite work the way we would neeed it to because of the format of the webservice response
+function loadDocSearch(searchQuery) {
+
+ // Uses a freaking awesome thing called YQL from Yahoo! Yeah buddy! Cross domain ajax, here we come!!
+ var url = "http://www.williamsware.com/cs/new/searchService2.php?query=" + searchQuery;
+ var yqlUrl = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22" + encodeURIComponent(url) + "%22&format=json&callback=";
+
+ window.location.assign('#advisors/resources/view');
+
+ $.ajax({
+ url: yqlUrl,
+ datatype: 'json',
+ success: function(data) {
+
+ var json = {};
+ json.query = searchQuery;
+ json.results = {};
+
+ var page = '';
+ var id = 'content';
+
+ if (data.query.results.json == null) {
+ page = './pages/advisors/no_results.ejs';
+
+ } else {
+ var length = data.query.results.json.results.length;
+ if (length == 0) {
+ page = './pages/advisors/no_results.ejs';
+ } else if (length > 0) {
+ page = './pages/advisors/aResource.ejs';
+ json.results = data.query.results.json.results;
+ } else {
+ page = './pages/advisors/oneResource.ejs';
+ json.results = data.query.results.json.results;
+ }
+
+
+ }
+
+ new EJS({url: page}).update(id, json);
+ }
+ });
+}
View
8 js/partials.js
@@ -8,7 +8,15 @@ $(function(){
});
function navigate(){
+
+
var page = document.location.hash.substr(1);
+
+ if (window.location.href.indexOf('?') < 0 && page != '') {
+ var href = window.location.href.replace('#', '?#');
+ window.location.assign(href);
+ }
+
var scope = page.substr(0,page.lastIndexOf('/'));
console.log(scope);
//set the buttons
View
2  pages.html
@@ -58,7 +58,7 @@
</div>
<div id="student-buttons" class="row hide">
<div class="span4">
- <a href="#advisors/students" class="btn">Advisement</a>
+ <a href="#students/advisement" class="btn">Advisement</a>
</div>
<div class="span4">
<a href="./index.html"><img src="./img/logo.png" /></a>
View
2  pages/advisors/aResource.ejs
@@ -1,7 +1,7 @@
<div class="row">
<div class="span6 offset3">
- <h4>Documents:</h4>
<div id="resourceList">
+ <h4>Resources: <%= query %></h4>
<table class="table table-bordered">
<thead>
<tr>
View
7 pages/advisors/no_results.ejs
@@ -0,0 +1,7 @@
+<div class="row">
+ <div class="span12">
+ <div id="resourceList">
+ <p>Your query, "<%= query %>", returned no results. Please try a new search.</p>
+ </div>
+ </div>
+</div>
View
21 pages/advisors/oneResource.ejs
@@ -0,0 +1,21 @@
+<div class="row">
+ <div class="span6 offset3">
+ <div id="resourceList">
+ <h4>Resources: <%= query %></h4>
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Title</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="apt-row" <%= "onclick='clickOnResource(\"" %><%= results.url%><%= "\");'" %> >
+ <td><%= results.title %></td>
+ <td><%= (results.isDoc == '1')? "<i class='icon-file'>" : "<i class='icon-globe'>" %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
View
19 pages/advisors/resources.ejs
@@ -4,25 +4,6 @@
<div id="content" class="container">
</div>
- <!-- <div id="resourceList">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th>Title</th>
- <th>isDoc</th>
- </tr>
- <tbody>
- <% if(typeof this['apts'] !== 'undefined') { for (var index in apts) {
- var result = apts[index] %>
- <tr class="apt-row">
- <td><% result.netid %></td>
- <td><% result.time %></td>
- </tr>
- <% }} %>
- </tbody>
- </thead>
- </table>
- </div> -->
<form class="form-search">
<div class="input-append">
<input type="text" class="span6 search-query" placeholder="Search for resources...">
View
23 pages/advisors/resources/aResource.ejs
@@ -0,0 +1,23 @@
+<div class="row">
+ <div class="span6 offset3">
+ <div id="resourceList">
+ <table style="margin-top: 20px;" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Title</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ <% for (var index in results) {
+ var result = results[index] %>
+ <tr class="apt-row" <%= "onclick='clickOnResource(\"" %><%= result.url%><%= "\");'" %> >
+ <td><%= result.title %></td>
+ <td><%= (result.isDoc == '1')? "<i class='icon-file'>" : "<i class='icon-globe'>" %></td>
+ </tr>
+ <% } %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
View
21 pages/advisors/resources/manage.ejs
@@ -1,8 +1,19 @@
-<div class="container">
+<div id="manage-recs" class="container" style="text-align: left">
<div class="row">
- <div class="span12">
- <h1>Manage Resources</h1>
- <a href="#advisors/resources/editdoc">Add Document</a> | <a href="#advisors/resources/editweb">Add Website</a>
+ <div class="span6 offset3">
+ <h3>Manage Resources</h3>
+ <a class="btn" onclick="setTitle('Add Document')" href="edit.html#edit/doc">Add Document</a> <a class="btn" href="edit.html#edit/website">Add Website</a>
</div>
</div>
-</div>
+ <div class="row">
+ <div id="all-recs" class="span12">
+
+ </div>
+ </div>
+</div>
+
+<script>
+
+ new EJS({url: './pages/advisors/resources/aResource.ejs'}).update('all-recs', './pages/advisors/resources/resources.json');
+
+</script>
View
1  pages/advisors/resources/resources.json
@@ -0,0 +1 @@
+results = [{ "url":"http://www.ipfw.edu/academics/advising/top-10-for-ipfw-faculty.pdf", "title":"Top 10 Things Faculty Should Know Related to Advising", "isDoc":"1" }, { "url":"https://ppa.byu.edu/sites/ppa.byu.edu/files/New%20PPA%20Website%20Content/Premanagement/Handouts/Why%20a%20MBA.pdf", "title":"Why an MBA should be in Your Future", "isDoc":"1" }, { "url":"https://ppa.byu.edu/sites/ppa.byu.edu/files/New%20PPA%20Website%20Content/Premanagement/Handouts/GMAT%2C%20information.pdf", "title":"The GMAT", "isDoc":"1" }, { "url":"https://ppa.byu.edu/sites/ppa.byu.edu/files/New%20PPA%20Website%20Content/Premanagement/Handouts/How%20do%20I%20know%20if%20an%20MBA%20is%20for%20me.pdf", "title":"How do I know if an MBA is for me?", "isDoc":"1" }, { "url":"https://ppa.byu.edu/", "title":"Pre Professional Advisement Center", "isDoc":"0" }, { "url":"http://saas.byu.edu/catalog/2012-2013ucat/PDFCatalog/Full Catalog.pdf", "title":"Undergrad Catalog 2012-2013", "isDoc":"1" }, { "url":"https://ucs.byu.edu/students/networking", "title":"Networking", "isDoc":"0" }, { "url":"http://saas.byu.edu/catalog/2012-2013ucat/current_grad_catalog.pdf", "title":"Graduate Catalog 2012-2013", "isDoc":"1" }, { "url":"https://ucs.byu.edu/colleges/hum", "title":"College of Humanities", "isDoc":"0" }, { "url":"https://ucs.byu.edu/colleges/cet", "title":"Fulton College of Engineering and Technology", "isDoc":"0" }, { "url":"https://ucs.byu.edu/colleges/fhss", "title":"College of Family, Home & Social Science", "isDoc":"0" }, { "url":"https://ucs.byu.edu/colleges/fac", "title":"College of Fine Arts & Communications", "isDoc":"0" }, { "url":"https://universityadvisement.byu.edu/graduate-school", "title":"Graduate School", "isDoc":"0" }, { "url":"https://ucs.byu.edu/colleges/international", "title":"Kennedy Center for International Studies", "isDoc":"0" }, { "url":"https://ucs.byu.edu/students/interviewing/after", "title":"After the Interview", "isDoc":"0" }, { "url":"http://saas.byu.edu/intern/", "title":"BYU Internship Office", "isDoc":"0" }, { "url":"http://commsinternships.byu.edu/", "title":"Communications Internships", "isDoc":"0" }, { "url":"http://education.byu.edu/ess/", "title":"Education Internships", "isDoc":"0" }, { "url":"http://sot.et.byu.edu/advisement/internships", "title":"Engineering and Technology Internships", "isDoc":"0" }, { "url":"http://fhssinternships.byu.edu/", "title":"Family, Home and Social Sciences Internships", "isDoc":"0" }, { "url":"http://saas.byu.edu/classschedule/pdf/clsschedFULL20125.pdf", "title":"Fall 2012 Course Schedule", "isDoc":"1" }, { "url":"http://www.physics.byu.edu/faculty/rees/220/documents/outline.htm", "title":"Sample Course Outline", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/map.php", "title":"All Major Academic Plans", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=Education", "title":"Education MAPs", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=EngrTech", "title":"Engineering and Technology MAPs", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=FHSS", "title":"Family, Home, and Social Science MAPs", "isDoc":"0" }, { "url":"", "title":"", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=FAC", "title":"Fine Arts and Communications MAPs", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=Humanities", "title":"Humanities MAPs", "isDoc":"0" }, { "url":"http://saas.byu.edu/advisement/maps/map12-13.php?college=IAS", "title":"International and Area Studies MAPs", "isDoc":"0" }, { "url":"http://homeworktips.about.com/od/preparingforcollege/a/majors.htm", "title":"College Major Quiz", "isDoc":"0" }, { "url":"http://www.usnews.com/education/best-colleges/articles/2011/09/19/5-ways-to-pick-the-right-college-major", "title":"5 Ways to Pick the Right College Major", "isDoc":"0" }, { "url":"https://universityadvisement.byu.edu/choose-a-major", "title":"Choose a Major", "isDoc":"0" }, { "url":"https://ccc.byu.edu/", "title":"Counseling and Career Center", "isDoc":"0" }, { "url":"http://www.byui.edu/academic-discovery-center/students/career-and-major-exploration/career-and-major-exploration-classes", "title":"Career and Major Exploration Classes", "isDoc":"0" }, ]
View
18 pages/advisors/resources/view.ejs
@@ -1,7 +1,21 @@
+
+
<div class="container">
<div class="row">
<div class="span12">
- <h1>View Resource</h1>
+ <div id="content" class="container">
+
+ </div>
</div>
</div>
-</div>
+ <div class="row">
+ <div class="span12">
+ <form class="form-search">
+ <div class="input-append">
+ <input type="text" class="span6 search-query" placeholder="Search for resources...">
+ <button type="submit" class="btn"><i class="icon-search"></i> <span class="visible-desktop">Search</span></button>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
View
1  pages/advisors/students/future.ejs
@@ -7,6 +7,7 @@
<div class="row-fluid">
<div class="span6 offset3">
+ <h3>Spontaneous</h3>
<form id="form-sesh">
<input id="netid" type="text" placeholder="Student NetID">
<button id="start-sesh" class="btn btn-primary start-sesh">Start Session</button>
View
36 pages/edit/doc.ejs
@@ -1,3 +1,18 @@
+
+
+<script>
+ var title = { title: "Add Document"};
+ var type = {
+ upper: "Document",
+ lower: "document"
+ };
+
+ new EJS({url: './pages/edit/title.ejs'}).update('edit-title', title);
+
+ new EJS({url: './pages/edit/form.ejs'}).update('edit-form', type);
+
+</script>
+
<div class="container" style="text-align: left;">
<!-- <div class="row">
<div class="span12">
@@ -23,25 +38,8 @@
</div>
</div>-->
<div class="row">
- <div class="span10 offset1">
- <form>
- <fieldset>
- <label>Name:</label>
- <input id="doc-name" type="text" maxlength="30" placeholder="Document name">
- <label>Description:</label>
- <input id="doc-desc" class="span6" type="text" maxlength="65" placeholder="Short description of document (65 characters)">
- <div id="doc-upload" class="span5">
- <label class="span1">Document:</label>
- <button class="btn span2 offset1">Upload new</button>
- </div>
- <label>Details:</label>
- <textarea class="span10" rows="10"></textarea>
- </fieldset>
- </form>
- <div class="span10">
- <button id="doc-cancel" class="btn span3">Cancel</button>
- <button id="doc-save" class="btn btn-primary span3 offset3">Save</button>
- </div>
+ <div id="edit-form" class="span10 offset1">
+
</div>
</div>
</div>
View
23 pages/edit/form.ejs
@@ -0,0 +1,23 @@
+<form>
+ <fieldset>
+ <label>Name:</label>
+ <input id="doc-name" type="text" maxlength="30" placeholder="<%= upper %> name">
+ <label>Description:</label>
+ <input id="doc-desc" class="span6" type="text" maxlength="65" placeholder="Short description of <%= lower %> (65 characters)">
+ <% if (lower == 'document') { %>
+ <div id="doc-upload" class="">
+ <label class="">Document:</label>
+ <button class="btn btn-small">Upload</button>
+ </div>
+ <% } else { %>
+ <label>Website URL:</label>
+ <input id="doc-desc" class="span6" type="text" placeholder="URL of <%= lower %>">
+ <% } %>
+<!-- <label class="">Details:</label>
+ <textarea class="span10" rows="10"></textarea>-->
+ </fieldset>
+</form>
+<div id="edit-btns" class="">
+ <a id="doc-cancel" class="btn" href="pages.html#advisors/resources/manage">Cancel</a>
+ <a id="doc-save" class="btn btn-primary" href="pages.html#advisors/resources/manage">Save</a>
+</div>
View
1  pages/edit/title.ejs
@@ -0,0 +1 @@
+<%= title %>
View
48 pages/edit/website.ejs
@@ -1,7 +1,45 @@
-<div class="container">
- <div class="row">
- <div class="span12">
- <h1>Add/Edit Website</h1>
+
+
+<script>
+ var title = { title: "Add Website"};
+ var type = {
+ upper: "Website",
+ lower: "website"
+ };
+
+ new EJS({url: './pages/edit/title.ejs'}).update('edit-title', title);
+
+ new EJS({url: './pages/edit/form.ejs'}).update('edit-form', type);
+
+</script>
+
+<div class="container" style="text-align: left;">
+<!-- <div class="row">
+ <div class="span12">
+ <h1>Add/Edit Document</h1>
+ </div>
+ </div>-->
+<!-- <div class="row">
+ <div class="span10">
+ <form class="form-horizontal">
+ <div class="control-group">
+ <label class="control-label" for="doc-name">Name: </label>
+ <div class="controls">
+ <input id="doc-name" type="text" maxlength="30" placeholder="Document name">
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label" for="doc-desc">Description: </label>
+ <div class="controls">
+ <input id="doc-desc" class="span6" type="text" maxlength="65" placeholder="Short description of document (65 characters)">
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>-->
+ <div class="row">
+ <div id="edit-form" class="span10 offset1">
+
+ </div>
</div>
- </div>
</div>
View
9 redirectToIndex.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Redirecting...</title>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.williamsware.com/cs/a-team/index.html">
+ </head>
+ <body>
+ <h1>Redirecting...</h1>
+ </body>
+</html>
View
9 redirectToMirror.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Redirecting...</title>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.williamsware.com/cs/a-team/studentMirror.html">
+ </head>
+ <body>
+ <h1>Redirecting...</h1>
+ </body>
+</html>
View
20 searchService2.php
@@ -0,0 +1,20 @@
+<?php
+ $link = mysql_connect('williamswarecom.fatcowmysql.com', 'lawrence', 'pitridish');
+ if(!link) {die('Could not connect: ' . mysql_error());}
+ mysql_select_db("cs240", $link);
+
+ $result = mysql_query("SELECT url, isDoc, tags, title FROM Resources");
+
+ $toEcho = "{'results':[";
+
+ while($row = mysql_fetch_array($result)) {
+ if(($_GET['query'] && ((stristr($row['tags'], $_GET['query'])) || (stristr($row['title'], $_GET['query']))) ) || ! $_GET['query']) {
+ $toEcho = $toEcho . "{ \"url\":\"" . $row['url'] . "\", ";
+ $toEcho = $toEcho . "\"title\":\"" . $row['title'] . "\", ";
+ $toEcho = $toEcho . "\"isDoc\":\"" . $row['isDoc'] . "\" }, ";
+ }
+ }
+
+ $toEcho = $toEcho . "] }";
+ echo str_ireplace("}, ] }", "} ] }", $toEcho);
+?>

No commit comments for this range

Something went wrong with that request. Please try again.