// Handle groups (if enabled)
    groups_print_course_menu($course, $CFG->wwwroot . '/course/report/completion/?course=' . $course->id);
}
// Generate where clause
$where = array();
$where_params = array();
if ($sifirst !== 'all') {
    $where[] = $DB->sql_like('u.firstname', ':sifirst', false);
    $where_params['sifirst'] = $sifirst . '%';
}
if ($silast !== 'all') {
    $where[] = $DB->sql_like('u.lastname', ':silast', false);
    $where_params['silast'] = $silast . '%';
}
// Get user match count
$total = $completion->get_num_tracked_users(implode(' AND ', $where), $where_params, $group);
// Total user count
$grandtotal = $completion->get_num_tracked_users('', array(), $group);
// If no users in this course what-so-ever
if (!$grandtotal) {
    echo $OUTPUT->container(get_string('err_nousers', 'completion'), 'errorbox errorboxcontent');
    echo $OUTPUT->footer();
    exit;
}
// Get user data
$progress = array();
if ($total) {
    $progress = $completion->get_progress_all(implode(' AND ', $where), $where_params, $group, $firstnamesort ? 'u.firstname ASC' : 'u.lastname ASC', $csv ? 0 : COMPLETION_REPORT_PAGE, $csv ? 0 : $start);
}
// Build link for paging
$link = $CFG->wwwroot . '/course/report/completion/?course=' . $course->id;