<?php //teams creation page respond(function ($request, $response, $app) { }); respond('GET', '/builder', function ($request, $response, $app) { if (!$app->is_admin) { die('You do not have access to this page.'); } $wpid = $app->user->wpid; $staff_collection = new TrainingTracker\StaffCollection(); $staff_collection->load(); //getting all the mentors and mentees at the help desk. $mentors = $staff_collection->mentors(); $mentees = $staff_collection->mentees(); foreach ($mentees as $mentee) { $teams = $mentee->team(); } $teams = json_encode($teams); // die; // TODO: no you. $app->tpl->assign('teams', $teams); $app->tpl->assign('mentees', $mentees); $app->tpl->assign('mentors', $mentors); $app->tpl->display('teams.tpl'); //go go gadget show page }); respond('GET', '/list', function ($request, $responce, $app) { $teams_array = TrainingTracker::get_teams(); $app->tpl->assign('teams_array', $teams_array); $app->tpl->display('viewteams.tpl');