my_progress.php 1.9 KB

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