class_information.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php // $Id: class_information.php 9246 2006-09-25 13:24:53Z bmol $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Olivier Brouckaert
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  17. ==============================================================================
  18. */
  19. /**
  20. ==============================================================================
  21. * @author Bart Mollet
  22. * @package dokeos.admin
  23. ==============================================================================
  24. */
  25. /*
  26. ==============================================================================
  27. INIT SECTION
  28. ==============================================================================
  29. */
  30. $langFile='admin';
  31. $cidReset=true;
  32. require('../inc/global.inc.php');
  33. $this_section=SECTION_PLATFORM_ADMIN;
  34. api_protect_admin_script();
  35. require(api_get_path(LIBRARY_PATH).'classmanager.lib.php');
  36. if( !isset($_GET['id']))
  37. {
  38. api_not_allowed();
  39. }
  40. //$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('PlatformAdmin'));
  41. $interbreadcrumb[] = array ("url" => 'class_list.php', "name" => get_lang('AdminClasses'));
  42. $class_id = $_GET['id'];
  43. $class = ClassManager::get_class_info($class_id);
  44. $tool_name = $class['name'];
  45. Display::display_header($tool_name);
  46. //api_display_tool_title($tool_name);
  47. /**
  48. * Show all users subscribed in this class
  49. */
  50. echo '<h4>'.get_lang('Users').'</h4>';
  51. echo '<blockquote>';
  52. $users = ClassManager::get_users($class_id);
  53. if( count($users) > 0)
  54. {
  55. $table_header[] = array (get_lang('OfficialCode'), true);
  56. $table_header[] = array (get_lang('FirstName'), true);
  57. $table_header[] = array (get_lang('LastName'), true);
  58. $table_header[] = array (get_lang('Email'), true);
  59. $table_header[] = array (get_lang('Status'), true);
  60. $table_header[] = array ('', false);
  61. $data = array();
  62. foreach($users as $index => $user)
  63. {
  64. $row = array ();
  65. $row[] = $user['official_code'];
  66. $row[] = $user['firstname'];
  67. $row[] = $user['lastname'];
  68. $row[] = Display :: encrypted_mailto_link($user['email'], $user['email']);
  69. $row[] = $user['status'] == 5 ? get_lang('Student') : get_lang('Teacher');
  70. $row[] = '<a href="user_information.php?user_id='.$user['user_id'].'"><img src="../img/info_small.gif" border="0" /></a>';
  71. $data[] = $row;
  72. }
  73. Display::display_sortable_table($table_header,$data,array(),array(),array('id'=>$_GET['id']));
  74. }
  75. else
  76. {
  77. echo get_lang('NoUsersInClass');
  78. }
  79. echo '</blockquote>';
  80. /**
  81. * Show all courses in which this class is subscribed
  82. */
  83. $courses = ClassManager::get_courses($class_id);
  84. if (count($courses) > 0)
  85. {
  86. $header[] = array (get_lang('Code'), true);
  87. $header[] = array (get_lang('Title'), true);
  88. $header[] = array ('', false);
  89. $data = array ();
  90. foreach( $courses as $index=>$course)
  91. {
  92. $row = array ();
  93. $row[] = $course['code'];
  94. $row[] = $course['title'];
  95. $row[] = '<a href="course_information.php?code='.$course['code'].'"><img src="../img/info_small.gif" border="0" /></a>'.'<a href="'.api_get_path(WEB_COURSE_PATH).$course['directory'].'"><img src="../img/home_small.gif" border="0"/></a>' .
  96. '<a href="course_edit.php?course_code='.$course['code'].'"><img src="../img/edit.gif" border="0" title="'.get_lang('Edit').'" alt="'.get_lang('Edit').'"/></a>';
  97. $data[] = $row;
  98. }
  99. echo '<p><b>'.get_lang('Courses').'</b></p>';
  100. echo '<blockquote>';
  101. Display :: display_sortable_table($header, $data, array (), array (), array('id'=>$_GET['id']));
  102. echo '</blockquote>';
  103. }
  104. else
  105. {
  106. echo '<p>'.get_lang('NoCoursesForThisClass').'</p>';
  107. }
  108. /*
  109. ==============================================================================
  110. FOOTER
  111. ==============================================================================
  112. */
  113. Display::display_footer();
  114. ?>