my_progress.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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');
  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(LIBRARY_PATH).'usermanager.lib.php';
  17. require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
  18. require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
  19. $this_section = SECTION_TRACKING;
  20. $nameTools = get_lang('MyProgress');
  21. api_block_anonymous_users();
  22. $htmlHeadXtra[] = api_get_jquery_ui_js();
  23. $htmlHeadXtra[] = '
  24. <script language="javascript">
  25. $(function() {
  26. $(".dialog").dialog("destroy");
  27. $(".dialog").dialog({
  28. autoOpen: false,
  29. show: "blind",
  30. resizable: false,
  31. height:300,
  32. width:550,
  33. modal: true
  34. });
  35. $(".opener").click(function() {
  36. var my_id = $(this).attr(\'id\');
  37. var big_image = \'#main_graph_\' + my_id;
  38. $( big_image ).dialog("open");
  39. return false;
  40. });
  41. });
  42. </script>';
  43. Display :: display_header($nameTools);
  44. // Database table definitions
  45. $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
  46. $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
  47. $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
  48. $user_progress = Tracking::show_user_progress(api_get_user_id());
  49. if (!empty($user_progress)) {
  50. $user_progress .= '<br /><br />';
  51. }
  52. $user_progress .= Tracking::show_course_detail(api_get_user_id(), $_GET['course'], $_GET['session_id']);
  53. if (!empty($user_progress)) {
  54. echo $user_progress;
  55. } else {
  56. Display::display_warning_message(get_lang('NoDataAvailable'));
  57. }
  58. Display :: display_footer();