-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·203 lines (167 loc) · 5.96 KB
/
Copy pathindex.php
File metadata and controls
executable file
·203 lines (167 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!--
THINGS THAT NEED TO BE DONE
1. project stages breadcrumb
2. load more (now it's limited to 15 top result)
4. search fillers
3. Log in
-->
<?php
$pageTitle = "LDI ProjectHub";
$style = "homepage";
require('includes/include.php');
include 'includes/header.php';
include 'includes/navbar.php';
//$tags = getProjectTags();
//// something something searchTags()
if (is_null($_GET))
{
?>
<script>
// function afterLogin(){
// document.getElementById('header').style.height="700px";
// document.getElementById('page-wrap').style.top="-400px";
// }
</script>
<!-- LDI Title -->
<div id="header">
<div class="container">
<div class="title">
<p class="ldi">LDI</p><p class="ph">Project Hub</p>
<!-- log in from -->
<div id="errors">
<?php
if (isset($message)) {
foreach ($message as $message) { echo "<p class='message'>".$message."</p>"; }
unset($_SESSION['message']);
}
if (isset($errors)) {
foreach ($errors as $error) { echo "<p class='error'>".$error."</p>"; }
unset($_SESSION['errors']);
}
?>
</div>
<?php
if ($user->isLoggedIn) {
// echo "<script>afterLogin();</script>";
} else {
echo <<<HTML
<form class="login" action="login.php" method="POST">
<div class="inputBox"><input name="email" type="text" placeholder="Email" onclick="this.value='';" onblur="this.value=!this.value?'Email':this.value;" value="Email" /></div>
<div class="inputBox"><input name="password" type="password" placeholder="Password" onclick="this.value='';" /></div>
<div class="inputBox"><button type="submit" class="button"><span style="float:left;">Sign in</span> <span class="bootstrap"><span class="glyphicon glyphicon-chevron-right right"></span></span></button></div>
</form>
HTML;
} ?>
<!-- <img src="images/01d.png" class="titlePicture" alt="titlePicture" /> --> <!-- LDI cartoon pic -->
</div> <!-- /title -->
<!-- Feature Project -->
<?php
include 'components/featureBox.php';
?>
</div> <!-- End of Container -->
</div> <!-- End of Header -->
<?php
} // END if GET is null block
?>
<!-- Category and View -->
<div class="container">
<div class="content">
<p class="ProjectStages"> Project Stages : </p>
<div class="breadcrumb">
<a href="index.php?stage=Aspiration" class="active first">Aspiration</a>
<a href="index.php?stage=Incubation" class="second">Incubation</a>
<a href="index.php?stage=Implementation" class="third">Implementation</a>
<a href="index.php?stage=Maturation" class="forth">Maturation</a>
</div>
<!-- Category -->
<div class="bootstrap cate">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Category</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="index.php?category=Personal Development Project">Personal Development Project</a></li>
<li><a href="index.php?category=Social and Global Change Project">Social & Global Change Project</a></li>
<li><a href="index.php?category=Student/Campus Community Project">Student/Campus Community Project</a></li>
<li><a href="index.php?category=Social Enterprise">Social Enterprise</a></li>
<li><a href="index.php?category=Business Enterprise">Business Enterprise</a></li>
<li><a href="index.php?category=Technical Innovation">Technical Innovation</a></li>
</ul>
</div>
<div class="btn-group">
<input type="text" name="searchTags" id="tags" style="width: 219px" value="" />
</div>
</div>
<div class="category">
<ul class="view">
<li>Order By : </li>
<li>
<select name ="viewBy">
<option value="likes DESC">Most liked</option>
<option value="likes">Least liked</option>
<option value="createdTimestamp DESC">Newest first</option>
<option value="createdTimestamp">Oldest first</option>
</select>
</li>
</ul>
</div>
<!-- Display Projects -->
<?php
if (isset($_POST['search']) && $_GET['action'] == "search")
{
$result = projectSearch($_POST['search']);
}
else
{
$tags = getAllTags();
// Set up default search filters
$stage = (isset($_GET['stage'])) ? $_GET['stage'] : "Aspiration" ;
$category = (isset($_GET['category'])) ? $_GET['category'] : "none";
$skill = (isset($_GET['skill'])) ? $_GET['skill'] : "none";
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : "none";
if ($category == "Social and Global Change Project") {$category = "Social & Global Change Project";}
// Figure what fillers are set then fetch from databse using below functions
if($sort="none"){$sort= "likes DESC";} // default sort by popularily (likes)
if($category == "none" && $skill == "none")
{
$result = noCate_noSkill($stage,$sort);
}
else if($category == "none")
{
$result = noCate($skill,$stage,$sort);
}
else if($skill == "none")
{
$result = noSkill($category,$stage,$sort);
}
else
{
$result = allFillers($category,$skill,$stage,$sort);
}
}
if(checkCount($result)) // If there is result
{
include 'includes/projectDisplay.php'; // Display projects
}
else
{ // if there isn't a result, display message no result
echo "<h2><center> <br>Sorry :( We couldn't find any projects with the options you searched for. <br> Why not <a href='new-project.php'>Create your own?</a></center></h2>";
}
?>
</div> <!-- end of contant -->
</div> <!-- end of container -->
<script type="text/javascript">
$(document).ready(function() {
$("input#tags").select2({
tags:["tag", "awesome" ],
tokenSeparators: [",", " "],
placeholder: "Search for tags",
formatNoMatches: "start typing"
});
});
</script>
<?php
include 'includes/footer.php';
?>