public function showRequests() { checkUnauthorizedAccess(); $main = new Main(); $body = new \templates\ShowRequests(); $myID = UserRepository::getIdByUsername($_SESSION['username']); $requests = RequestRepository::checksNewRequests($myID); $body->setRequests($requests); $main->setPageTitle("Friend Requests")->setBody($body); echo $main; }
function newRequestNotification() { $myID = \Repository\UserRepository::getIdByUsername($_SESSION['username']); $requests = \Repository\RequestRepository::checksNewRequests($myID); $counter = 0; foreach ($requests as $r) { $counter++; } $color = "default"; if ($counter > 0) { $color = "red"; } return $color; }