1 | <?php |
||
2 | // This file is part of BOINC. |
||
3 | // http://boinc.berkeley.edu |
||
4 | // Copyright (C) 2023 University of California |
||
5 | // |
||
6 | // BOINC is free software; you can redistribute it and/or modify it |
||
7 | // under the terms of the GNU Lesser General Public License |
||
8 | // as published by the Free Software Foundation, |
||
9 | // either version 3 of the License, or (at your option) any later version. |
||
10 | // |
||
11 | // BOINC is distributed in the hope that it will be useful, |
||
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
14 | // See the GNU Lesser General Public License for more details. |
||
15 | // |
||
16 | // You should have received a copy of the GNU Lesser General Public License |
||
17 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
||
18 | |||
19 | // show certificate for user: signup date, credit, FLOPs |
||
20 | // Projects can customize this: |
||
21 | // https://github.com/BOINC/boinc/wiki/WebConfig#certificate-related-constants |
||
22 | |||
23 | require_once("../inc/util.inc"); |
||
24 | require_once("../inc/cert.inc"); |
||
25 | |||
26 | $border = get_str("border", true); |
||
27 | if ($border=="no") { |
||
28 | $border=0; |
||
29 | } else { |
||
30 | $border=8; |
||
31 | } |
||
32 | |||
33 | // Make sure user_id is in the URL so that share functions work |
||
34 | // |
||
35 | $user_id = get_int('user_id', true); |
||
36 | if (!$user_id) { |
||
37 | $user = get_logged_in_user(); |
||
38 | Header(sprintf('Location: %s/cert1.php?user_id=%d%s', |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
39 | url_base(), $user->id, $border==0?'&border=no':'' |
||
40 | )); |
||
41 | exit; |
||
42 | } |
||
43 | $user = BoincUser::lookup_id($user_id); |
||
44 | |||
45 | $join = gmdate('j F Y', $user->create_time); |
||
46 | $today = gmdate('j F Y', time()); |
||
47 | |||
48 | $credit = credit_string($user->total_credit, false); |
||
49 | |||
50 | $font = "\"Optima,Lucida Bright,Times New Roman\""; |
||
51 | |||
52 | echo " |
||
53 | <table id=\"certificate\" width=900 height=650 border=$border cellpadding=20><tr><td> |
||
54 | <center> |
||
55 | <table width=700 border=0><tr><td> |
||
56 | <center> |
||
57 | <font style=\"font-size: 52\" face=$font>Certificate of Computation |
||
58 | |||
59 | |||
60 | <font face=$font style=\"font-size:28\"> |
||
61 | <br><br><br> |
||
62 | This certifies that |
||
63 | <p> |
||
64 | <font face=$font style=\"font-size:32\"> |
||
65 | $user->name |
||
66 | |||
67 | <font face=$font style=\"font-size:18\"> |
||
68 | <p> |
||
69 | has participated in ".PROJECT." since $join, |
||
70 | and has contributed $credit |
||
71 | to ".PROJECT.". |
||
72 | |||
73 | <br><br><br> |
||
74 | </td><tr></table> |
||
75 | <table width=100%><tr> |
||
76 | <td width=40><br></td> |
||
77 | <td align=left> |
||
78 | <font face=$font style=\"font-size:16\"> |
||
79 | "; |
||
80 | if (defined("CERT_SIGNATURE")) { |
||
81 | echo " |
||
82 | <img src=".CERT_SIGNATURE."> |
||
83 | <br> |
||
84 | "; |
||
85 | } |
||
86 | if (defined("CERT_DIRECTOR_NAME")) { |
||
87 | echo CERT_DIRECTOR_NAME." <br>Director, ".PROJECT." |
||
88 | <br> |
||
89 | "; |
||
90 | } |
||
91 | echo " |
||
92 | <br> |
||
93 | $today |
||
94 | </td> |
||
95 | "; |
||
96 | if (defined("CERT_PROJECT_LOGO")) { |
||
97 | echo " |
||
98 | <td align=center valign=center> <img src=".CERT_PROJECT_LOGO."> </td> |
||
99 | "; |
||
100 | } |
||
101 | if (defined("CERT_INSTITUTION_LOGO")) { |
||
102 | echo " |
||
103 | <td align=center width=30% valign=center><img src=".CERT_INSTITUTION_LOGO."></td> |
||
104 | "; |
||
105 | } |
||
106 | echo " |
||
107 | </td><tr></table></table> |
||
108 | "; |
||
109 | show_download_button(); |
||
110 | show_share_buttons(); |
||
111 | ?> |
||
112 |