courseLog.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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 __DIR__.'/../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. SessionManager::user_is_general_coach(api_get_user_id(), $session_id) ||
  27. api_is_allowed_to_create_course() ||
  28. api_is_session_admin() ||
  29. api_is_drh() ||
  30. api_is_course_tutor() ||
  31. api_is_course_admin();
  32. if (!$is_allowedToTrack) {
  33. api_not_allowed(true);
  34. exit;
  35. }
  36. // If the user is a HR director (drh)
  37. if (api_is_drh()) {
  38. // Blocking course for drh
  39. if (api_drh_can_access_all_session_content()) {
  40. // If the drh has been configured to be allowed to see all session content, give him access to the session courses
  41. $coursesFromSession = SessionManager::getAllCoursesFollowedByUser(
  42. api_get_user_id(),
  43. null
  44. );
  45. $coursesFromSessionCodeList = array();
  46. if (!empty($coursesFromSession)) {
  47. foreach ($coursesFromSession as $course) {
  48. $coursesFromSessionCodeList[$course['code']] = $course['code'];
  49. }
  50. }
  51. $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  52. if (!empty($coursesFollowedList)) {
  53. $coursesFollowedList = array_keys($coursesFollowedList);
  54. }
  55. if (!in_array($courseCode, $coursesFollowedList)) {
  56. if (!in_array($courseCode, $coursesFromSessionCodeList)) {
  57. api_not_allowed();
  58. }
  59. }
  60. } else {
  61. // If the drh has *not* been configured to be allowed to see all session content,
  62. // then check if he has also been given access to the corresponding courses
  63. $coursesFollowedList = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  64. $coursesFollowedList = array_keys($coursesFollowedList);
  65. if (!in_array(api_get_course_id(), $coursesFollowedList)) {
  66. api_not_allowed(true);
  67. exit;
  68. }
  69. }
  70. }
  71. if ($export_csv) {
  72. if (!empty($session_id)) {
  73. $_SESSION['id_session'] = $session_id;
  74. }
  75. ob_start();
  76. }
  77. $columnsToHideFromSetting = api_get_configuration_value('course_log_hide_columns');
  78. $columnsToHide = empty($columnsToHideFromSetting) ? array(0, 8, 9, 10, 11) : $columnsToHideFromSetting;
  79. $columnsToHide = json_encode($columnsToHide);
  80. $csv_content = array();
  81. // Scripts for reporting array hide/show columns
  82. $js = "<script>
  83. // hide column and display the button to unhide it
  84. function foldup(in_id) {
  85. $('#reporting_table .data_table tr td:nth-child(' + (in_id + 1) + ')').toggleClass('hide');
  86. $('#reporting_table .data_table tr th:nth-child(' + (in_id + 1) + ')').toggleClass('hide');
  87. $('div#unhideButtons a:nth-child(' + (in_id + 1) + ')').toggleClass('hide');
  88. }
  89. // add the red cross on top of each column
  90. function init_hide() {
  91. $('#reporting_table .data_table tr th').each(
  92. function(index) {
  93. $(this).prepend(
  94. '<div style=\"cursor:pointer\" onclick=\"foldup(' + index + ')\">" . Display::return_icon(
  95. 'visible.png',
  96. get_lang('HideColumn'),
  97. array('align' => 'absmiddle', 'hspace' => '3px'),
  98. ICON_SIZE_SMALL
  99. )."</div>'
  100. );
  101. }
  102. );
  103. }
  104. // hide some column at startup
  105. // be sure that these columns always exists
  106. // see headers = array();
  107. // tab of header texts
  108. $(document).ready( function() {
  109. init_hide();
  110. var columnsToHide = ".$columnsToHide.";
  111. columnsToHide.forEach(function(id) {
  112. foldup(id);
  113. });
  114. })
  115. </script>";
  116. $htmlHeadXtra[] = "<style type='text/css'>
  117. .secLine {background-color : #E6E6E6;}
  118. .content {padding-left : 15px;padding-right : 15px; }
  119. .specialLink{color : #0000FF;}
  120. div#reporting_table table th {
  121. vertical-align:top;
  122. }
  123. </style>";
  124. $htmlHeadXtra[] .= $js;
  125. // Database table definitions.
  126. //@todo remove this calls
  127. $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
  128. $TABLETRACK_LINKS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS);
  129. $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
  130. $TABLETRACK_ACCESS_2 = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
  131. $TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  132. $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
  133. $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
  134. $table_user = Database::get_main_table(TABLE_MAIN_USER);
  135. $TABLEQUIZ = Database::get_course_table(TABLE_QUIZ_TEST);
  136. $sessionId = api_get_session_id();
  137. // Breadcrumbs.
  138. if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  139. $interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin'));
  140. $interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList'));
  141. $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview'));
  142. }
  143. $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : '';
  144. $nameTools = get_lang('Tracking');
  145. // getting all the students of the course
  146. if (empty($session_id)) {
  147. // Registered students in a course outside session.
  148. $a_students = CourseManager::get_student_list_from_course_code(
  149. api_get_course_id()
  150. );
  151. } else {
  152. // Registered students in session.
  153. $a_students = CourseManager::get_student_list_from_course_code(
  154. api_get_course_id(),
  155. true,
  156. $sessionId
  157. );
  158. }
  159. $nbStudents = count($a_students);
  160. $extra_info = array();
  161. // Getting all the additional information of an additional profile field.
  162. if (isset($_GET['additional_profile_field']) &&
  163. is_numeric($_GET['additional_profile_field'])
  164. ) {
  165. $user_array = array();
  166. foreach ($a_students as $key => $item) {
  167. $user_array[] = $key;
  168. }
  169. // Fetching only the user that are loaded NOT ALL user in the portal.
  170. $additional_user_profile_info = TrackingCourseLog::get_addtional_profile_information_of_field_by_user(
  171. $_GET['additional_profile_field'],
  172. $user_array
  173. );
  174. $extra_info = UserManager::get_extra_field_information(
  175. $_GET['additional_profile_field']
  176. );
  177. }
  178. // Display the header.
  179. Display::display_header($nameTools, 'Tracking');
  180. /* MAIN CODE */
  181. $actionsLeft = Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM);
  182. $actionsLeft .= Display::url(
  183. Display::return_icon('group.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM),
  184. 'course_log_groups.php?'.api_get_cidreq()
  185. );
  186. $actionsLeft .= Display::url(
  187. Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM),
  188. 'course_log_tools.php?'.api_get_cidreq()
  189. );
  190. $actionsLeft .= Display::url(
  191. Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM),
  192. 'course_log_resources.php?'.api_get_cidreq()
  193. );
  194. $actionsLeft .= Display::url(
  195. Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), ICON_SIZE_MEDIUM),
  196. api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq()
  197. );
  198. if (!empty($sessionId)) {
  199. $actionsLeft .= Display::url(
  200. Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
  201. api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins'
  202. );
  203. }
  204. $actionsRight = '<div class="pull-right">';
  205. $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
  206. Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
  207. $addional_param = '';
  208. if (isset($_GET['additional_profile_field'])) {
  209. $addional_param = 'additional_profile_field='.intval($_GET['additional_profile_field']);
  210. }
  211. $users_tracking_per_page = '';
  212. if (isset($_GET['users_tracking_per_page'])) {
  213. $users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
  214. }
  215. $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
  216. '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
  217. $actionsRight .= '</div>';
  218. // Create a search-box.
  219. $form_search = new FormValidator(
  220. 'search_simple',
  221. 'GET',
  222. api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?'.api_get_cidreq(),
  223. '',
  224. array(),
  225. FormValidator::LAYOUT_INLINE
  226. );
  227. $form_search->addElement('hidden', 'from', Security::remove_XSS($from));
  228. $form_search->addElement('hidden', 'session_id', $sessionId);
  229. $form_search->addElement('hidden', 'id_session', $sessionId);
  230. $form_search->addElement('text', 'user_keyword');
  231. $form_search->addButtonSearch(get_lang('SearchUsers'));
  232. echo Display::toolbarAction(
  233. 'toolbar-courselog',
  234. [$actionsLeft, $form_search->returnForm(), $actionsRight]
  235. );
  236. $course_name = get_lang('Course').' '.$courseInfo['name'];
  237. if ($session_id) {
  238. $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
  239. $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
  240. } else {
  241. $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
  242. }
  243. $teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
  244. $courseInfo['code'],
  245. ',',
  246. false,
  247. true
  248. );
  249. $coaches = null;
  250. if (!empty($session_id)) {
  251. $coaches = CourseManager::get_coachs_from_course_to_string(
  252. $session_id,
  253. $courseInfo['real_id'],
  254. ',',
  255. false,
  256. true
  257. );
  258. }
  259. $html = '';
  260. if (!empty($teacherList)) {
  261. $html .= Display::page_subheader2(get_lang('Teachers'));
  262. $html .= $teacherList;
  263. }
  264. if (!empty($coaches)) {
  265. $html .= Display::page_subheader2(get_lang('Coaches'));
  266. $html .= $coaches;
  267. }
  268. $sessionList = SessionManager::get_session_by_course($courseInfo['real_id']);
  269. if (!empty($sessionList)) {
  270. $html .= Display::page_subheader2(get_lang('SessionList'));
  271. $icon = Display::return_icon(
  272. 'session.png',
  273. null,
  274. null,
  275. ICON_SIZE_TINY
  276. );
  277. $html .= '<ul class="session-list">';
  278. foreach ($sessionList as $session) {
  279. $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
  280. $html .= Display::tag('li', $icon.' '.Display::url($session['name'], $url));
  281. }
  282. $html .= '</ul>';
  283. }
  284. $html .= Display::page_subheader2(get_lang('StudentList'));
  285. // PERSON_NAME_DATA_EXPORT is buggy
  286. $is_western_name_order = api_is_western_name_order();
  287. if (count($a_students) > 0) {
  288. $getLangXDays = get_lang('XDays');
  289. $form = new FormValidator(
  290. 'reminder_form',
  291. 'get',
  292. api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
  293. null,
  294. ['style' => 'margin-bottom: 10px'],
  295. FormValidator::LAYOUT_INLINE
  296. );
  297. $options = array(
  298. 2 => sprintf($getLangXDays, 2),
  299. 3 => sprintf($getLangXDays, 3),
  300. 4 => sprintf($getLangXDays, 4),
  301. 5 => sprintf($getLangXDays, 5),
  302. 6 => sprintf($getLangXDays, 6),
  303. 7 => sprintf($getLangXDays, 7),
  304. 15 => sprintf($getLangXDays, 15),
  305. 30 => sprintf($getLangXDays, 30),
  306. 'never' => get_lang('Never')
  307. );
  308. $el = $form->addSelect(
  309. 'since',
  310. Display::returnFontAwesomeIcon('warning').get_lang('RemindInactivesLearnersSince'),
  311. $options,
  312. ['class' => 'col-sm-3']
  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('CourseTimeInfo'), 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. $table->set_header(11, get_lang('Classes'));
  379. $headers['clasess'] = get_lang('Classes');
  380. if (empty($session_id)) {
  381. $table->set_header(12, get_lang('Survey'), false);
  382. $headers['survey'] = get_lang('Survey');
  383. $table->set_header(13, get_lang('FirstLoginInCourse'), false);
  384. $headers['first_login'] = get_lang('FirstLoginInCourse');
  385. $table->set_header(14, get_lang('LatestLoginInCourse'), false);
  386. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  387. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  388. $table->set_header(15, $extra_info['display_text'], false);
  389. $headers['display_text'] = $extra_info['display_text'];
  390. $table->set_header(16, get_lang('Details'), false);
  391. $headers['details'] = get_lang('Details');
  392. } else {
  393. $table->set_header(15, get_lang('Details'), false);
  394. $headers['details'] = get_lang('Details');
  395. }
  396. } else {
  397. $table->set_header(12, get_lang('FirstLoginInCourse'), false);
  398. $headers['first_login'] = get_lang('FirstLoginInCourse');
  399. $table->set_header(13, get_lang('LatestLoginInCourse'), false);
  400. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  401. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  402. $table->set_header(14, $extra_info['display_text'], false);
  403. $headers['display_text'] = $extra_info['display_text'];
  404. $table->set_header(15, get_lang('Details'), false);
  405. $headers['Details'] = get_lang('Details');
  406. } else {
  407. $table->set_header(14, get_lang('Details'), false);
  408. $headers['Details'] = get_lang('Details');
  409. }
  410. }
  411. // display buttons to un hide hidden columns
  412. $html .= '<div id="unhideButtons" class="btn-toolbar">';
  413. $index = 0;
  414. $getLangDisplayColumn = get_lang('DisplayColumn');
  415. foreach ($headers as $header) {
  416. $html .= Display::toolbarButton(
  417. $header,
  418. '#',
  419. 'arrow-right',
  420. 'default',
  421. [
  422. 'title' => htmlentities("$getLangDisplayColumn \"$header\"", ENT_QUOTES),
  423. 'class' => 'hide',
  424. 'onclick' => "foldup($index); return false;"
  425. ]
  426. );
  427. $index++;
  428. }
  429. $html .= "</div>";
  430. // Display the table
  431. $html .= "<div id='reporting_table'>";
  432. $html .= $table->return_table();
  433. $html .= "</div>";
  434. } else {
  435. $html .= Display::return_message(get_lang('NoUsersInCourse'), 'warning', true);
  436. }
  437. echo Display::panel($html, $titleSession);
  438. // Send the csv file if asked.
  439. if ($export_csv) {
  440. $csv_headers = array();
  441. $csv_headers[] = get_lang('OfficialCode', '');
  442. if ($is_western_name_order) {
  443. $csv_headers[] = get_lang('FirstName', '');
  444. $csv_headers[] = get_lang('LastName', '');
  445. } else {
  446. $csv_headers[] = get_lang('LastName', '');
  447. $csv_headers[] = get_lang('FirstName', '');
  448. }
  449. $csv_headers[] = get_lang('Login', ''); //
  450. $csv_headers[] = get_lang('TrainingTime', '');
  451. $csv_headers[] = get_lang('CourseProgress', '');
  452. $csv_headers[] = get_lang('ExerciseProgress', '');
  453. $csv_headers[] = get_lang('ExerciseAverage', '');
  454. $csv_headers[] = get_lang('Score', '');
  455. $csv_headers[] = get_lang('Student_publication', '');
  456. $csv_headers[] = get_lang('Messages', '');
  457. if (empty($session_id)) {
  458. $csv_headers[] = get_lang('Survey');
  459. }
  460. $csv_headers[] = get_lang('FirstLoginInCourse', '');
  461. $csv_headers[] = get_lang('LatestLoginInCourse', '');
  462. if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) {
  463. $csv_headers[] = $extra_info['display_text'];
  464. }
  465. ob_end_clean();
  466. array_unshift($csv_content, $csv_headers); // Adding headers before the content.
  467. Export::arrayToCsv($csv_content, 'reporting_student_list');
  468. exit;
  469. }
  470. Display::display_footer();