コード例 #1
0
 /**
  * getFriendButton
  * 
  * gets the friend button if needed, add or remove
  * 
  * @param int $GETUserId
  * @param int $userId
  * @return string
  */
 function getFriendButton($GETUserId, $userId)
 {
     $friend = new friend();
     if ($GETUserId !== $userId) {
         if (!$friend->checkIfFriends($userId, $GETUserId)) {
             return '<form method="GET" action="PHP/addFriend.php"><button class="message" style="margin-right: 10px;"><i class="fa fa-plus" style="font-size: 15px; margin-right: 3px;"></i> Freund hinzufügen</button><input type="hidden" value="' . $GETUserId . '" id="userId" name="userId"/></form>';
         } else {
             return '<form method="GET" action="PHP/removeFriend.php"><button class="message" style="margin-right: 10px;"><i class="fa fa-minus" style="font-size: 15px; margin-right: 3px;"></i> Freund entfernen</button><input type="hidden" value="' . $GETUserId . '" id="userId" name="userId"/></form>';
         }
     }
     return '';
 }