courseLog.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.tracking
  5. */
  6. $pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null;
  7. // Including the global initialization file
  8. require_once '../inc/global.inc.php';
  9. $current_course_tool = TOOL_TRACKING;
  10. $courseInfo = api_get_course_info(api_get_course_id());
  11. $courseCode = $courseInfo['code'];
  12. $from_myspace = false;
  13. $from = isset($_GET['from']) ? $_GET['from'] : null;
  14. // Starting the output buffering when we are exporting the information.
  15. $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  16. $session_id = isset($_REQUEST['id_session']) ? intval($_REQUEST['id_session']) : 0;
  17. if ($from == 'myspace') {
  18. $from_myspace = true;
  19. $this_section = "session_my_space";
  20. } else {
  21. $this_section = SECTION_COURSES;
  22. }
  23. // Access restrictions.
  24. $is_allowedToTrack =
  25. api_is_platform_admin() ||
  26. api_is_allowed_to_create_course() ||
  27. api_is_session_admin() ||
  28. api_is_drh() ||
  29. api_is_course_tutor() ||
  30. api_is_course_admin();
  31. if (!$is_allowedToTrack) {
  32. api_not_allowed(true);
  33. exit;
  34. }
  35. // If the user is a HR director (drh)
  36. if (api_is_drh()) {
  37. // Blocking course for drh
  38. if (api_drh_can_access_all_session_content()) {
  39. // If the drh has been configured to be allowed to see all session content, give him access to the session courses
  40. $coursesFromSession = SessionManager::getAllCoursesFollowedByUser(api_get_user_id(), null);
  41. $coursesFromSessionCodeList = array();
  42. if (!empty($coursesFromSession)) {
  43. foreach ($coursesFromSession as $course) {
  44. $coursesFromSessionCodeList[$course['code']] = $course['code'];
  45. }
  46. }
  47. $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  48. if (!empty($coursesFollowedList)) {
  49. $coursesFollowedList = array_keys($coursesFollowedList);
  50. }
  51. if (!in_array($courseCode, $coursesFollowedList)) {
  52. if (!in_array($courseCode, $coursesFromSessionCodeList)) {
  53. api_not_allowed();
  54. }
  55. }
  56. } else {
  57. // If the drh has *not* been configured to be allowed to see all session content,
  58. // then check if he has also been given access to the corresponding courses
  59. $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  60. $coursesFollowedList = array_keys($coursesFollowedList);
  61. if (!in_array(api_get_course_id(), $coursesFollowedList)) {
  62. api_not_allowed(true);
  63. exit;
  64. }
  65. }
  66. }
  67. // Including additional libraries.
  68. require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
  69. if ($export_csv) {
  70. if (!empty($session_id)) {
  71. $_SESSION['id_session'] = $session_id;
  72. }
  73. ob_start();
  74. }
  75. $columnsToHideFromSetting = api_get_configuration_value('course_log_hide_columns');
  76. $columnsToHide = empty($columnsToHideFromSetting) ? array(1, 9, 10, 11, 12) : $columnsToHideFromSetting;
  77. $columnsToHide = json_encode($columnsToHide);
  78. $csv_content = array();
  79. // Scripts for reporting array hide/show columns
  80. $js = "<script>
  81. // hide column and display the button to unhide it
  82. function foldup(in_id) {
  83. $('#reporting_table .data_table tr td:nth-child('+in_id+')').fadeToggle();
  84. $('#reporting_table .data_table tr th:nth-child('+in_id+')').fadeToggle();
  85. $('div#unhideButtons span:nth-child('+in_id+')').fadeToggle();
  86. }
  87. // add the red cross on top of each column
  88. function init_hide() {
  89. $('#reporting_table .data_table tr th').each(
  90. function(index) {
  91. num_index = index + 1;
  92. $(this).prepend(
  93. '<div style=\"cursor:pointer\" onclick=\"foldup('+num_index+')\">".Display::return_icon(
  94. 'visible.png',
  95. get_lang('HideColumn'),
  96. array('align' => 'absmiddle', 'hspace' => '3px'),
  97. ICON_SIZE_SMALL
  98. )."</div>'
  99. );
  100. }
  101. );
  102. }
  103. // hide some column at startup
  104. // be sure that these columns always exists
  105. // see headers = array();
  106. // tab of header texts
  107. $(document).ready( function() {
  108. init_hide();
  109. var columnsToHide = ".$columnsToHide.";
  110. columnsToHide.forEach(function(id) {
  111. foldup(id);
  112. });
  113. })
  114. </script>";
  115. $htmlHeadXtra[] = "<style type='text/css'>
  116. .secLine {background-color : #E6E6E6;}
  117. .content {padding-left : 15px;padding-right : 15px; }
  118. .specialLink{color : #0000FF;}
  119. /* Style for reporting array hide/show columns */
  120. .unhide_button {
  121. cursor : pointer;
  122. border:1px solid black;
  123. background-color: #FAFAFA;
  124. padding: 5px;
  125. border-radius : 3px;
  126. margin-right:3px;
  127. }
  128. div#reporting_table table th {
  129. vertical-align:top;
  130. }
  131. </style>";
  132. $htmlHeadXtra[] .= $js;
  133. // Database table definitions.
  134. //@todo remove this calls
  135. $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
  136. $TABLETRACK_LINKS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS);
  137. $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
  138. $TABLETRACK_ACCESS_2 = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
  139. $TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  140. $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
  141. $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
  142. $table_user = Database::get_main_table(TABLE_MAIN_USER);
  143. $TABLEQUIZ = Database::get_course_table(TABLE_QUIZ_TEST);
  144. $sessionId = api_get_session_id();
  145. // Breadcrumbs.
  146. if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  147. $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
  148. $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList'));
  149. $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview'));
  150. }
  151. $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : '';
  152. $nameTools = get_lang('Tracking');
  153. // getting all the students of the course
  154. if (empty($session_id)) {
  155. // Registered students in a course outside session.
  156. $a_students = CourseManager::get_student_list_from_course_code(
  157. api_get_course_id()
  158. );
  159. } else {
  160. // Registered students in session.
  161. $a_students = CourseManager::get_student_list_from_course_code(
  162. api_get_course_id(),
  163. true,
  164. $sessionId
  165. );
  166. }
  167. $nbStudents = count($a_students);
  168. $extra_info = array();
  169. // Getting all the additional information of an additional profile field.
  170. if (isset($_GET['additional_profile_field']) &&
  171. is_numeric($_GET['additional_profile_field'])
  172. ) {
  173. $user_array = array();
  174. foreach ($a_students as $key => $item) {
  175. $user_array[] = $key;
  176. }
  177. // Fetching only the user that are loaded NOT ALL user in the portal.
  178. $additional_user_profile_info = TrackingCourseLog::get_addtional_profile_information_of_field_by_user(
  179. $_GET['additional_profile_field'],
  180. $user_array
  181. );
  182. $extra_info = UserManager::get_extra_field_information(
  183. $_GET['additional_profile_field']
  184. );
  185. }
  186. // Display the header.
  187. Display::display_header($nameTools, 'Tracking');
  188. /* MAIN CODE */
  189. $actionsLeft = Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM);
  190. $actionsLeft .= Display::url(
  191. Display::return_icon('group.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM),
  192. 'course_log_groups.php?'.api_get_cidreq()
  193. );
  194. $actionsLeft .= Display::url(
  195. Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM),
  196. 'course_log_tools.php?'.api_get_cidreq()
  197. );
  198. $actionsLeft .= Display::url(
  199. Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM),
  200. 'course_log_resources.php?'.api_get_cidreq()
  201. );
  202. $actionsLeft .= Display::url(
  203. Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), ICON_SIZE_MEDIUM),
  204. api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq()
  205. );
  206. if (!empty($sessionId)) {
  207. $actionsLeft .= Display::url(
  208. Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
  209. api_get_path(WEB_CODE_PATH) . 'attendance/index.php?' . api_get_cidreq() . '&action=calendar_logins'
  210. );
  211. }
  212. $actionsRight = '<div class="pull-right">';
  213. $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
  214. Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
  215. $addional_param = '';
  216. if (isset($_GET['additional_profile_field'])) {
  217. $addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']);
  218. }
  219. $users_tracking_per_page = '';
  220. if (isset($_GET['users_tracking_per_page'])) {
  221. $users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
  222. }
  223. $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
  224. '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
  225. $actionsRight .= '</div>';
  226. // Create a search-box.
  227. $form_search = new FormValidator(
  228. 'search_simple',
  229. 'GET',
  230. api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?'.api_get_cidreq(),
  231. '',
  232. array(),
  233. FormValidator::LAYOUT_INLINE
  234. );
  235. $renderer = $form_search->defaultRenderer();
  236. $renderer->setCustomElementTemplate('<span>{element}</span>');
  237. $form_search->addElement('hidden', 'from', Security::remove_XSS($from));
  238. $form_search->addElement('hidden', 'session_id', $sessionId);
  239. $form_search->addElement('hidden', 'id_session', $sessionId);
  240. $form_search->addElement('text', 'user_keyword');
  241. $form_search->addButtonSearch(get_lang('SearchUsers'));
  242. echo Display::toolbarAction('toolbar-courselog', array( 0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight ), 3);
  243. $course_name = get_lang('Course').' '.$courseInfo['name'];
  244. if ($session_id) {
  245. $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
  246. $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
  247. } else {
  248. $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
  249. }
  250. $teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
  251. $courseInfo['code'],
  252. ',',
  253. false,
  254. true
  255. );
  256. $coaches = null;
  257. if (!empty($session_id)) {
  258. $coaches = CourseManager::get_coachs_from_course_to_string(
  259. $session_id,
  260. $courseInfo['real_id'],
  261. ',',
  262. false,
  263. true
  264. );
  265. }
  266. $html = '';
  267. if (!empty($teacherList)) {
  268. $html .= Display::page_subheader2(get_lang('Teachers'));
  269. $html .= $teacherList;
  270. }
  271. if (!empty($coaches)) {
  272. $html .= Display::page_subheader2(get_lang('Coaches'));
  273. $html .= $coaches;
  274. }
  275. $sessionList = SessionManager::get_session_by_course($courseInfo['real_id']);
  276. if (!empty($sessionList)) {
  277. $html .= Display::page_subheader2(get_lang('SessionList'));
  278. $iconCourse = Display::return_icon('course.png', null, null, ICON_SIZE_TINY);
  279. $html .= '<ul class="session-list">';
  280. foreach ($sessionList as $session) {
  281. $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
  282. $html .= Display::tag('li', $iconCourse . ' ' . Display::url($session['name'], $url));
  283. }
  284. $html .= '</ul>';
  285. }
  286. $html .= Display::page_subheader2(get_lang('StudentList'));
  287. // PERSON_NAME_DATA_EXPORT is buggy
  288. $is_western_name_order = api_is_western_name_order();
  289. if (count($a_students) > 0) {
  290. $form = new FormValidator(
  291. 'reminder_form',
  292. 'get',
  293. api_get_path(REL_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq()
  294. );
  295. $options = array (
  296. 2 => '2 '.get_lang('Days'),
  297. 3 => '3 '.get_lang('Days'),
  298. 4 => '4 '.get_lang('Days'),
  299. 5 => '5 '.get_lang('Days'),
  300. 6 => '6 '.get_lang('Days'),
  301. 7 => '7 '.get_lang('Days'),
  302. 15 => '15 '.get_lang('Days'),
  303. 30 => '30 '.get_lang('Days'),
  304. 'never' => get_lang('Never')
  305. );
  306. $el = $form->addSelect('since', get_lang('RemindInactivesLearnersSince'), $options);
  307. /* $el = $form->addElement(
  308. 'select',
  309. 'since',
  310. '<img align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.
  311. get_lang('RemindInactivesLearnersSince'),
  312. $options
  313. ); */
  314. $el->setSelected(7);
  315. $form->addElement('hidden', 'action', 'add');
  316. $form->addElement('hidden', 'remindallinactives', 'true');
  317. $form->addElement('hidden', 'cidReq', $courseInfo['code']);
  318. $form->addElement('hidden', 'id_session', api_get_session_id());
  319. $form->addButtonSend(get_lang('SendNotification'));
  320. $extra_field_select = TrackingCourseLog::display_additional_profile_fields();
  321. if (!empty($extra_field_select)) {
  322. $html .= $extra_field_select;
  323. }
  324. $html .= $form->return_form();
  325. if ($export_csv) {
  326. $csv_content = array();
  327. //override the SortableTable "per page" limit if CSV
  328. $_GET['users_tracking_per_page'] = 1000000;
  329. }
  330. $all_datas = array();
  331. $course_code = $_course['id'];
  332. $user_ids = array_keys($a_students);
  333. $table = new SortableTable(
  334. 'users_tracking',
  335. array('TrackingCourseLog', 'get_number_of_users'),
  336. array('TrackingCourseLog', 'get_user_data'),
  337. (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
  338. $parameters['cidReq'] = Security::remove_XSS($_GET['cidReq']);
  339. $parameters['id_session'] = $session_id;
  340. $parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;
  341. $table->set_additional_parameters($parameters);
  342. $headers = array();
  343. // tab of header texts
  344. $table->set_header(0, get_lang('OfficialCode'), true);
  345. $headers['official_code'] = get_lang('OfficialCode');
  346. if ($is_western_name_order) {
  347. $table->set_header(1, get_lang('FirstName'), true);
  348. $headers['firstname'] = get_lang('FirstName');
  349. $table->set_header(2, get_lang('LastName'), true);
  350. $headers['lastname'] = get_lang('LastName');
  351. } else {
  352. $table->set_header(1, get_lang('LastName'), true);
  353. $headers['lastname'] = get_lang('LastName');
  354. $table->set_header(2, get_lang('FirstName'), true);
  355. $headers['firstname'] = get_lang('FirstName');
  356. }
  357. $table->set_header(3, get_lang('Login'), false);
  358. $headers['login'] = get_lang('Login');
  359. $table->set_header(4, get_lang('TrainingTime').'&nbsp;'.
  360. Display::return_icon('info3.gif', get_lang('TrainingTimeInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  361. $headers['training_time'] = get_lang('TrainingTime');
  362. $table->set_header(5, get_lang('CourseProgress').'&nbsp;'.
  363. Display::return_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  364. $headers['course_progress'] = get_lang('CourseProgress');
  365. $table->set_header(6, get_lang('ExerciseProgress').'&nbsp;'.
  366. Display::return_icon('info3.gif', get_lang('ExerciseProgressInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  367. $headers['exercise_progress'] = get_lang('ExerciseProgress');
  368. $table->set_header(7, get_lang('ExerciseAverage').'&nbsp;'.
  369. Display::return_icon('info3.gif', get_lang('ExerciseAverageInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  370. $headers['exercise_average'] = get_lang('ExerciseAverage');
  371. $table->set_header(8, get_lang('Score').'&nbsp;'.
  372. Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  373. $headers['score'] = get_lang('Score');
  374. $table->set_header(9, get_lang('Student_publication'), false);
  375. $headers['student_publication'] = get_lang('Student_publication');
  376. $table->set_header(10, get_lang('Messages'), false);
  377. $headers['messages'] = get_lang('Messages');
  378. if (empty($session_id)) {
  379. $table->set_header(11, get_lang('Survey'), false);
  380. $headers['survey'] = get_lang('Survey');
  381. $table->set_header(12, get_lang('FirstLoginInCourse'), false);
  382. $headers['first_login'] = get_lang('FirstLoginInCourse');
  383. $table->set_header(13, get_lang('LatestLoginInCourse'), false);
  384. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  385. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  386. $table->set_header(14, $extra_info['display_text'], false);
  387. $headers['display_text'] = $extra_info['display_text'];
  388. $table->set_header(15, get_lang('Details'), false);
  389. $headers['details'] = get_lang('Details');
  390. } else {
  391. $table->set_header(14, get_lang('Details'), false);
  392. $headers['details'] = get_lang('Details');
  393. }
  394. } else {
  395. $table->set_header(11, get_lang('FirstLoginInCourse'), false);
  396. $headers['first_login'] = get_lang('FirstLoginInCourse');
  397. $table->set_header(12, get_lang('LatestLoginInCourse'), false);
  398. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  399. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  400. $table->set_header(13, $extra_info['display_text'], false);
  401. $headers['display_text'] = $extra_info['display_text'];
  402. $table->set_header(14, get_lang('Details'), false);
  403. $headers['Details'] = get_lang('Details');
  404. } else {
  405. $table->set_header(13, get_lang('Details'), false);
  406. $headers['Details'] = get_lang('Details');
  407. }
  408. }
  409. // display buttons to un hide hidden columns
  410. $html .= "<div id='unhideButtons'>";
  411. $index = 0;
  412. foreach ($headers as $header) {
  413. $html .= "<span title='".get_lang('DisplayColumn')." ".$header."' class='unhide_button hide' onclick='foldup($index)'>".
  414. Display :: return_icon(
  415. 'move.png',
  416. get_lang('DisplayColumn'),
  417. array('align'=>'absmiddle', 'hspace'=>'3px'),
  418. 16
  419. )." ".$header."</span>";
  420. $index++;
  421. }
  422. $html .= "</div>";
  423. // Display the table
  424. $html .= "<div id='reporting_table'>";
  425. $html .= $table->return_table();
  426. $html .= "</div>";
  427. } else {
  428. $html .= Display::display_warning_message(get_lang('NoUsersInCourse'), true, true);
  429. }
  430. echo Display::panel($html, $titleSession);
  431. // Send the csv file if asked.
  432. if ($export_csv) {
  433. $csv_headers = array();
  434. $csv_headers[] = get_lang('OfficialCode', '');
  435. if ($is_western_name_order) {
  436. $csv_headers[] = get_lang('FirstName', '');
  437. $csv_headers[] = get_lang('LastName', '');
  438. } else {
  439. $csv_headers[] = get_lang('LastName', '');
  440. $csv_headers[] = get_lang('FirstName', '');
  441. }
  442. $csv_headers[] = get_lang('Login', ''); //
  443. $csv_headers[] = get_lang('TrainingTime', '');
  444. $csv_headers[] = get_lang('CourseProgress', '');
  445. $csv_headers[] = get_lang('ExerciseProgress', '');
  446. $csv_headers[] = get_lang('ExerciseAverage', '');
  447. $csv_headers[] = get_lang('Score', '');
  448. $csv_headers[] = get_lang('Student_publication', '');
  449. $csv_headers[] = get_lang('Messages', '');
  450. if (empty($session_id)) {
  451. $csv_headers[] = get_lang('Survey');
  452. }
  453. $csv_headers[] = get_lang('FirstLoginInCourse', '');
  454. $csv_headers[] = get_lang('LatestLoginInCourse', '');
  455. if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) {
  456. $csv_headers[] = $extra_info['display_text'];
  457. }
  458. ob_end_clean();
  459. array_unshift($csv_content, $csv_headers); // Adding headers before the content.
  460. Export::arrayToCsv($csv_content, 'reporting_student_list');
  461. exit;
  462. }
  463. Display::display_footer();