course_user_list.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.plugin.ticket
  5. */
  6. require_once __DIR__.'/../inc/global.inc.php';
  7. $userId = intval($_GET['user_id']);
  8. $userInfo = api_get_user_info($userId);
  9. $coursesList = CourseManager::get_courses_list_by_user_id($userId, false, true);
  10. $arrCourseList = array(get_lang('Select'));
  11. //Course List
  12. foreach ($coursesList as $key => $course) {
  13. $courseInfo = CourseManager::get_course_information($course['code']);
  14. $arrCourseList[$courseInfo['code']] = $courseInfo['title'];
  15. }
  16. $userLabel = Display::tag('label', get_lang('User'), array('class' => 'control-label'));
  17. $personName = api_get_person_name($userInfo['firstname'], $userInfo['lastname']);
  18. $userInput = Display::tag(
  19. 'input',
  20. '',
  21. array(
  22. 'disabled' => 'disabled',
  23. 'type' => 'text',
  24. 'value' => $personName
  25. )
  26. );
  27. $userControl = Display::div($userInput, array('class' => 'controls'));
  28. $courseLabel = Display::tag('label', get_lang('Course'), array('class' => 'control-label'));
  29. $courseSelect = Display::select('course_id', $arrCourseList, 0, array(), false);
  30. $courseControl = Display::div($courseSelect, array('class' => 'controls'));
  31. $userDiv = Display::div($userLabel . " " . $userControl, array('class' => 'control-group'));
  32. $courseDiv = Display::div($courseLabel . " " . $courseControl, array('class' => 'control-group'));
  33. echo $userDiv;
  34. echo $courseDiv;