reports_cert_and_dip.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // This file is part of Moodle - http://moodle.org/
  3. //
  4. // Moodle is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // Moodle is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * local_olimp_reports file description here.
  18. *
  19. * @package local_olimp_reports
  20. * @copyright 2022 alex sidorof <alex.sidorof@ya.ru>
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22. */
  23. class reports_cert_and_dip extends \table_sql{
  24. public function __construct($uniqueid){
  25. parent::__construct($uniqueid);
  26. $columns = array('fullname','email','name_obr','place_obr','ball','dip_or_sap','fio','gdate','kod');
  27. $this->define_columns($columns);
  28. $headers = array(get_string('fullname', 'local_olimp_reports'),
  29. get_string('email', 'local_olimp_reports'),
  30. get_string('name_obr', 'local_olimp_reports'),
  31. get_string('place_obr', 'local_olimp_reports'),
  32. get_string('ball', 'local_olimp_reports'),
  33. get_string('dip_or_sap', 'local_olimp_reports'),
  34. get_string('fio', 'local_olimp_reports'),
  35. get_string('gdate', 'local_olimp_reports'),
  36. get_string('kod', 'local_olimp_reports'));
  37. $this->define_headers($headers);
  38. $this->pageable(true);
  39. }
  40. function col_fullname($values){
  41. // If the data is being downloaded than we don't want to show HTML.
  42. if ($this->is_downloading()) {
  43. return $values->fullname;
  44. } else {
  45. return '<a href="/moodle/user/view.php?id='.$values->id.'">'.$values->fullname.'</a>';
  46. }
  47. }
  48. }