getGetRequest(); if(!is_null($page)){ $href = substr($href, 0, strrpos($href,"&")); } //Start Pagination if(!is_null($page)){ $numPages =$_SESSION["numPages"]; $_SESSION["currentpage"]=$page; $curr_page = $_SESSION["currentpage"]; $prev_page = $_SESSION["currentpage"] - 1; $next_page = $_SESSION["currentpage"] + 1; $offset = ($page * 10) - 10; if($offset < 0) { $offset = 0; } if($prev_page < 0) { $prev_page = 1; } if($next_page > $numPages) { $next_page = $numPages; } }else{ $query = "select count(*) as count from PERSON_PERSON ". "where person_username='$user' and is_accepted=1"; $result = $connection->query($query); $row = $result->getArray(); $count = $row['count']; unset($result); $numPages = ceil($count / 10);; $_SESSION["numPages"] = $numPages; $prev_page = 1; $next_page = 2; $curr_page = 1; $offset = 0; session_unregister ("currentpage"); } ob_start(); require("../views/paginate.php"); $paginateView = ob_get_clean(); //End Pagination $friendsList = $friends->getFriendsList($user,$loggedinuser,$connection,$offset); ob_start(); require("../views/friends.php"); $fillContent = ob_get_clean(); if($flag == "frnd"){ $fillMessage ="You are no longer friends with ".$reqUser.""; } require_once("../views/site.php"); ?>