diff --git a/website/public/search.php b/website/public/search.php index c314791..6cfadd8 100644 --- a/website/public/search.php +++ b/website/public/search.php @@ -1,7 +1,11 @@ - + diff --git a/website/public/styles/search.css b/website/public/styles/search.css index 4b2281c..b54723d 100644 --- a/website/public/styles/search.css +++ b/website/public/styles/search.css @@ -9,4 +9,9 @@ #search-friends-output { margin-right: 10px; +} + +.searchleft, .searchright { + display: inline-block; + vertical-align: top; } \ No newline at end of file diff --git a/website/queries/group_page.php b/website/queries/group_page.php index ef7af07..d704e8c 100644 --- a/website/queries/group_page.php +++ b/website/queries/group_page.php @@ -172,5 +172,26 @@ function changeMultipleGroupStatusByID($ids, $status) { return $q; } +function searchSomeGroups($n, $m, $search) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `name`, + `picture` + FROM + `group_page` + WHERE + `name` LIKE :keyword + ORDER BY + `name` + LIMIT + :n, :m + "); -?> + $search = "%$search%"; + $stmt->bindParam(':keyword', $search); + $stmt->bindParam(':n', $n, PDO::PARAM_INT); + $stmt->bindParam(':m', $m, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} +?> \ No newline at end of file diff --git a/website/queries/user.php b/website/queries/user.php index 398e2e4..114d673 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -252,12 +252,12 @@ function selectRandomNotFriendUser($userID) { FROM `user` WHERE - `userID` NOT IN (SELECT + `userID` NOT IN (SELECT `user1ID` FROM `friendship` WHERE `user1ID` = :userID) OR - `userID` NOT IN (SELECT + `userID` NOT IN (SELECT `user2ID` FROM `friendship` @@ -271,4 +271,33 @@ function selectRandomNotFriendUser($userID) { $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); $stmt->execute(); return $stmt->fetch(); -} \ No newline at end of file +} + +function searchSomeUsers($n, $m, $search) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `username`, + `profilepicture`, + `fname`, + `lname` + FROM + `user` + WHERE + `username` LIKE :keyword OR + `fname` LIKE :keyword OR + `lname` LIKE :keyword + ORDER BY + `fname`, + `lname`, + `username` + LIMIT + :n, :m + "); + + $search = "%$search%"; + $stmt->bindParam(':keyword', $search); + $stmt->bindParam(':n', $n, PDO::PARAM_INT); + $stmt->bindParam(':m', $m, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} diff --git a/website/views/search-view.php b/website/views/search-view.php index b1418d1..0d650d4 100644 --- a/website/views/search-view.php +++ b/website/views/search-view.php @@ -1,3 +1,16 @@ + +
@@ -7,72 +20,85 @@ + value= + >
-
+

Gebruikers

-
- \ No newline at end of file +