admin_view.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. $cidReset = true;
  4. require_once __DIR__.'/../inc/global.inc.php';
  5. api_block_anonymous_users();
  6. $exportCSV = isset($_GET['export']) && $_GET['export'] === 'csv' ? true : false;
  7. $display = isset($_GET['display']) ? Security::remove_XSS($_GET['display']) : null;
  8. $htmlHeadXtra[] = api_get_jqgrid_js();
  9. $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery.easy-pie-chart/dist/jquery.easypiechart.js"></script>';
  10. // the section (for the tabs)
  11. $this_section = SECTION_TRACKING;
  12. $csv_content = [];
  13. $nameTools = get_lang('MySpace');
  14. $allowToTrack = api_is_platform_admin(true, true);
  15. if (!$allowToTrack) {
  16. api_not_allowed(true);
  17. }
  18. if ($exportCSV) {
  19. if ($display === 'user') {
  20. MySpace::export_tracking_user_overview();
  21. exit;
  22. } elseif ($display === 'session') {
  23. MySpace::export_tracking_session_overview();
  24. exit;
  25. } elseif ($display === 'course') {
  26. MySpace::export_tracking_course_overview();
  27. exit;
  28. }
  29. }
  30. Display::display_header($nameTools);
  31. echo '<div class="actions">';
  32. echo MySpace::getTopMenu();
  33. echo '</div>';
  34. echo MySpace::getAdminActions();
  35. switch ($display) {
  36. case 'coaches':
  37. MySpace::display_tracking_coach_overview($exportCSV);
  38. break;
  39. case 'user':
  40. MySpace::display_tracking_user_overview();
  41. break;
  42. case 'session':
  43. MySpace::display_tracking_session_overview();
  44. break;
  45. case 'course':
  46. MySpace::display_tracking_course_overview();
  47. break;
  48. case 'accessoverview':
  49. $courseId = isset($_GET['course_id']) ? (int) $_GET['course_id'] : 0;
  50. $sessionId = isset($_GET['session_id']) ? (int) $_GET['session_id'] : 0;
  51. $studentId = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0;
  52. MySpace::displayTrackingAccessOverView($courseId, $sessionId, $studentId);
  53. break;
  54. }
  55. Display::display_footer();