attendance_list.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * View (MVC patter) for listing attendances
  5. * @author Christian Fasanando <christian1827@gmail.com>
  6. * @package chamilo.attendance
  7. */
  8. // protect a course script
  9. api_protect_course_script(true);
  10. if (api_is_allowed_to_edit(null, true)) {
  11. $param_gradebook = '';
  12. if (isset($_SESSION['gradebook'])) {
  13. $param_gradebook = '&gradebook='.Security::remove_XSS($_SESSION['gradebook']);
  14. }
  15. echo '<div class="actions" style="margin-bottom:30px">';
  16. echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=attendance_add">'.Display::return_icon('new_attendance_list.png',get_lang('CreateANewAttendance'),'',ICON_SIZE_MEDIUM).'</a>';
  17. echo '</div>';
  18. }
  19. $table = new SortableTable('attendance_list', array('Attendance', 'get_number_of_attendances'), array('Attendance', 'get_attendance_data'), $default_column);
  20. $table->set_additional_parameters($parameters);
  21. $table->set_header(0, '', false, array('style'=>'width:20px;'));
  22. $table->set_header(1, get_lang('Name'), true );
  23. $table->set_header(2, get_lang('Description'), true);
  24. $table->set_header(3, get_lang('CountDoneAttendance'), true, array('style'=>'width:90px;'));
  25. if (api_is_allowed_to_edit(null, true)) {
  26. $table->set_header(4, get_lang('Actions'), false,array('style'=>'text-align:center'));
  27. $table->set_form_actions(array ('attendance_delete_select' => get_lang('DeleteAllAttendances')));
  28. }
  29. if ($table->get_total_number_of_items() > 0) {
  30. $table->display();
  31. }