Marijn button #99

Merged
11166932 merged 152 commits from marijn-button into master 2017-01-23 13:25:08 +01:00
5 changed files with 137 additions and 52 deletions
Showing only changes of commit 3039839656 - Show all commits

View File

@@ -1,7 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<?php include("../views/head.php"); ?> <?php
include_once("../queries/user.php");
include_once("../queries/group_page.php");
include("../views/head.php");
?>
<style> <style>
@import url("styles/search.css"); @import url("styles/search.css");
</style> </style>

View File

@@ -9,4 +9,9 @@
#search-friends-output { #search-friends-output {
margin-right: 10px; margin-right: 10px;
}
.searchleft, .searchright {
display: inline-block;
vertical-align: top;
} }

View File

@@ -172,5 +172,26 @@ function changeMultipleGroupStatusByID($ids, $status) {
return $q; 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;
}
?>

View File

@@ -252,12 +252,12 @@ function selectRandomNotFriendUser($userID) {
FROM FROM
`user` `user`
WHERE WHERE
`userID` NOT IN (SELECT `userID` NOT IN (SELECT
`user1ID` `user1ID`
FROM FROM
`friendship` `friendship`
WHERE `user1ID` = :userID) OR WHERE `user1ID` = :userID) OR
`userID` NOT IN (SELECT `userID` NOT IN (SELECT
`user2ID` `user2ID`
FROM FROM
`friendship` `friendship`
@@ -271,4 +271,33 @@ function selectRandomNotFriendUser($userID) {
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT); $stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
$stmt->execute(); $stmt->execute();
return $stmt->fetch(); return $stmt->fetch();
} }
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;
}

File diff suppressed because one or more lines are too long