-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
32 lines (29 loc) · 839 Bytes
/
search.php
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
<?php
require_once 'include/header.php';
require_once 'include/classes/SearchResultsProvider.php';
if (!isset($_GET['term']) || $_GET['term'] == ""){
echo 'You must enter search term';
die();
}
$term = $_GET['term'];
if (!isset($_GET['orderBy']) || $_GET['orderBy'] == "views"){
$orderBy = "views";
}else{
$orderBy = "uploadDate";
}
$searchResultProvider = new SearchResultsProvider($conn, $userLoggedInObj);
$videos = $searchResultProvider->getVideos($term, $orderBy);
$videoGrid = new VideoGrid($conn, $userLoggedInObj);
?>
<div class="largeVideoGridContainer">
<?php
if (sizeof($videos) > 0){
echo $videoGrid->createLarge($videos, sizeof($videos) . " result found", true);
}else{
echo "No results found!";
}
?>
</div>
<?php
require_once 'include/footer.php';
?>