gradebook_showlog_eval.php 2.5 KB

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