$content = ""; $isTrainer = $_SESSION['isTrainer']; if ($isTrainer != 'true') { $studentID = $_SESSION['student_id']; $studentName = $_SESSION['name']; // get name $totalNumberOfProjects = count(TeamModel::getStudentTeams($studentID)); // get total amount $totalNumberOfPages = ceil($totalNumberOfProjects / $projectPerPage); // calc number of pages $currentPage = isset($_GET['current_page']) ? (int) $_GET['current_page'] : 1; // if currentPage var isset else default 1 $startPage = ($currentPage - 1) * $projectPerPage; // calc start page ex. 1 = 0 - 4 projects // set content: $listOfTeams = TeamModel::getStudentTeamsLimit($studentID, $startPage, $projectPerPage); // get teams $content = ""; if (count($listOfTeams) == 0) { $content .= " <div class=\"row text-center\">\n <div class=\"col-lg-12\">\n <p>No teams attended</p>\n </div>\n </div>"; } else { for ($int = 0; $int < count($listOfTeams); $int++) { $teamID = $listOfTeams[$int]['team_id']; $content .= "<div class=\"col-md-3 portfolio-item\">\n <a href=\"team-id-{$teamID}\">\n <img class=\"img-responsive\" src=\"images/team.jpg\" alt=\"\">\n </a>\n <p style='text-align: center'>Team {$teamID}</p>\n </div>"; } } $pagination = WebFunctions::pagination($currentPage, $totalNumberOfPages); // add pagination // add view include_once "../view/home-student.php"; } else {