courseLog.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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(0, 8, 9, 10, 11) : $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 + 1) + ')').toggleClass('hide');
  84. $('#reporting_table .data_table tr th:nth-child(' + (in_id + 1) + ')').toggleClass('hide');
  85. $('div#unhideButtons a:nth-child(' + (in_id + 1) + ')').toggleClass('hide');
  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. $(this).prepend(
  92. '<div style=\"cursor:pointer\" onclick=\"foldup(' + index + ')\">" . Display::return_icon(
  93. 'visible.png',
  94. get_lang('HideColumn'),
  95. array('align' => 'absmiddle', 'hspace' => '3px'),
  96. ICON_SIZE_SMALL
  97. ) . "</div>'
  98. );
  99. }
  100. );
  101. }
  102. // hide some column at startup
  103. // be sure that these columns always exists
  104. // see headers = array();
  105. // tab of header texts
  106. $(document).ready( function() {
  107. init_hide();
  108. var columnsToHide = ".$columnsToHide.";
  109. columnsToHide.forEach(function(id) {
  110. foldup(id);
  111. });
  112. })
  113. </script>";
  114. $htmlHeadXtra[] = "<style type='text/css'>
  115. .secLine {background-color : #E6E6E6;}
  116. .content {padding-left : 15px;padding-right : 15px; }
  117. .specialLink{color : #0000FF;}
  118. div#reporting_table table th {
  119. vertical-align:top;
  120. }
  121. </style>";
  122. $htmlHeadXtra[] .= $js;
  123. // Database table definitions.
  124. //@todo remove this calls
  125. $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
  126. $TABLETRACK_LINKS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS);
  127. $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
  128. $TABLETRACK_ACCESS_2 = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
  129. $TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  130. $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
  131. $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
  132. $table_user = Database::get_main_table(TABLE_MAIN_USER);
  133. $TABLEQUIZ = Database::get_course_table(TABLE_QUIZ_TEST);
  134. $sessionId = api_get_session_id();
  135. // Breadcrumbs.
  136. if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  137. $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
  138. $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList'));
  139. $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview'));
  140. }
  141. $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : '';
  142. $nameTools = get_lang('Tracking');
  143. // getting all the students of the course
  144. if (empty($session_id)) {
  145. // Registered students in a course outside session.
  146. $a_students = CourseManager::get_student_list_from_course_code(
  147. api_get_course_id()
  148. );
  149. } else {
  150. // Registered students in session.
  151. $a_students = CourseManager::get_student_list_from_course_code(
  152. api_get_course_id(),
  153. true,
  154. $sessionId
  155. );
  156. }
  157. $nbStudents = count($a_students);
  158. $extra_info = array();
  159. // Getting all the additional information of an additional profile field.
  160. if (isset($_GET['additional_profile_field']) &&
  161. is_numeric($_GET['additional_profile_field'])
  162. ) {
  163. $user_array = array();
  164. foreach ($a_students as $key => $item) {
  165. $user_array[] = $key;
  166. }
  167. // Fetching only the user that are loaded NOT ALL user in the portal.
  168. $additional_user_profile_info = TrackingCourseLog::get_addtional_profile_information_of_field_by_user(
  169. $_GET['additional_profile_field'],
  170. $user_array
  171. );
  172. $extra_info = UserManager::get_extra_field_information(
  173. $_GET['additional_profile_field']
  174. );
  175. }
  176. // Display the header.
  177. Display::display_header($nameTools, 'Tracking');
  178. /* MAIN CODE */
  179. $actionsLeft = Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM);
  180. $actionsLeft .= Display::url(
  181. Display::return_icon('group.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM),
  182. 'course_log_groups.php?'.api_get_cidreq()
  183. );
  184. $actionsLeft .= Display::url(
  185. Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM),
  186. 'course_log_tools.php?'.api_get_cidreq()
  187. );
  188. $actionsLeft .= Display::url(
  189. Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM),
  190. 'course_log_resources.php?'.api_get_cidreq()
  191. );
  192. $actionsLeft .= Display::url(
  193. Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), ICON_SIZE_MEDIUM),
  194. api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq()
  195. );
  196. if (!empty($sessionId)) {
  197. $actionsLeft .= Display::url(
  198. Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
  199. api_get_path(WEB_CODE_PATH) . 'attendance/index.php?' . api_get_cidreq() . '&action=calendar_logins'
  200. );
  201. }
  202. $actionsRight = '<div class="pull-right">';
  203. $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
  204. Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
  205. $addional_param = '';
  206. if (isset($_GET['additional_profile_field'])) {
  207. $addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']);
  208. }
  209. $users_tracking_per_page = '';
  210. if (isset($_GET['users_tracking_per_page'])) {
  211. $users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
  212. }
  213. $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
  214. '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
  215. $actionsRight .= '</div>';
  216. // Create a search-box.
  217. $form_search = new FormValidator(
  218. 'search_simple',
  219. 'GET',
  220. api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?'.api_get_cidreq(),
  221. '',
  222. array(),
  223. FormValidator::LAYOUT_INLINE
  224. );
  225. $form_search->addElement('hidden', 'from', Security::remove_XSS($from));
  226. $form_search->addElement('hidden', 'session_id', $sessionId);
  227. $form_search->addElement('hidden', 'id_session', $sessionId);
  228. $form_search->addElement('text', 'user_keyword');
  229. $form_search->addButtonSearch(get_lang('SearchUsers'));
  230. echo Display::toolbarAction('toolbar-courselog', array( 0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight ), 3);
  231. $course_name = get_lang('Course').' '.$courseInfo['name'];
  232. if ($session_id) {
  233. $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
  234. $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
  235. } else {
  236. $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
  237. }
  238. $teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
  239. $courseInfo['code'],
  240. ',',
  241. false,
  242. true
  243. );
  244. $coaches = null;
  245. if (!empty($session_id)) {
  246. $coaches = CourseManager::get_coachs_from_course_to_string(
  247. $session_id,
  248. $courseInfo['real_id'],
  249. ',',
  250. false,
  251. true
  252. );
  253. }
  254. $html = '';
  255. if (!empty($teacherList)) {
  256. $html .= Display::page_subheader2(get_lang('Teachers'));
  257. $html .= $teacherList;
  258. }
  259. if (!empty($coaches)) {
  260. $html .= Display::page_subheader2(get_lang('Coaches'));
  261. $html .= $coaches;
  262. }
  263. $sessionList = SessionManager::get_session_by_course($courseInfo['real_id']);
  264. if (!empty($sessionList)) {
  265. $html .= Display::page_subheader2(get_lang('SessionList'));
  266. $iconCourse = Display::return_icon('course.png', null, null, ICON_SIZE_TINY);
  267. $html .= '<ul class="session-list">';
  268. foreach ($sessionList as $session) {
  269. $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
  270. $html .= Display::tag('li', $iconCourse . ' ' . Display::url($session['name'], $url));
  271. }
  272. $html .= '</ul>';
  273. }
  274. $html .= Display::page_subheader2(get_lang('StudentList'));
  275. // PERSON_NAME_DATA_EXPORT is buggy
  276. $is_western_name_order = api_is_western_name_order();
  277. if (count($a_students) > 0) {
  278. $getLangXDays = get_lang('XDays');
  279. $form = new FormValidator(
  280. 'reminder_form',
  281. 'get',
  282. api_get_path(WEB_CODE_PATH).'announcements/announcements.php?' . api_get_cidreq(),
  283. null,
  284. ['style' => 'margin-bottom: 10px'],
  285. FormValidator::LAYOUT_INLINE
  286. );
  287. $options = array (
  288. 2 => sprintf($getLangXDays, 2),
  289. 3 => sprintf($getLangXDays, 3),
  290. 4 => sprintf($getLangXDays, 4),
  291. 5 => sprintf($getLangXDays, 5),
  292. 6 => sprintf($getLangXDays, 6),
  293. 7 => sprintf($getLangXDays, 7),
  294. 15 => sprintf($getLangXDays, 15),
  295. 30 => sprintf($getLangXDays, 30),
  296. 'never' => get_lang('Never')
  297. );
  298. $el = $form->addSelect(
  299. 'since',
  300. Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'),
  301. $options,
  302. ['class' => 'col-sm-3']
  303. );
  304. $el->setSelected(7);
  305. $form->addElement('hidden', 'action', 'add');
  306. $form->addElement('hidden', 'remindallinactives', 'true');
  307. $form->addElement('hidden', 'cidReq', $courseInfo['code']);
  308. $form->addElement('hidden', 'id_session', api_get_session_id());
  309. $form->addButtonSend(get_lang('SendNotification'));
  310. $extra_field_select = TrackingCourseLog::display_additional_profile_fields();
  311. if (!empty($extra_field_select)) {
  312. $html .= $extra_field_select;
  313. }
  314. $html .= $form->return_form();
  315. if ($export_csv) {
  316. $csv_content = array();
  317. //override the SortableTable "per page" limit if CSV
  318. $_GET['users_tracking_per_page'] = 1000000;
  319. }
  320. $all_datas = array();
  321. $course_code = $_course['id'];
  322. $user_ids = array_keys($a_students);
  323. $table = new SortableTable(
  324. 'users_tracking',
  325. array('TrackingCourseLog', 'get_number_of_users'),
  326. array('TrackingCourseLog', 'get_user_data'),
  327. (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
  328. $parameters['cidReq'] = Security::remove_XSS($_GET['cidReq']);
  329. $parameters['id_session'] = $session_id;
  330. $parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;
  331. $table->set_additional_parameters($parameters);
  332. $headers = array();
  333. // tab of header texts
  334. $table->set_header(0, get_lang('OfficialCode'), true);
  335. $headers['official_code'] = get_lang('OfficialCode');
  336. if ($is_western_name_order) {
  337. $table->set_header(1, get_lang('FirstName'), true);
  338. $headers['firstname'] = get_lang('FirstName');
  339. $table->set_header(2, get_lang('LastName'), true);
  340. $headers['lastname'] = get_lang('LastName');
  341. } else {
  342. $table->set_header(1, get_lang('LastName'), true);
  343. $headers['lastname'] = get_lang('LastName');
  344. $table->set_header(2, get_lang('FirstName'), true);
  345. $headers['firstname'] = get_lang('FirstName');
  346. }
  347. $table->set_header(3, get_lang('Login'), false);
  348. $headers['login'] = get_lang('Login');
  349. $table->set_header(4, get_lang('TrainingTime').'&nbsp;'.
  350. Display::return_icon('info3.gif', get_lang('CourseTimeInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  351. $headers['training_time'] = get_lang('TrainingTime');
  352. $table->set_header(5, get_lang('CourseProgress').'&nbsp;'.
  353. Display::return_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  354. $headers['course_progress'] = get_lang('CourseProgress');
  355. $table->set_header(6, get_lang('ExerciseProgress').'&nbsp;'.
  356. Display::return_icon('info3.gif', get_lang('ExerciseProgressInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  357. $headers['exercise_progress'] = get_lang('ExerciseProgress');
  358. $table->set_header(7, get_lang('ExerciseAverage').'&nbsp;'.
  359. Display::return_icon('info3.gif', get_lang('ExerciseAverageInfo'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  360. $headers['exercise_average'] = get_lang('ExerciseAverage');
  361. $table->set_header(8, get_lang('Score').'&nbsp;'.
  362. Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), false, array('style' => 'width:110px;'));
  363. $headers['score'] = get_lang('Score');
  364. $table->set_header(9, get_lang('Student_publication'), false);
  365. $headers['student_publication'] = get_lang('Student_publication');
  366. $table->set_header(10, get_lang('Messages'), false);
  367. $headers['messages'] = get_lang('Messages');
  368. $table->set_header(11, get_lang('Classes'));
  369. $headers['clasess'] = get_lang('Classes');
  370. if (empty($session_id)) {
  371. $table->set_header(12, get_lang('Survey'), false);
  372. $headers['survey'] = get_lang('Survey');
  373. $table->set_header(13, get_lang('FirstLoginInCourse'), false);
  374. $headers['first_login'] = get_lang('FirstLoginInCourse');
  375. $table->set_header(14, get_lang('LatestLoginInCourse'), false);
  376. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  377. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  378. $table->set_header(15, $extra_info['display_text'], false);
  379. $headers['display_text'] = $extra_info['display_text'];
  380. $table->set_header(16, get_lang('Details'), false);
  381. $headers['details'] = get_lang('Details');
  382. } else {
  383. $table->set_header(15, get_lang('Details'), false);
  384. $headers['details'] = get_lang('Details');
  385. }
  386. } else {
  387. $table->set_header(12, get_lang('FirstLoginInCourse'), false);
  388. $headers['first_login'] = get_lang('FirstLoginInCourse');
  389. $table->set_header(13, get_lang('LatestLoginInCourse'), false);
  390. $headers['latest_login'] = get_lang('LatestLoginInCourse');
  391. if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) {
  392. $table->set_header(14, $extra_info['display_text'], false);
  393. $headers['display_text'] = $extra_info['display_text'];
  394. $table->set_header(15, get_lang('Details'), false);
  395. $headers['Details'] = get_lang('Details');
  396. } else {
  397. $table->set_header(14, get_lang('Details'), false);
  398. $headers['Details'] = get_lang('Details');
  399. }
  400. }
  401. // display buttons to un hide hidden columns
  402. $html .= '<div id="unhideButtons" class="btn-toolbar">';
  403. $index = 0;
  404. $getLangDisplayColumn = get_lang('DisplayColumn');
  405. foreach ($headers as $header) {
  406. $html .= Display::toolbarButton(
  407. $header,
  408. '#',
  409. 'arrow-right',
  410. 'default',
  411. [
  412. 'title' => htmlentities("$getLangDisplayColumn \"$header\"", ENT_QUOTES),
  413. 'class' => 'hide',
  414. 'onclick' => "foldup($index); return false;"
  415. ]
  416. );
  417. $index++;
  418. }
  419. $html .= "</div>";
  420. // Display the table
  421. $html .= "<div id='reporting_table'>";
  422. $html .= $table->return_table();
  423. $html .= "</div>";
  424. } else {
  425. $html .= Display::display_warning_message(get_lang('NoUsersInCourse'), true, true);
  426. }
  427. echo Display::panel($html, $titleSession);
  428. // Send the csv file if asked.
  429. if ($export_csv) {
  430. $csv_headers = array();
  431. $csv_headers[] = get_lang('OfficialCode', '');
  432. if ($is_western_name_order) {
  433. $csv_headers[] = get_lang('FirstName', '');
  434. $csv_headers[] = get_lang('LastName', '');
  435. } else {
  436. $csv_headers[] = get_lang('LastName', '');
  437. $csv_headers[] = get_lang('FirstName', '');
  438. }
  439. $csv_headers[] = get_lang('Login', ''); //
  440. $csv_headers[] = get_lang('TrainingTime', '');
  441. $csv_headers[] = get_lang('CourseProgress', '');
  442. $csv_headers[] = get_lang('ExerciseProgress', '');
  443. $csv_headers[] = get_lang('ExerciseAverage', '');
  444. $csv_headers[] = get_lang('Score', '');
  445. $csv_headers[] = get_lang('Student_publication', '');
  446. $csv_headers[] = get_lang('Messages', '');
  447. if (empty($session_id)) {
  448. $csv_headers[] = get_lang('Survey');
  449. }
  450. $csv_headers[] = get_lang('FirstLoginInCourse', '');
  451. $csv_headers[] = get_lang('LatestLoginInCourse', '');
  452. if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) {
  453. $csv_headers[] = $extra_info['display_text'];
  454. }
  455. ob_end_clean();
  456. array_unshift($csv_content, $csv_headers); // Adding headers before the content.
  457. Export::arrayToCsv($csv_content, 'reporting_student_list');
  458. exit;
  459. }
  460. Display::display_footer();