$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook' )); $category = Category :: load($_GET['selectcat']); $my_user_id = Security::remove_XSS($_GET['userid']); $allevals = $category[0]->get_evaluations($my_user_id, true); $alllinks = $category[0]->get_links($my_user_id, true); if ($_GET['selectcat'] != null) { $addparams= array ( 'userid' => $my_user_id, 'selectcat' => Security::remove_XSS($_GET['selectcat']) ); } else { $addparams= array ( 'userid' => $my_user_id, 'selecteval' => Security::remove_XSS($_GET['selecteval']) ); } $user_table = new UserTable($my_user_id, $allevals, $alllinks, $addparams); if (isset ($_GET['exportpdf'])) { $datagen = new UserDataGenerator($my_user_id, $allevals, $alllinks); $data_array = $datagen->get_data(UserDataGenerator :: UDG_SORT_NAME, 0, null, true); $newarray = array(); $displayscore = ScoreDisplay :: instance(); foreach ($data_array as $data) { $newarray[] = array_slice($data, 1); } $userinfo = api_get_user_info($my_user_id); $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')'; if ($displayscore->is_custom()) { $header_names = array( get_lang('Evaluation'), get_lang('Course'), get_lang('Category'), get_lang('EvaluationAverage'), get_lang('Result'), get_lang('Display'), ); } else { $header_names = array( get_lang('Evaluation'), get_lang('Course'), get_lang('Category'), get_lang('EvaluationAverage'), get_lang('Result'), ); } $table = new HTML_Table(array('class' => 'data_table')); $row = 0; $column = 0; foreach ($header_names as $item) { $table->setHeaderContents($row, $column, $item); $column++; } $row = 1; if (!empty($newarray)) { foreach ($newarray as $data) { $column = 0; $table->setCellContents($row, $column, $data); $table->updateCellAttributes($row, $column, 'align="center"'); $column++; $row++; } } $html .= $table->toHtml(); $pdf = new PDF(); $pdf->content_to_pdf($html); exit; } $actions = '