tutor.php 2.6 KB

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