gradebook_showlog_eval.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script
  5. * @package chamilo.gradebook
  6. */
  7. require_once '../inc/global.inc.php';
  8. api_block_anonymous_users();
  9. GradebookUtils::block_students();
  10. $interbreadcrumb[] = array (
  11. 'url' => $_SESSION['gradebook_dest'].'?',
  12. 'name' => get_lang('Gradebook'
  13. ));
  14. $interbreadcrumb[] = array (
  15. 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']),
  16. 'name' => get_lang('Details'
  17. ));
  18. $interbreadcrumb[] = array (
  19. 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']),
  20. 'name' => get_lang('GradebookQualifyLog')
  21. );
  22. $this_section = SECTION_COURSES;
  23. Display :: display_header('');
  24. echo Display::page_header(get_lang('GradebookQualifyLog'));
  25. $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  26. $t_user = Database :: get_main_table(TABLE_MAIN_USER);
  27. $visible_log=Security::remove_XSS($_GET['visiblelog']);
  28. $evaledit = Evaluation :: load($visible_log);
  29. $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username
  30. FROM ".$t_linkeval_log." le
  31. INNER JOIN ".$t_user." us
  32. ON le.user_id_log=us.user_id
  33. WHERE id_linkeval_log=".$evaledit[0]->get_id()." AND type='evaluation';";
  34. $result = Database::query($sql);
  35. $list_info = array();
  36. while ($row = Database::fetch_row($result)) {
  37. $list_info[] = $row;
  38. }
  39. foreach($list_info as $key => $info_log) {
  40. $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  41. $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  42. }
  43. $parameters = array(
  44. 'visiblelog' => $visible_log,
  45. 'selectcat' => intval($_GET['selectcat']),
  46. );
  47. $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebookeval');
  48. $table->set_additional_parameters($parameters);
  49. $table->set_header(0, get_lang('GradebookNameLog'));
  50. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  51. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  52. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  53. $table->set_header(4, get_lang('ResourceType'));
  54. $table->set_header(5, get_lang('Date'));
  55. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  56. $table->display();
  57. Display :: display_footer();