You have an error here-
if (isset($_POST['Accept'])){
$accepted = AcceptFriendRequest($_POST['acceptid']);
//echo $accepted;
}
Its outside the class and only an object of that class can make a call to that method! Until ofcoasre if you define the method static, after which you can call it by scope resolution operator!
You can Either use an object to access that method or just define you method static and access by-
classname::functionname();
If you like to call the method by object-
if (isset($_POST['Accept'])){
$accepted = $friendship->AcceptFriendRequest($_POST['acceptid']);
//echo $accepted;
}