tutor.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.plugin.ticket
  5. */
  6. exit;
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. require_once __DIR__.'/tutor_report.lib.php';
  9. $htmlHeadXtra[] = '<script>
  10. $(function() {
  11. $(".ajax").click(function() {
  12. var url = this.href;
  13. var dialog = $("#dialog");
  14. if ($("#dialog").length == 0) {
  15. dialog = $("'.'<div id="dialog" style="display:hidden"></div>'.'").appendTo("body");
  16. }
  17. // load remote content
  18. dialog.load(
  19. url,
  20. {},
  21. function(responseText, textStatus, XMLHttpRequest) {
  22. dialog.dialog({
  23. modal : true,
  24. width : 540,
  25. height : 400
  26. });
  27. }
  28. );
  29. //prevent the browser to follow the link
  30. return false;
  31. });
  32. });
  33. function showContent(div){
  34. if($("div#"+div).attr("class")=="blackboard_hide"){
  35. $("div#"+div).attr("class","blackboard_show");
  36. $("div#"+div).attr("style","");
  37. }else{
  38. $("div#"+div).attr("class","blackboard_hide");
  39. $("div#"+div).attr("style","");
  40. }
  41. }
  42. function save() {
  43. work_id = $("#work_id").val();
  44. forum_id = $("#forum_id").val();
  45. rs_id = $("#rs_id").val();
  46. $.ajax({
  47. contentType: "application/x-www-form-urlencoded",
  48. beforeSend: function(myObject) {
  49. $("div#confirmation").html("<img src=\"'.api_get_path(WEB_LIBRARY_PATH).'javascript/indicator.gif\" />"); },
  50. type: "POST",
  51. url: "update_report.php",
  52. data: "work_id="+work_id+"&forum_id="+forum_id+"&rs_id="+rs_id,
  53. success: function(data) {
  54. $("div#confirmation").html(data);
  55. location.reload();
  56. }
  57. });
  58. }
  59. </script>
  60. <style>
  61. .blackboard_show {
  62. float:left;
  63. position:absolute;
  64. border:1px solid black;
  65. width: 350px;
  66. background-color:white;
  67. z-index:99; padding: 3px;
  68. display: inline;
  69. }
  70. .blackboard_hide {
  71. display: none;
  72. }
  73. .reports{
  74. border:1px ;
  75. }
  76. .reports th {
  77. border-bottom: 1px solid #DDDDDD;
  78. line-height: normal;
  79. text-align: center;
  80. vertical-align: middle;
  81. background-color: #F2F2F2;
  82. }
  83. </style>';
  84. $course_code = api_get_course_id();
  85. $results = initializeReport($course_code);
  86. if (isset($_GET['action'])) {
  87. Export::arrayToXls($results['export'], "COURSE_USER_REPORT".$course_code);
  88. } else {
  89. Display::display_header();
  90. api_protect_course_script();
  91. if (!api_is_allowed_to_edit()) {
  92. api_not_allowed();
  93. }
  94. echo $results['show'];
  95. Display::display_footer();
  96. }