getGetRequest(); if(!is_null($page)){ $href = substr($href, 0, strrpos($href,"&")); } if($href==""){ $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 SOCIALEVENT as se,PERSON_SOCIALEVENT as ps where se.socialeventid=ps.socialeventid and se.eventtimestamp>=CURRENT_TIMESTAMP and ps.username='$un'"; $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 $upcomingEvents = $events->getUpcomingEventsForUser($un,$connection,$flag,$offset); ob_start(); require("../views/upcomingEvents.php"); $fillContent = ob_get_clean(); require_once("../views/site.php"); ?>