my_progress.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. // name of the language file that needs to be included
  4. $language_file = array('registration', 'tracking', 'exercice', 'admin');
  5. $cidReset = true;
  6. require_once '../inc/global.inc.php';
  7. require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
  8. require_once api_get_path(LIBRARY_PATH).'course.lib.php';
  9. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  10. require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
  11. require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
  12. $this_section = SECTION_TRACKING;
  13. $nameTools = get_lang('MyProgress');
  14. api_block_anonymous_users();
  15. $htmlHeadXtra[] = api_get_jquery_ui_js();
  16. $htmlHeadXtra[] = '
  17. <script language="javascript">
  18. $(function() {
  19. $(".dialog").dialog("destroy");
  20. $(".dialog").dialog({
  21. autoOpen: false,
  22. show: "blind",
  23. resizable: false,
  24. height:300,
  25. width:550,
  26. modal: true
  27. });
  28. $(".opener").click(function() {
  29. var my_id = $(this).attr(\'id\');
  30. var big_image = \'#main_graph_\' + my_id;
  31. $( big_image ).dialog("open");
  32. return false;
  33. });
  34. });
  35. </script>';
  36. Display :: display_header($nameTools);
  37. // Database table definitions
  38. $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
  39. $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
  40. $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
  41. $user_progress = Tracking::show_user_progress(api_get_user_id());
  42. if (!empty($user_progress)) {
  43. $user_progress .= '<br /><br />';
  44. }
  45. $user_progress .= Tracking::show_course_detail(api_get_user_id(), $_GET['course'], $_GET['session_id']);
  46. if (!empty($user_progress)) {
  47. echo $user_progress;
  48. } else {
  49. Display::display_warning_message(get_lang('NoDataAvailable'));
  50. }
  51. Display :: display_footer();