myStudents.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Implements the tracking of students in the Reporting pages
  5. * @package chamilo.reporting
  6. */
  7. /**
  8. * Code
  9. */
  10. // name of the language file that needs to be included
  11. $language_file = array('registration', 'index', 'tracking', 'exercice', 'admin', 'gradebook', 'survey');
  12. require_once '../inc/global.inc.php';
  13. require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
  14. require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
  15. require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
  16. require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/gradebookitem.class.php';
  17. require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/evaluation.class.php';
  18. require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/result.class.php';
  19. require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/linkfactory.class.php';
  20. require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/category.class.php';
  21. require_once api_get_path(LIBRARY_PATH).'attendance.lib.php';
  22. require_once api_get_path(SYS_CODE_PATH).'survey/survey.lib.php';
  23. api_block_anonymous_users();
  24. if (!api_is_allowed_to_create_course() && !api_is_session_admin() && !api_is_drh()) {
  25. // Check if the user is tutor of the course
  26. $user_course_status = CourseManager::get_tutor_in_course_status(api_get_user_id(), api_get_course_id());
  27. if ($user_course_status != 1) {
  28. api_not_allowed(true);
  29. }
  30. }
  31. $htmlHeadXtra[] = '<script>
  32. function show_image(image,width,height) {
  33. width = parseInt(width) + 20;
  34. height = parseInt(height) + 20;
  35. window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
  36. }
  37. </script>';
  38. $export_csv = isset ($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  39. if ($export_csv) {
  40. ob_start();
  41. }
  42. $csv_content = array();
  43. $from_myspace = false;
  44. if (isset ($_GET['from']) && $_GET['from'] == 'myspace') {
  45. $from_myspace = true;
  46. $this_section = SECTION_TRACKING;
  47. } else {
  48. $this_section = SECTION_COURSES;
  49. }
  50. $nameTools = get_lang('StudentDetails');
  51. $get_course_code = Security :: remove_XSS($_GET['course']);
  52. if (isset($_GET['details'])) {
  53. if (!empty ($_GET['origin']) && $_GET['origin'] == 'user_course') {
  54. $course_info = CourseManager :: get_course_information($get_course_code);
  55. if (empty ($cidReq)) {
  56. $interbreadcrumb[] = array (
  57. "url" => api_get_path(WEB_COURSE_PATH) . $course_info['directory'],
  58. 'name' => $course_info['title']
  59. );
  60. }
  61. $interbreadcrumb[] = array (
  62. "url" => "../user/user.php?cidReq=" . $get_course_code,
  63. "name" => get_lang("Users")
  64. );
  65. } else
  66. if (!empty ($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
  67. $course_info = CourseManager :: get_course_information($get_course_code);
  68. if (empty ($cidReq)) {
  69. //$interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_info['directory'], 'name' => $course_info['title']);
  70. }
  71. $interbreadcrumb[] = array (
  72. "url" => "../tracking/courseLog.php?cidReq=".$get_course_code.'&id_session=' . (empty ($_SESSION['id_session']) ? '' : $_SESSION['id_session']),
  73. "name" => get_lang("Tracking")
  74. );
  75. } else
  76. if (!empty ($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  77. $interbreadcrumb[] = array (
  78. 'url' => '../admin/index.php',
  79. "name" => get_lang('PlatformAdmin')
  80. );
  81. $interbreadcrumb[] = array (
  82. 'url' => "../admin/session_list.php",
  83. "name" => get_lang('SessionList')
  84. );
  85. $interbreadcrumb[] = array (
  86. 'url' => "../admin/resume_session.php?id_session=" . Security :: remove_XSS($_GET['id_session']),
  87. "name" => get_lang('SessionOverview')
  88. );
  89. } else {
  90. $interbreadcrumb[] = array (
  91. "url" => "index.php",
  92. "name" => get_lang('MySpace')
  93. );
  94. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  95. $interbreadcrumb[] = array (
  96. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
  97. "name" => get_lang("CoachStudents")
  98. );
  99. $interbreadcrumb[] = array (
  100. "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']) . '&id_coach=' . Security :: remove_XSS($_GET['id_coach']),
  101. "name" => get_lang("StudentDetails")
  102. );
  103. } else {
  104. $interbreadcrumb[] = array (
  105. "url" => "student.php",
  106. "name" => get_lang("MyStudents")
  107. );
  108. $interbreadcrumb[] = array (
  109. "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']),
  110. "name" => get_lang("StudentDetails")
  111. );
  112. }
  113. }
  114. $nameTools = get_lang("DetailsStudentInCourse");
  115. } else {
  116. if (!empty ($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  117. $interbreadcrumb[] = array (
  118. 'url' => '../admin/index.php',
  119. "name" => get_lang('PlatformAdmin')
  120. );
  121. $interbreadcrumb[] = array (
  122. 'url' => "../admin/session_list.php",
  123. "name" => get_lang('SessionList')
  124. );
  125. $interbreadcrumb[] = array (
  126. 'url' => "../admin/resume_session.php?id_session=" . Security :: remove_XSS($_GET['id_session']),
  127. "name" => get_lang('SessionOverview')
  128. );
  129. } else {
  130. $interbreadcrumb[] = array (
  131. "url" => "index.php",
  132. "name" => get_lang('MySpace')
  133. );
  134. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  135. if (isset ($_GET['id_session']) && intval($_GET['id_session']) != 0) {
  136. $interbreadcrumb[] = array (
  137. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $_GET['id_session'],
  138. "name" => get_lang("CoachStudents")
  139. );
  140. } else {
  141. $interbreadcrumb[] = array (
  142. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
  143. "name" => get_lang("CoachStudents")
  144. );
  145. }
  146. } else {
  147. $interbreadcrumb[] = array (
  148. "url" => "student.php",
  149. "name" => get_lang("MyStudents")
  150. );
  151. }
  152. }
  153. }
  154. // Database Table Definitions
  155. $tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  156. $tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  157. if (isset($_GET['user_id']) && $_GET['user_id'] != "") {
  158. $user_id = intval($_GET['user_id']);
  159. } else {
  160. $user_id = api_get_user_id();
  161. }
  162. $session_id = intval($_GET['id_session']);
  163. if (empty($session_id)) {
  164. $session_id = api_get_session_id();
  165. }
  166. $student_id = intval($_GET['student']);
  167. // Action behaviour
  168. $check = Security::check_token('get');
  169. if ($check) {
  170. switch ($_GET['action']) {
  171. case 'reset_lp' :
  172. $course = isset($_GET['course']) ? $_GET['course']:"";
  173. $lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']):"";
  174. if (api_is_allowed_to_edit() && !empty($course) && !empty($lp_id) && !empty($student_id)) {
  175. $course_info = api_get_course_info($course);
  176. delete_student_lp_events($student_id, $lp_id, $course_info, $session_id);
  177. //@todo delete the stats.track_e_exercices records. First implement this http://support.chamilo.org/issues/1334
  178. $message = Display::return_message(get_lang('LPWasReset'),'success');
  179. }
  180. break;
  181. default:
  182. break;
  183. }
  184. Security::clear_token();
  185. }
  186. //Generate a new token
  187. // user info
  188. $user_info = api_get_user_info($student_id);
  189. $courses_in_session = array();
  190. //See #4676
  191. $drh_can_access_all_courses = false;
  192. if (api_is_drh() || api_is_platform_admin()) {
  193. $drh_can_access_all_courses = true;
  194. }
  195. $courses = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());
  196. $courses_in_session_by_coach = array();
  197. $sessions_coached_by_user = Tracking::get_sessions_coached_by_user(api_get_user_id());
  198. // RRHH or session admin
  199. if (api_is_session_admin() || api_is_drh()) {
  200. $courses = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  201. $session_by_session_admin = SessionManager::get_sessions_followed_by_drh(api_get_user_id());
  202. if (!empty($session_by_session_admin)) {
  203. foreach ($session_by_session_admin as $session_coached_by_user) {
  204. $courses_followed_by_coach = Tracking :: get_courses_list_from_session($session_coached_by_user['id']);
  205. $courses_in_session_by_coach[$session_coached_by_user['id']] = $courses_followed_by_coach;
  206. }
  207. }
  208. }
  209. // Teacher or admin
  210. if (!empty($sessions_coached_by_user)) {
  211. foreach ($sessions_coached_by_user as $session_coached_by_user) {
  212. $sid = intval($session_coached_by_user['id']);
  213. $courses_followed_by_coach = Tracking :: get_courses_followed_by_coach(api_get_user_id(), $sid);
  214. $courses_in_session_by_coach[$sid] = $courses_followed_by_coach;
  215. }
  216. }
  217. $sql = "SELECT course_code FROM $tbl_course_user
  218. WHERE relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND user_id = ".intval($user_info['user_id']);
  219. $rs = Database::query($sql);
  220. while ($row = Database :: fetch_array($rs)) {
  221. if ($drh_can_access_all_courses) {
  222. $courses_in_session[0][] = $row['course_code'];
  223. } else {
  224. if (isset($courses[$row['course_code']])) {
  225. $courses_in_session[0][] = $row['course_code'];
  226. }
  227. }
  228. }
  229. // Get the list of sessions where the user is subscribed as student
  230. $sql = 'SELECT id_session, course_code FROM '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).'
  231. WHERE id_user=' . intval($user_info['user_id']);
  232. $rs = Database::query($sql);
  233. $tmp_sessions = array();
  234. while ($row = Database :: fetch_array($rs)) {
  235. $tmp_sessions[] = $row['id_session'];
  236. if ($drh_can_access_all_courses) {
  237. if (in_array($row['id_session'], $tmp_sessions)) {
  238. $courses_in_session[$row['id_session']][] = $row['course_code'];
  239. }
  240. } else {
  241. if (isset($courses_in_session_by_coach[$row['id_session']])) {
  242. if (in_array($row['id_session'], $tmp_sessions)) {
  243. $courses_in_session[$row['id_session']][] = $row['course_code'];
  244. }
  245. }
  246. }
  247. }
  248. if (api_is_drh() && !api_is_platform_admin()) {
  249. if (!empty($student_id)) {
  250. if (api_drh_can_access_all_session_content()) {
  251. //@todo securize drh with student id
  252. /*$users = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus('drh_all', api_get_user_id());
  253. $userList = array();
  254. foreach ($users as $user) {
  255. $userList[] = $user['user_id'];
  256. }
  257. if (!in_array($student_id, $userList)) {
  258. api_not_allowed(true);
  259. }*/
  260. } else {
  261. if (api_is_drh() && !UserManager::is_user_followed_by_drh($student_id, api_get_user_id())) {
  262. api_not_allowed(true);
  263. }
  264. }
  265. }
  266. }
  267. Display :: display_header($nameTools);
  268. if (isset($message)) {
  269. echo $message;
  270. }
  271. $token = Security::get_token();
  272. if (!empty($student_id)) {
  273. // Actions bar
  274. echo '<div class="actions">';
  275. echo '<a href="javascript: window.back();" ">'.Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
  276. echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
  277. echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
  278. if (!empty ($user_info['email'])) {
  279. $send_mail = '<a href="mailto:'.$user_info['email'].'">'.Display :: return_icon('mail_send.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM).'</a>';
  280. } else {
  281. $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM);
  282. }
  283. echo $send_mail;
  284. if (!empty($student_id) && !empty($_GET['course'])) {
  285. //only show link to connection details if course and student were defined in the URL
  286. echo '<a href="access_details.php?student=' . $student_id . '&course=' . Security :: remove_XSS($_GET['course']) . '&amp;origin=' . Security :: remove_XSS($_GET['origin']) . '&amp;cidReq='.Security::remove_XSS($_GET['course']).'&amp;id_session='.$session_id.'">'.
  287. Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>';
  288. }
  289. if (api_can_login_as($student_id)) {
  290. echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$student_id.'&amp;sec_token='.$token.'">'.
  291. Display::return_icon('login_as.png', get_lang('LoginAs'), null, ICON_SIZE_MEDIUM).'</a>&nbsp;&nbsp;';
  292. }
  293. echo '</div>';
  294. // is the user online ?
  295. if (user_is_online($_GET['student'])) {
  296. $online = get_lang('Yes');
  297. } else {
  298. $online = get_lang('No');
  299. }
  300. // get average of score and average of progress by student
  301. $avg_student_progress = $avg_student_score = 0;
  302. $course_code = Security :: remove_XSS($_GET['course']);
  303. if (!CourseManager :: is_user_subscribed_in_course($user_info['user_id'], $course_code, true)) {
  304. unset($courses[$key]);
  305. } else {
  306. $avg_student_progress = Tracking::get_avg_student_progress($user_info['user_id'], $course_code, array(), $session_id);
  307. //the score inside the Reporting table
  308. $avg_student_score = Tracking::get_avg_student_score($user_info['user_id'], $course_code, array(), $session_id);
  309. //var_dump($avg_student_score);
  310. }
  311. $avg_student_progress = round($avg_student_progress, 2);
  312. // time spent on the course
  313. $time_spent_on_the_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($user_info['user_id'], $course_code, $session_id));
  314. // get information about connections on the platform by student
  315. $first_connection_date = Tracking :: get_first_connection_date($user_info['user_id']);
  316. if ($first_connection_date == '') {
  317. $first_connection_date = get_lang('NoConnexion');
  318. }
  319. $last_connection_date = Tracking :: get_last_connection_date($user_info['user_id'], true);
  320. if ($last_connection_date == '') {
  321. $last_connection_date = get_lang('NoConnexion');
  322. }
  323. // cvs informations
  324. $csv_content[] = array (
  325. get_lang('Informations', '')
  326. );
  327. $csv_content[] = array (
  328. get_lang('Name', ''),
  329. get_lang('Email', ''),
  330. get_lang('Tel', '')
  331. );
  332. $csv_content[] = array (
  333. $user_info['complete_name'],
  334. $user_info['email'],
  335. $user_info['phone']
  336. );
  337. $csv_content[] = array ();
  338. // csv tracking
  339. $csv_content[] = array (
  340. get_lang('Tracking', '')
  341. );
  342. $csv_content[] = array (
  343. get_lang('FirstLogin', ''),
  344. get_lang('LatestLogin', ''),
  345. get_lang('TimeSpentInTheCourse', ''),
  346. get_lang('Progress', ''),
  347. get_lang('Score', '')
  348. );
  349. $csv_content[] = array (
  350. strip_tags($first_connection_date),
  351. strip_tags($last_connection_date),
  352. $time_spent_on_the_course,
  353. $avg_student_progress . '%',
  354. $avg_student_score
  355. );
  356. //Show title
  357. $info_course = CourseManager :: get_course_information($course_code);
  358. $coachs_name = '';
  359. $session_name = '';
  360. $nb_login = Tracking :: count_login_per_student($user_info['user_id'], $_GET['course']);
  361. //get coach and session_name if there is one and if session_mode is activated
  362. if ($session_id > 0) {
  363. $session_info = api_get_session_info($session_id);
  364. $course_coachs = api_get_coachs_from_course($session_id, $course_code);
  365. $nb_login = '';
  366. if (!empty($course_coachs)) {
  367. $info_tutor_name = array();
  368. foreach ($course_coachs as $course_coach) {
  369. $info_tutor_name[] = api_get_person_name($course_coach['firstname'], $course_coach['lastname']);
  370. }
  371. $info_course['tutor_name'] = implode(",",$info_tutor_name);
  372. } elseif ($session_coach_id != 0) {
  373. $session_coach_id = intval($session_info['id_coach']);
  374. $coach_info = UserManager::get_user_info_by_id($session_coach_id);
  375. $info_course['tutor_name'] = api_get_person_name($coach_info['firstname'], $coach_info['lastname']);
  376. }
  377. $coachs_name = $info_course['tutor_name'];
  378. $session_name = $session_info['name'];
  379. } // end
  380. $info_course = CourseManager :: get_course_information($get_course_code);
  381. $table_title = Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).$user_info['complete_name'];
  382. echo Display::page_subheader($table_title);
  383. echo '<table width="100%" border="0">';
  384. echo '<tr>';
  385. $image_array = UserManager :: get_user_picture_path_by_id($user_info['user_id'], 'web', false, true);
  386. echo '<td class="borderRight" width="10%" valign="top">';
  387. // get the path,width and height from original picture
  388. $image_file = $image_array['dir'] . $image_array['file'];
  389. $big_image = $image_array['dir'] . 'big_' . $image_array['file'];
  390. $big_image_size = api_getimagesize($big_image);
  391. $big_image_width = $big_image_size['width'];
  392. $big_image_height = $big_image_size['height'];
  393. $url_big_image = $big_image . '?rnd=' . time();
  394. $img_attributes = 'src="' . $image_file . '?rand=' . time() . '" ' .
  395. 'alt="' . $user_info['complete_name']. '" ' .
  396. 'style="float:' . ($text_dir == 'rtl' ? 'right' : 'left') . '; padding:5px;" ';
  397. if ($image_array['file'] == 'unknown.jpg') {
  398. echo '<img ' . $img_attributes . ' />';
  399. } else {
  400. echo '<input type="image" ' . $img_attributes . ' onclick="javascript: return show_image(\'' . $url_big_image . '\',\'' . $big_image_width . '\',\'' . $big_image_height . '\');"/>';
  401. }
  402. echo '</td>';
  403. ?>
  404. <td width="40%" valign="top">
  405. <table width="100%" class="data_table">
  406. <tr>
  407. <th><?php echo get_lang('Information'); ?></th>
  408. </tr>
  409. <tr>
  410. <td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td>
  411. </tr>
  412. <tr>
  413. <td><?php echo get_lang('Email') . ' : ';
  414. if (!empty ($user_info['email'])) {
  415. echo '<a href="mailto:' . $user_info['email'] . '">' . $user_info['email'] . '</a>';
  416. } else {
  417. echo get_lang('NoEmail');
  418. } ?>
  419. </td>
  420. </tr>
  421. <tr>
  422. <td> <?php echo get_lang('Tel') . ' : ';
  423. if (!empty ($user_info['phone'])) {
  424. echo $user_info['phone'];
  425. } else {
  426. echo get_lang('NoTel');
  427. }
  428. ?>
  429. </td>
  430. </tr>
  431. <tr>
  432. <td> <?php echo get_lang('OfficialCode') . ' : ';
  433. if (!empty ($user_info['official_code'])) {
  434. echo $user_info['official_code'];
  435. } else {
  436. echo get_lang('NoOfficialCode');
  437. }
  438. ?>
  439. </td>
  440. </tr>
  441. <tr>
  442. <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
  443. </tr>
  444. <?php
  445. // Display timezone if the user selected one and if the admin allows the use of user's timezone
  446. $timezone = null;
  447. $timezone_user = UserManager::get_extra_user_data_by_field($user_info['user_id'],'timezone');
  448. $use_users_timezone = api_get_setting('use_users_timezone', 'timezones');
  449. if ($timezone_user['timezone'] != null && $use_users_timezone == 'true') {
  450. $timezone = $timezone_user['timezone'];
  451. }
  452. if ($timezone !== null) {
  453. ?>
  454. <tr>
  455. <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
  456. </tr>
  457. <?php
  458. }
  459. ?>
  460. </table>
  461. </td>
  462. <td class="borderLeft" width="35%" valign="top">
  463. <table width="100%" class="data_table">
  464. <tr>
  465. <th colspan="2"><?php echo get_lang('Tracking'); ?></th>
  466. </tr>
  467. <tr><td align="right"><?php echo get_lang('FirstLogin') ?></td>
  468. <td align="left"><?php echo $first_connection_date ?></td>
  469. </tr>
  470. <tr>
  471. <td align="right"><?php echo get_lang('LatestLogin') ?></td>
  472. <td align="left"><?php echo $last_connection_date ?></td>
  473. </tr>
  474. <?php if (isset($_GET['details']) && $_GET['details'] == 'true') {?>
  475. <tr>
  476. <td align="right"><?php echo get_lang('TimeSpentInTheCourse') ?></td>
  477. <td align="left"><?php echo $time_spent_on_the_course ?></td>
  478. </tr>
  479. <tr>
  480. <td align="right"><?php echo get_lang('Progress').' '; Display :: display_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px'));?></td>
  481. <td align="left"><?php echo $avg_student_progress.'%' ?></td>
  482. </tr>
  483. <tr>
  484. <td align="right"><?php echo get_lang('Score').' '; Display :: display_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?>
  485. </td>
  486. <td align="left"><?php if (is_numeric($avg_student_score)) { echo $avg_student_score.'%';} else { echo $avg_student_score ;} ?></td>
  487. </tr>
  488. <?php
  489. if (!empty($nb_login)) {
  490. echo '<tr><td align="right">'.get_lang('CountToolAccess').'</td>';
  491. echo '<td align="left">'.$nb_login.'</td>';
  492. echo '</tr>';
  493. }
  494. } ?>
  495. </table>
  496. </td>
  497. </tr>
  498. </table>
  499. <?php
  500. $table_title = '';
  501. if (!empty($session_id)) {
  502. $session_name = api_get_session_name($session_id);
  503. $table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ':'');
  504. }
  505. if (!empty($info_course['title'])) {
  506. $table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$info_course['title'].' ':'');
  507. }
  508. echo Display::page_subheader($table_title);
  509. if (empty($_GET['details'])) {
  510. $csv_content[] = array();
  511. $csv_content[] = array(
  512. get_lang('Session', ''),
  513. get_lang('Course', ''),
  514. get_lang('Time', ''),
  515. get_lang('Progress', ''),
  516. get_lang('Score', ''),
  517. get_lang('AttendancesFaults', ''),
  518. get_lang('Evaluations')
  519. );
  520. $attendance = new Attendance();
  521. foreach ($courses_in_session as $key => $courses) {
  522. $session_id = $key;
  523. $session_info = api_get_session_info($session_id);
  524. $session_name = $session_info['name'];
  525. $date_start = '';
  526. if (!empty($session_info['date_start']) && $session_info['date_start'] != '0000-00-00') {
  527. $date_start = api_format_date($session_info['date_start'], DATE_FORMAT_SHORT);
  528. }
  529. $date_end = '';
  530. if (!empty($session_info['date_end']) && $session_info['date_end'] != '0000-00-00') {
  531. $date_end = api_format_date($session_info['date_end'], DATE_FORMAT_SHORT);
  532. }
  533. if (!empty($date_start) && !empty($date_end)) {
  534. $date_session = get_lang('From') . ' ' . $date_start . ' ' . get_lang('Until') . ' ' . $date_end;
  535. }
  536. $title = '';
  537. if (empty($session_id)) {
  538. $title = Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_SMALL).' '.get_lang('Courses');
  539. } else {
  540. $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
  541. }
  542. // Courses
  543. echo '<h3>'.$title.'</h3>';
  544. echo '<table class="data_table">';
  545. echo '<tr>
  546. <th>'.get_lang('Course').'</th>
  547. <th>'.get_lang('Time').'</th>
  548. <th>'.get_lang('Progress').'</th>
  549. <th>'.get_lang('Score').'</th>
  550. <th>'.get_lang('AttendancesFaults').'</th>
  551. <th>'.get_lang('Evaluations').'</th>
  552. <th>'.get_lang('Details').'</th>
  553. </tr>';
  554. if (!empty($courses)) {
  555. foreach ($courses as $course_code) {
  556. if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
  557. $course_info = CourseManager :: get_course_information($course_code);
  558. $time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($user_info['user_id'], $course_code, $session_id));
  559. // get average of faults in attendances by student
  560. $results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $session_id);
  561. if (!empty($results_faults_avg['total'])) {
  562. if (api_is_drh()) {
  563. $attendances_faults_avg = '<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$course_code.'&id_session='.$session_id.'&student_id='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>';
  564. } else {
  565. $attendances_faults_avg = $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)';
  566. }
  567. } else {
  568. $attendances_faults_avg = '0/0 (0%)';
  569. }
  570. // get evaluatios by student
  571. $cats = Category::load(null, null, $course_code, null, null, $session_id);
  572. $scoretotal = array();
  573. if (isset($cats) && isset($cats[0])) {
  574. if (!empty($session_id)) {
  575. $scoretotal= $cats[0]->calc_score($student_id, $course_code, $session_id);
  576. } else {
  577. $scoretotal= $cats[0]->calc_score($student_id, $course_code);
  578. }
  579. }
  580. $scoretotal_display = '0/0 (0%)';
  581. if (!empty($scoretotal)) {
  582. $scoretotal_display = round($scoretotal[0],1).'/'.round($scoretotal[1],1).' ('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)';
  583. }
  584. $progress = Tracking::get_avg_student_progress($user_info['user_id'], $course_code, null, $session_id);
  585. $score = Tracking :: get_avg_student_score($user_info['user_id'], $course_code, null, $session_id);
  586. $progress = empty($progress) ? '0%' : $progress.'%';
  587. $score = empty($score) ? '0%' : $score.'%';
  588. $csv_content[] = array (
  589. $session_name,
  590. $course_info['title'],
  591. $time_spent_on_course,
  592. $progress,
  593. $score,
  594. $attendances_faults_avg,
  595. $scoretotal_display
  596. );
  597. echo '<tr>
  598. <td >'.$course_info['title'].'</td>
  599. <td >'.$time_spent_on_course .'</td>
  600. <td >'.$progress.'</td>
  601. <td >'.$score.'</td>
  602. <td >'.$attendances_faults_avg.'</td>
  603. <td >'.$scoretotal_display.'</td>';
  604. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  605. echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
  606. } else {
  607. echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
  608. }
  609. echo '</tr>';
  610. }
  611. }
  612. } else {
  613. echo "<tr><td colspan='5'>".get_lang('NoCourse')."</td></tr>";
  614. }
  615. echo '</table>';
  616. }
  617. } else {
  618. $csv_content[] = array ();
  619. $csv_content[] = array (str_replace('&nbsp;', '', $table_title));
  620. $t_lp = Database :: get_course_table(TABLE_LP_MAIN);
  621. // csv export headers
  622. $csv_content[] = array ();
  623. $csv_content[] = array (
  624. get_lang('Learnpath', ''),
  625. get_lang('Time', ''),
  626. get_lang('AverageScore', ''),
  627. get_lang('LatestScore', ''),
  628. get_lang('Progress', ''),
  629. get_lang('LastConnexion', '')
  630. );
  631. if (empty($session_id)) {
  632. $sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp WHERE session_id = 0 AND c_id = {$info_course['real_id']} ORDER BY lp.display_order";
  633. } else {
  634. $sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp WHERE c_id = {$info_course['real_id']} ORDER BY lp.display_order";
  635. }
  636. $rs_lp = Database::query($sql_lp);
  637. if (Database :: num_rows($rs_lp) > 0) {
  638. ?>
  639. <!-- LPs-->
  640. <table class="data_table">
  641. <tr>
  642. <th><?php echo get_lang('Learnpaths');?></th>
  643. <th><?php echo get_lang('Time').' '; Display :: display_icon('info3.gif', get_lang('TotalTimeByCourse'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  644. <th><?php echo get_lang('AverageScore').' '; Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInAllAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  645. <th><?php echo get_lang('LatestAttemptAverageScore').' '; Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInTheLatestAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  646. <th><?php echo get_lang('Progress').' '; Display :: display_icon('info3.gif', get_lang('LPProgressScore'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
  647. <th><?php echo get_lang('LastConnexion').' '; Display :: display_icon('info3.gif', get_lang('LastTimeTheCourseWasUsed'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
  648. <?php
  649. echo '<th>'.get_lang('Details').'</th>';
  650. if (api_is_allowed_to_edit()) {
  651. echo '<th>'.get_lang('ResetLP').'</th>';
  652. }
  653. ?>
  654. </tr>
  655. <?php
  656. $i = 0;
  657. while ($learnpath = Database :: fetch_array($rs_lp)) {
  658. $lp_id = intval($learnpath['id']);
  659. $lp_name = $learnpath['name'];
  660. $any_result = false;
  661. // Get progress in lp
  662. $progress = Tracking::get_avg_student_progress($student_id, $course_code, array($lp_id), $session_id);
  663. if ($progress === null) {
  664. $progress = '0%';
  665. } else {
  666. $any_result = true;
  667. }
  668. // Get time in lp
  669. $total_time = Tracking::get_time_spent_in_lp($student_id, $course_code, array($lp_id),$session_id);
  670. if (!empty($total_time)) $any_result = true;
  671. // Get last connection time in lp
  672. $start_time = Tracking::get_last_connection_time_in_lp($student_id, $course_code, $lp_id, $session_id);
  673. if (!empty($start_time)) {
  674. $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
  675. } else {
  676. $start_time = '-';
  677. }
  678. if (!empty($total_time)) $any_result = true;
  679. // Quizz in lp
  680. $score = Tracking::get_avg_student_score($student_id, $course_code, array($lp_id),$session_id);
  681. // Latest exercise results in a LP
  682. $score_latest = Tracking :: get_avg_student_score($student_id, $course_code, array($lp_id),$session_id, false, true);
  683. if ($i % 2 == 0) $css_class = "row_even";
  684. else $css_class = "row_odd";
  685. $i++;
  686. // csv export content
  687. $csv_content[] = array (
  688. api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset),
  689. api_time_to_hms($total_time),
  690. $score . '%',
  691. $score_latest . '%',
  692. $progress.'%',
  693. $start_time
  694. );
  695. echo '<tr class="'.$css_class.'">';
  696. echo Display::tag('td', stripslashes($lp_name));
  697. echo Display::tag('td', api_time_to_hms($total_time));
  698. if (!is_null($score)) {
  699. if (is_numeric($score)) {
  700. $score = $score.'%';
  701. }
  702. }
  703. echo Display::tag('td', $score);
  704. if (!is_null($score_latest)) {
  705. if (is_numeric($score_latest)) {
  706. $score_latest = $score_latest.'%';
  707. }
  708. }
  709. echo Display::tag('td', $score_latest);
  710. if (is_numeric($progress)) {
  711. $progress = $progress.'%';
  712. } else {
  713. $progress = '-';
  714. }
  715. echo Display::tag('td', $progress);
  716. //Do not change with api_convert_and_format_date, because this value came from the lp_item_view table
  717. //which implies several other changes not a priority right now
  718. echo Display::tag('td', $start_time);
  719. if ($any_result === true) {
  720. $from = '';
  721. if ($from_myspace) {
  722. $from ='&from=myspace';
  723. }
  724. $link = Display::url('<img src="../img/2rightarrow.gif" border="0" />','lp_tracking.php?course='.Security::remove_XSS($_GET['course']).$from.'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student_id='.$user_info['user_id'].'&id_session='.$session_id);
  725. echo Display::tag('td', $link);
  726. }
  727. if (api_is_allowed_to_edit()) {
  728. echo '<td>';
  729. if ($any_result === true) {
  730. echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&course='.Security::remove_XSS($_GET['course']).'&details='.Security::remove_XSS($_GET['details']).'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student='.$user_info['user_id'].'&details=true&id_session='.Security::remove_XSS($_GET['id_session']).'">';
  731. echo Display::return_icon('clean.png',get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
  732. echo '</a>';
  733. }
  734. echo '</td>';
  735. echo '</tr>';
  736. }
  737. $data_learnpath[$i][] = $lp_name;
  738. $data_learnpath[$i][] = $progress . '%';
  739. }
  740. } else {
  741. //echo '<tr><td colspan="6">'.get_lang('NoLearnpath').'</td></tr>';
  742. }
  743. ?>
  744. </table>
  745. <!-- line about exercises -->
  746. <table class="data_table">
  747. <tr>
  748. <th><?php echo get_lang('Exercices'); ?></th>
  749. <th><?php echo get_lang('LearningPath');?></th>
  750. <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
  751. <th><?php echo get_lang('Attempts'); ?></th>
  752. <th><?php echo get_lang('LatestAttempt'); ?></th>
  753. <th><?php echo get_lang('AllAttempts'); ?></th>
  754. </tr>
  755. <?php
  756. $csv_content[] = array ();
  757. $csv_content[] = array (
  758. get_lang('Exercices'),
  759. get_lang('Score'),
  760. get_lang('Attempts')
  761. );
  762. $t_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
  763. $sql_exercices = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
  764. WHERE quiz.c_id = ".$info_course['real_id']." AND
  765. (quiz.session_id = $session_id OR quiz.session_id = 0)
  766. ORDER BY quiz.title ASC ";
  767. $result_exercices = Database::query($sql_exercices);
  768. $i = 0;
  769. if (Database :: num_rows($result_exercices) > 0) {
  770. while ($exercices = Database :: fetch_array($result_exercices)) {
  771. $exercise_id = intval($exercices['id']);
  772. $count_attempts = Tracking::count_student_exercise_attempts($student_id, $course_code, $exercise_id, 0, 0, $session_id, 2);
  773. $score_percentage = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $session_id, 1, 0);
  774. if (!isset($score_percentage) && $count_attempts > 0) {
  775. $scores_lp = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $session_id, 2, 1);
  776. $score_percentage = $scores_lp[0];
  777. $lp_name = $scores_lp[1];
  778. } else {
  779. $lp_name = '-';
  780. }
  781. $lp_name = !empty($lp_name) ? $lp_name : get_lang('NoLearnpath');
  782. $csv_content[] = array (
  783. $exercices['title'],
  784. $score_percentage . '%',
  785. $count_attempts
  786. );
  787. if ($i % 2) {
  788. $css_class = 'row_odd';
  789. } else {
  790. $css_class = 'row_even';
  791. }
  792. echo '<tr class="'.$css_class.'"><td>'.$exercices['title'].'</td>';
  793. echo '<td>';
  794. if (!empty($lp_name)) {
  795. echo $lp_name;
  796. } else {
  797. echo '-';
  798. }
  799. echo '</td>';
  800. echo '<td>';
  801. if ($count_attempts > 0) {
  802. echo $score_percentage . '%';
  803. } else {
  804. echo '-';
  805. $score_percentage = 0;
  806. }
  807. echo '</td>';
  808. echo '<td>'.$count_attempts.'</td>';
  809. echo '<td>';
  810. $sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
  811. WHERE exe_exo_id ="'.$exercise_id.'" AND
  812. exe_user_id ="'.$student_id.'" AND
  813. exe_cours_id ="'.$course_code.'" AND
  814. session_id ="'.$session_id.'" AND
  815. status = ""
  816. ORDER BY exe_date DESC LIMIT 1';
  817. $result_last_attempt = Database::query($sql_last_attempt);
  818. if (Database :: num_rows($result_last_attempt) > 0) {
  819. $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
  820. if ($count_attempts > 0)
  821. echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$session_id.'&student='.$student_id.'&origin='.(empty($_GET['origin'])?'tracking':Security::remove_XSS($_GET['origin'])).'"> <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" border="0" /> </a>';
  822. }
  823. echo '</td>';
  824. echo '<td>';
  825. $all_attempt_url = "../exercice/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$session_id";
  826. echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );
  827. echo '</td></tr>';
  828. $data_exercices[$i][] = $exercices['title'];
  829. $data_exercices[$i][] = $score_percentage . '%';
  830. $data_exercices[$i][] = $count_attempts;
  831. $i++;
  832. }
  833. } else {
  834. echo '<tr><td colspan="6">'.get_lang('NoExercise').'</td></tr>';
  835. }
  836. echo '</table>';
  837. //@when using sessions we do not show the survey list
  838. if (empty($session_id)) {
  839. $survey_list = survey_manager::get_surveys($course_code, $session_id);
  840. $survey_data = array();
  841. foreach($survey_list as $survey) {
  842. $user_list = survey_manager::get_people_who_filled_survey($survey['survey_id'], false, $info_course['real_id']);
  843. $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
  844. if (in_array($student_id, $user_list)) {
  845. $survey_done = Display::return_icon("accept.png", get_lang('Answered'), array(), ICON_SIZE_SMALL);
  846. }
  847. $data = array('title' => $survey['title'], 'done' => $survey_done);
  848. $survey_data[] = $data;
  849. }
  850. if (!empty($survey_list)) {
  851. $table = new HTML_Table(array('class' => 'data_table'));
  852. $header_names = array(get_lang('Survey'), get_lang('Answered'));
  853. $row = 0;
  854. $column = 0;
  855. foreach ($header_names as $item) {
  856. $table->setHeaderContents($row, $column, $item);
  857. $column++;
  858. }
  859. $row = 1;
  860. if (!empty($survey_data)) {
  861. foreach ($survey_data as $data) {
  862. $column = 0;
  863. $table->setCellContents($row, $column, $data);
  864. //$table->setRowAttributes($row, 'style="text-align:center"');
  865. $class = 'class="row_odd"';
  866. if($row % 2) {
  867. $class = 'class="row_even"';
  868. }
  869. $table->setRowAttributes($row, $class, true);
  870. $column++;
  871. $row++;
  872. }
  873. }
  874. echo $table->toHtml();
  875. }
  876. }
  877. // line about other tools
  878. echo '<table class="data_table">';
  879. $csv_content[] = array ();
  880. $nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $session_id);
  881. $messages = Tracking::count_student_messages($student_id, $course_code, $session_id);
  882. $links = Tracking::count_student_visited_links($student_id, $course_code, $session_id);
  883. $chat_last_connection = Tracking::chat_last_connection($student_id, $course_code, $session_id);
  884. $documents = Tracking::count_student_downloaded_documents($student_id, $course_code, $session_id);
  885. $uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $session_id);
  886. $csv_content[] = array (
  887. get_lang('Student_publication'),
  888. $nb_assignments
  889. );
  890. $csv_content[] = array (
  891. get_lang('Messages'),
  892. $messages
  893. );
  894. $csv_content[] = array (
  895. get_lang('LinksDetails'),
  896. $links
  897. );
  898. $csv_content[] = array (
  899. get_lang('DocumentsDetails'),
  900. $documents
  901. );
  902. $csv_content[] = array (
  903. get_lang('UploadedDocuments'),
  904. $uploaded_documents
  905. );
  906. $csv_content[] = array (
  907. get_lang('ChatLastConnection'),
  908. $chat_last_connection
  909. );
  910. ?>
  911. <tr>
  912. <th colspan="2"><?php echo get_lang('OtherTools'); ?></th>
  913. </tr>
  914. <tr><!-- assignments -->
  915. <td width="40%"><?php echo get_lang('Student_publication') ?></td>
  916. <td><?php echo $nb_assignments ?></td>
  917. </tr>
  918. <tr><!-- messages -->
  919. <td><?php echo get_lang('Messages') ?></td>
  920. <td><?php echo $messages ?></td>
  921. </tr>
  922. <tr><!-- links -->
  923. <td><?php echo get_lang('LinksDetails') ?></td>
  924. <td><?php echo $links ?></td>
  925. </tr>
  926. <tr><!-- downloaded documents -->
  927. <td><?php echo get_lang('DocumentsDetails') ?></td>
  928. <td><?php echo $documents ?></td>
  929. </tr>
  930. <tr><!-- uploaded documents -->
  931. <td><?php echo get_lang('UploadedDocuments') ?></td>
  932. <td><?php echo $uploaded_documents ?></td>
  933. </tr>
  934. <tr><!-- Chats -->
  935. <td><?php echo get_lang('ChatLastConnection') ?></td>
  936. <td><?php echo $chat_last_connection; ?></td>
  937. </tr>
  938. </table>
  939. </td>
  940. </tr>
  941. </table>
  942. <?php
  943. } //end details
  944. }
  945. if ($export_csv) {
  946. ob_end_clean();
  947. Export :: export_table_csv($csv_content, 'reporting_student');
  948. exit;
  949. }
  950. /* FOOTER */
  951. Display :: display_footer();