gradebook_showlog_eval.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php // $Id: $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2008 Dokeos Latinoamerica SAC
  6. Copyright (c) 2006 Dokeos SPRL
  7. Copyright (c) 2006 Ghent University (UGent)
  8. Copyright (c) various contributors
  9. Copyright (c) Isaac Flores Paz <florespaz@bidsoftperu.com>
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. $language_file = 'gradebook';
  22. //$cidReset = true;
  23. require_once ('../inc/global.inc.php');
  24. require_once ('lib/be.inc.php');
  25. require_once ('lib/gradebook_functions.inc.php');
  26. require_once ('lib/fe/evalform.class.php');
  27. api_block_anonymous_users();
  28. block_students();
  29. $interbreadcrumb[] = array (
  30. 'url' => $_SESSION['gradebook_dest'].'?',
  31. 'name' => get_lang('Gradebook'
  32. ));
  33. $interbreadcrumb[] = array (
  34. 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat']),
  35. 'name' => get_lang('Details'
  36. ));
  37. $interbreadcrumb[] = array (
  38. 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']),
  39. 'name' => get_lang('GradebookQualifyLog')
  40. );
  41. Display :: display_header('');
  42. echo '<div class="clear"></div>';
  43. echo '<div class="actions">';
  44. api_display_tool_title(get_lang('GradebookQualifyLog'));
  45. echo '</div>';
  46. /*
  47. $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  48. $t_user= Database :: get_main_table(TABLE_MAIN_USER);
  49. $evaledit = Evaluation :: load($_GET['visiblelog']);
  50. $sql="SELECT le.name,le.description,le.date_log,le.weight,le.visible,le.type,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';";
  51. $result=api_sql_query($sql);
  52. echo '<table width="100%" border="0" >';
  53. echo '<tr>';
  54. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookNameLog').'</strong></td>';
  55. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookDescriptionLog').'</strong></td>';
  56. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Date').'</strong></td>';
  57. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('Weight').'</strong></td>';
  58. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookVisibilityLog').'</strong></td>';
  59. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('ResourceType').'</strong></td>';
  60. echo '<td align="center" class="gradebook-table-header"><strong>'.get_lang('GradebookWhoChangedItLog').'</strong></td>';
  61. echo '</tr>';
  62. while($row=Database::fetch_array($result)) {
  63. echo '<tr>';
  64. echo '<td align="center" Class="gradebook-table-body">'.$row[0].'</td>';
  65. echo '<td align="center" class="gradebook-table-body">'.$row[1].'</td>';
  66. echo '<td align="center" class="gradebook-table-body">'.date('d-m-Y H:i:s',$row[2]).'</td>';
  67. echo '<td align="center" class="gradebook-table-body">'.$row[3].'</td>';
  68. if (1 == $row[4]) {
  69. $visib=get_lang('GradebookVisible');
  70. } else {
  71. $visib=get_lang('GradebookInvisible');
  72. }
  73. echo '<td align="center" Class="gradebook-table-body">'.$visib.'</td>';
  74. echo '<td align="center" class="gradebook-table-body">'.$row[5].'</td>';
  75. echo '<td align="center" class="gradebook-table-body">'.$row[6].'</td>';
  76. echo '</tr>';
  77. }
  78. echo '</table>';*/
  79. $t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  80. $t_user= Database :: get_main_table(TABLE_MAIN_USER);
  81. $visible_log=Security::remove_XSS($_GET['visiblelog']);
  82. $evaledit = Evaluation :: load($visible_log);
  83. $sql="SELECT le.name,le.description,le.weight,le.visible,le.type,le.date_log,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';";
  84. $result=api_sql_query($sql);
  85. $list_info=array();
  86. while ($row=Database::fetch_row($result)) {
  87. $list_info[]=$row;
  88. }
  89. foreach($list_info as $key => $info_log) {
  90. $list_info[$key][5]=($info_log[5]) ? date('d-m-Y H:i:s',$info_log[5]) : '0000-00-00 00:00:00';
  91. $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  92. }
  93. $parameters=array('visiblelog'=>Security::remove_XSS($_GET['visiblelog']),'selectcat'=>Security::remove_XSS($_GET['selectcat']));
  94. $table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebookeval');
  95. $table->set_additional_parameters($parameters);
  96. $table->set_header(0, get_lang('GradebookNameLog'));
  97. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  98. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  99. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  100. $table->set_header(4, get_lang('ResourceType'));
  101. $table->set_header(5, get_lang('Date'));
  102. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  103. $table->display();
  104. Display :: display_footer();