admin_view.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. // the section (for the tabs)
  10. $this_section = SECTION_TRACKING;
  11. $csv_content = [];
  12. $nameTools = get_lang('Reporting');
  13. $allowToTrack = api_is_platform_admin(true, true);
  14. if (!$allowToTrack) {
  15. api_not_allowed(true);
  16. }
  17. if ($exportCSV) {
  18. if ($display === 'user') {
  19. MySpace::export_tracking_user_overview();
  20. exit;
  21. } elseif ($display === 'session') {
  22. MySpace::export_tracking_session_overview();
  23. exit;
  24. } elseif ($display === 'course') {
  25. MySpace::export_tracking_course_overview();
  26. exit;
  27. }
  28. }
  29. Display::display_header($nameTools);
  30. echo '<div class="actions">';
  31. echo MySpace::getTopMenu();
  32. echo '</div>';
  33. echo MySpace::getAdminActions();
  34. switch ($display) {
  35. case 'coaches':
  36. MySpace::display_tracking_coach_overview($exportCSV);
  37. break;
  38. case 'user':
  39. MySpace::display_tracking_user_overview();
  40. break;
  41. case 'session':
  42. MySpace::display_tracking_session_overview();
  43. break;
  44. case 'course':
  45. MySpace::display_tracking_course_overview();
  46. break;
  47. case 'accessoverview':
  48. $courseId = isset($_GET['course_id']) ? (int) $_GET['course_id'] : 0;
  49. $sessionId = isset($_GET['session_id']) ? (int) $_GET['session_id'] : 0;
  50. $studentId = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0;
  51. MySpace::displayTrackingAccessOverView($courseId, $sessionId, $studentId);
  52. break;
  53. }
  54. Display::display_footer();