teacher_time_report.tpl 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends template ~ "/layout/main.tpl" %}
  2. {% block body %}
  3. <script>
  4. $(document).on('ready', function () {
  5. $('#course').on('change', function () {
  6. $('#session').prop('selectedIndex', 0);
  7. $('#teacher').prop('selectedIndex', 0);
  8. });
  9. $('#session').on('change', function () {
  10. $('#course').prop('selectedIndex', 0);
  11. $('#teacher').prop('selectedIndex', 0);
  12. });
  13. $('#teacher').on('change', function () {
  14. $('#course').prop('selectedIndex', 0);
  15. $('#session').prop('selectedIndex', 0);
  16. });
  17. $('#daterange').on('apply.daterangepicker', function (ev, picker) {
  18. $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
  19. $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
  20. }).on('cancel.daterangepicker', function (ev, picker) {
  21. $('#daterange, [name="from"], [name="until"]').val('');
  22. });
  23. });
  24. </script>
  25. <div class="col-md-12">
  26. <div class="actions">
  27. <div class="row">
  28. <div class="col-md-12">
  29. <a href="{{ _p.web_self }}?export=pdf&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
  30. {{ 'pdf.png' | img(32, 'ExportToPDF'|get_lang ) }}
  31. </a>
  32. <a href="{{ _p.web_self }}?export=xls&from={{ selectedFrom }}&until={{ selectedUntil }}&course={{ selectedCourse }}&session={{ selectedSession }}&teacher={{ selectedTeacher }}">
  33. {{ 'export_excel.png' | img(32, 'ExportExcel'|get_lang ) }}
  34. </a>
  35. </div>
  36. </div>
  37. </div>
  38. <h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
  39. {{ form }}
  40. <h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
  41. <table class="table">
  42. <thead>
  43. <tr>
  44. {% if withFilter %}
  45. <th>{{ 'Session' | get_lang }}</th>
  46. <th>{{ 'Course' | get_lang }}</th>
  47. {% endif %}
  48. <th>{{ 'Coach' | get_lang }}</th>
  49. <th>{{ 'TotalTime' | get_lang }}</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {% for row in rows %}
  54. <tr>
  55. {% if withFilter %}
  56. <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
  57. <td>{{ row.course.name }}</td>
  58. {% endif %}
  59. <td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
  60. <td>{{ row.totalTime }}</td>
  61. </tr>
  62. {% endfor %}
  63. </tbody>
  64. </table>
  65. </div>
  66. {% endblock %}