course_user_list.php 1.3 KB

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