} } else { if ($mentor_wpid == 'unassigned') { //if you move the mentee back to the mentee category in the team builder, it removes their database entry. TrainingTracker::team_delete($mentee_wpid); } } } }); //view teams respond('GET', '/list/[:wpid]', function ($request, $responce, $app) { if (!$app->is_mentor) { $responce->redirect('../list'); } $wpid = $request->wpid; if (!TrainingTracker::valid_wpid($wpid)) { $responce->redirect('../list'); } $teams = TrainingTracker::get_teams(); if (isset($teams["{$wpid}"])) { $my_team = $teams["{$wpid}"]; unset($my_team['mentor']); foreach ($my_team as &$member) { if (isset($member['name'])) { $current_user_parameter['wpid'] = $member['wpid']; $current_user = new TrainingTracker\Staff($current_user_parameter); $member = $current_user; } } } else { $my_team['mentor']['name'] = 'Loner';