api_not_allowed(true);
    }
}
$addparams = array('selectcat' => $cat[0]->get_id());
if (isset($_GET['search'])) {
    $addparams['search'] = $keyword;
}
$this_section = SECTION_COURSES;
if (isset($_GET['exportpdf'])) {
    $export_pdf_form->display();
} else {
    Display::display_header(get_lang('FlatView'));
}
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
    DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
    $flatviewtable->display();
} elseif (isset($_GET['selectcat']) && $_SESSION['studentview'] == 'teacherview') {
    DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
    // main graph
    $flatviewtable->display();
    // @todo this needs a fix
    //$image_file = $flatviewtable->display_graph();
    //@todo load images with jquery
    echo '<div id="contentArea" style="text-align: center;" >';
    if (!empty($image_file)) {
        echo '<img src="' . $image_file . '">';
    }
    $flatviewtable->display_graph_by_resource();
    echo '</div>';
}
Display::display_footer();