attendance_list.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. if (api_is_allowed_to_edit(null, true)) {
  9. $param_gradebook = '';
  10. if (isset($_SESSION['gradebook'])) {
  11. $param_gradebook = '&gradebook='.Security::remove_XSS($_SESSION['gradebook']);
  12. }
  13. echo '<div class="actions" style="margin-bottom:30px">';
  14. echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=attendance_add">'.Display::return_icon('adherir.png',get_lang('CreateANewAttendance')).' '.get_lang('CreateANewAttendance').'</a>';
  15. echo '</div>';
  16. }
  17. $table = new SortableTable('attendance_list', array('Attendance', 'get_number_of_attendances'), array('Attendance', 'get_attendance_data'), $default_column);
  18. $table->set_additional_parameters($parameters);
  19. $table->set_header(0, '', false, array('style'=>'width:20px;'));
  20. $table->set_header(1, get_lang('Name'), true );
  21. $table->set_header(2, get_lang('Description'), true);
  22. $table->set_header(3, get_lang('CountDoneAttendance'), true, array('style'=>'width:90px;'));
  23. if (api_is_allowed_to_edit(null, true)) {
  24. $table->set_header(4, get_lang('Actions'), false,array('style'=>'text-align:center'));
  25. $table->set_form_actions(array ('attendance_delete_select' => get_lang('DeleteAllAttendances')));
  26. }
  27. $table->display();
  28. ?>