courseLog.php 20 KB

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