gradebook_showlog_eval.php 2.4 KB

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