fix missing bold for your account item
[brisk.git] / web / donometer.php
1 <?php
2 /*
3  *  brisk - donometer.php
4  *
5  *  Copyright (C) 2006-2015 Matteo Nastasi
6  *                          mailto: nastasi@alternativeoutput.it 
7  *                                  matteo.nastasi@milug.org
8  *                          web: http://www.alternativeoutput.it
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details. You should have received a
19  * copy of the GNU General Public License along with this program; if
20  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
21  * Suite 330, Boston, MA 02111-1307, USA.
22  *
23  */
24
25 $G_base = "";
26 $DOCUMENT_ROOT="";
27
28 require_once("Obj/brisk.phh");
29
30
31 $im = @imagecreatetruecolor(320, 200)
32       or die("Cannot Initialize new GD image stream");
33
34 // allocate some solors
35 // $white      = imagecolorallocate($im, 0xfa, 0xfa, 0xfa);
36 $bg         = imagecolorallocate($im, 0xff, 0xd7, 0x80);
37 $gray       = imagecolorallocate($im, 0x70, 0x70, 0x70);
38 $darkgray   = imagecolorallocate($im, 0x00, 0x00, 0x00);
39 $orange     = imagecolorallocate($im, 0xff, 0xae, 0x00);
40 $darkorange = imagecolorallocate($im, 0xc4, 0x86, 0x00);
41
42 imagefilledrectangle($im, 0,0, 399,399, $bg);
43
44 // make the 3D effect
45 $delta = ($G_donors_cur * 360) / $G_donors_all;
46
47 $y = 90;
48
49 imagefilledellipse($im, 160, $y + 16, 300, 150, $darkgray);
50 imagefilledellipse($im, 160, $y + 17, 299, 149, $darkgray);
51
52 for ($i = $y+15 ; $i > $y ; $i--) {
53   imagefilledarc($im, 160, $i, 300, 150, 270, 270 + $delta, $darkorange, IMG_ARC_PIE);
54   imagefilledarc($im, 160, $i, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_PIE);
55 }
56
57 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $orange, IMG_ARC_PIE);
58 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $gray, IMG_ARC_PIE);
59
60
61 imagefilledarc($im, 160, $y, 298, 148, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
62 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
63 imagefilledarc($im, 160, $y, 298, 148, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
64 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
65
66
67 $image_p = imagecreatetruecolor(80,50);
68 imagecopyresampled($image_p, $im, 0, 0, 0, 0, 80, 50, 320, 200);
69
70 header ("Content-type: image/png");
71 imagepng($image_p);
72 imagedestroy($im);
73 imagedestroy($image_p);
74 ?>