Issues (1963)

html/user/cert_team.php (1 issue)

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 a web-based certificate for a team,
20
// showing the team's creation date and total credit in this project.
21
// Projects can customize this:
22
// https://github.com/BOINC/boinc/wiki/WebConfig#certificate-related-constants
23
24
require_once("../inc/util.inc");
25
require_once("../inc/cert.inc");
26
27
if (DISABLE_TEAMS) error_page("Teams are disabled");
28
29
$border = get_str("border", true);
30
if ($border=="no") {
31
    $border=0;
32
} else {
33
    $border=8;
34
}
35
36
// Make sure user_id is in the URL so that share functions work
37
//
38
$user_id = get_int('user_id', true);
39
if (!$user_id) {
40
    $user = get_logged_in_user();
41
    Header(sprintf('Location: %s/cert_team.php?user_id=%d%s',
0 ignored issues
show
Calls to inbuilt PHP functions must be lowercase; expected "header" but found "Header"
Loading history...
42
        url_base(), $user->id, $border==0?'&border=no':''
43
    ));
44
    exit;
45
}
46
47
$user = BoincUser::lookup_id($user_id);
48
$team = BoincTeam::lookup_id($user->teamid);
49
if (!$team) error_page("no team");
50
51
$join = gmdate('j F Y', $team->create_time);
52
$today = gmdate('j F Y', time());
53
54
credit_to_ops($team->total_credit, $ops, $unit);
55
56
$credit = credit_string($team->total_credit, false);
57
58
$font = "\"Optima,Lucida Bright,Times New Roman\"";
59
60
echo "
61
    <table id=\"certificate\" width=900 height=650 border=$border cellpadding=20><tr><td>
62
    <center>
63
    <table width=700 border=0><tr><td>
64
    <center>
65
    <font style=\"font-size: 52\" face=$font>Certificate of Computation
66
67
68
    <font face=$font style=\"font-size:28\">
69
    <br><br><br>
70
    This certifies that team
71
    <p>
72
    <font face=$font style=\"font-size:32\">
73
    $team->name
74
75
    <font face=$font style=\"font-size:18\">
76
    <p>
77
    has participated in ".PROJECT." since $join,
78
    and has contributed $credit
79
    to ".PROJECT.".
80
81
    <br><br><br>
82
    </td><tr></table>
83
    <table width=100%><tr>
84
    <td width=40><br></td>
85
    <td align=left>
86
    <font face=$font style=\"font-size:16\">
87
";
88
if (defined("CERT_SIGNATURE")) {
89
    echo "
90
        <img src=".CERT_SIGNATURE.">
91
        <br>
92
    ";
93
}
94
if (defined("CERT_DIRECTOR_NAME")) {
95
    echo CERT_DIRECTOR_NAME." <br>Director, ".PROJECT."
96
        <br>
97
    ";
98
}
99
echo "
100
    <br>
101
    $today
102
    </td>
103
";
104
if (defined("CERT_PROJECT_LOGO")) {
105
    echo "
106
        <td align=center valign=center> <img src=".CERT_PROJECT_LOGO."> </td>
107
    ";
108
}
109
if (defined("CERT_INSTITUTION_LOGO")) {
110
    echo "
111
        <td align=center width=30% valign=center><img src=".CERT_INSTITUTION_LOGO."></td>
112
    ";
113
}
114
echo "
115
</td><tr></table></table>
116
";
117
show_download_button();
118
show_share_buttons();
119
?>
120