teacher_time_report.tpl 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. <a href="{{ _p.web_main }}admin/teachers_time_by_session_report.php">
  28. {{ 'session.png'|img(32, 'Sessions'|get_lang) }}
  29. </a>
  30. <div class="pull-right">
  31. <a href="{{ _p.web_self ~ '?' ~ {'export':'pdf','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
  32. {{ 'pdf.png' | img(32, 'ExportToPDF'|get_lang ) }}
  33. </a>
  34. <a href="{{ _p.web_self ~ '?' ~ {'export':'xls','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
  35. {{ 'export_excel.png' | img(32, 'ExportExcel'|get_lang ) }}
  36. </a>
  37. </div>
  38. </div>
  39. <h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
  40. {{ form }}
  41. <h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
  42. <table class="table">
  43. <thead>
  44. <tr>
  45. {% if withFilter %}
  46. <th>{{ 'Session' | get_lang }}</th>
  47. <th>{{ 'Course' | get_lang }}</th>
  48. {% endif %}
  49. <th>{{ 'Coach' | get_lang }}</th>
  50. <th>{{ 'TotalTime' | get_lang }}</th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. {% for row in rows %}
  55. <tr>
  56. {% if withFilter %}
  57. <td>{{ row.session ? row.session.name : '&nbsp' }}</td>
  58. <td>{{ row.course.name }}</td>
  59. {% endif %}
  60. <td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
  61. <td>{{ row.totalTime }}</td>
  62. </tr>
  63. {% endfor %}
  64. </tbody>
  65. </table>
  66. </div>
  67. {% endblock %}