Merge branch 'lars' into 'master'
Lars See merge request !111
This commit was merged in pull request #115.
This commit is contained in:
@@ -28,4 +28,4 @@ if(!empty($_POST["request"]) AND $friendship_status == 0) {
|
||||
|
||||
$username = getUsername($_POST["userID"]);
|
||||
|
||||
header("Location: profile.php?username=$username");
|
||||
header("Location: ../profile.php?username=$username");
|
||||
@@ -1,9 +1,19 @@
|
||||
function showFriendNotifications(notifications) {
|
||||
$("#friendrequestslist").html("");
|
||||
for (i in notifications) {
|
||||
var outgoing = "";
|
||||
if (notifications[i].friend_state == "3") {
|
||||
outgoing = "<button\
|
||||
name='accept' \
|
||||
class='accept-notification' \
|
||||
value='"+ notifications[i].userID +"'> \
|
||||
<i class='fa fa-check'></i> \
|
||||
</button>";
|
||||
}
|
||||
|
||||
$("#friendrequestslist").append(" \
|
||||
<li class='friend-item'> \
|
||||
<form action='profile.php' method='post'> \
|
||||
<form action='profile.php' method='get'> \
|
||||
<button type='submit' \
|
||||
name='username' \
|
||||
value='"+ notifications[i].username +"'> \
|
||||
@@ -15,18 +25,14 @@ function showFriendNotifications(notifications) {
|
||||
</form> \
|
||||
<div class='notification-options'>\
|
||||
<form action='API/edit_friendship.php' method='post'> \
|
||||
<input type='hidden' name='userID' value='"+ notifications[i].userID +"' /> \
|
||||
"+ outgoing +" \
|
||||
<button type='submit' \
|
||||
name='accept' \
|
||||
class='accept-notification' \
|
||||
value='"+ notifications[i].userID +"'> \
|
||||
<i class='fa fa-check'></i> \
|
||||
</button>\
|
||||
<button\
|
||||
name='delete' \
|
||||
class='deny-notification' \
|
||||
value='"+ notifications[i].userID +"'> \
|
||||
<i class='fa fa-times'></i> \
|
||||
</button> \
|
||||
</button>\
|
||||
<form>\
|
||||
</div> \
|
||||
</li> \
|
||||
|
||||
@@ -39,6 +39,21 @@ function selectAllFriendRequests() {
|
||||
SELECT
|
||||
`userID`,
|
||||
`username`,
|
||||
CASE `status` IS NULL
|
||||
WHEN TRUE THEN 0
|
||||
WHEN FALSE THEN
|
||||
CASE `status` = 'confirmed'
|
||||
WHEN TRUE THEN
|
||||
1
|
||||
WHEN FALSE THEN
|
||||
CASE `user1ID` = :userID
|
||||
WHEN TRUE THEN
|
||||
2
|
||||
WHEN FALSE THEN
|
||||
3
|
||||
END
|
||||
END
|
||||
END AS `friend_state`,
|
||||
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `name`,
|
||||
IFNULL(
|
||||
`profilepicture`,
|
||||
|
||||
Reference in New Issue
Block a user