if ($cat[0]->is_locked() == true || api_is_platform_admin()) {
        Display::set_header(null, false, false);
        GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
    }
}
if (isset($_GET['exportpdf'])) {
    $interbreadcrumb[] = array('url' => api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView'));
    $export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self() . '?exportpdf=&offset=' . intval($_GET['offset']) . '&selectcat=' . intval($_GET['selectcat']) . '&' . api_get_cidreq(), '_blank', '');
    if ($export_pdf_form->validate()) {
        $params = $export_pdf_form->exportValues();
        Display::set_header(null, false, false);
        $params['join_firstname_lastname'] = true;
        $params['show_official_code'] = true;
        $params['export_pdf'] = true;
        $params['only_total_category'] = false;
        GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
    } else {
        Display::display_header(get_lang('ExportPDF'));
    }
}
if (isset($_GET['print'])) {
    $printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
    echo print_table($printable_data[1], $printable_data[0], get_lang('FlatView'), $cat[0]->get_name());
    exit;
}
if (!empty($_GET['export_report']) && $_GET['export_report'] == 'export_report') {
    if (api_is_platform_admin() || api_is_course_admin() || api_is_course_coach() || $isDrhOfCourse) {
        $user_id = null;
        if (empty($_SESSION['export_user_fields'])) {
            $_SESSION['export_user_fields'] = false;
        }