3 * brisk - donometer.php
5 * Copyright (C) 2006-2011 Matteo Nastasi
6 * mailto: nastasi@alternativeoutput.it
7 * matteo.nastasi@milug.org
8 * web: http://www.alternativeoutput.it
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.
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.
25 require_once("Obj/brisk.phh");
28 $im = @imagecreatetruecolor(320, 200)
29 or die("Cannot Initialize new GD image stream");
31 // allocate some solors
32 // $white = imagecolorallocate($im, 0xfa, 0xfa, 0xfa);
33 $bg = imagecolorallocate($im, 0xff, 0xd7, 0x80);
34 $gray = imagecolorallocate($im, 0x70, 0x70, 0x70);
35 $darkgray = imagecolorallocate($im, 0x00, 0x00, 0x00);
36 $orange = imagecolorallocate($im, 0xff, 0xae, 0x00);
37 $darkorange = imagecolorallocate($im, 0xc4, 0x86, 0x00);
39 imagefilledrectangle($im, 0,0, 399,399, $bg);
42 $delta = ($G_donors_cur * 360) / $G_donors_all;
46 imagefilledellipse($im, 160, $y + 16, 300, 150, $darkgray);
47 imagefilledellipse($im, 160, $y + 17, 299, 149, $darkgray);
49 for ($i = $y+15 ; $i > $y ; $i--) {
50 imagefilledarc($im, 160, $i, 300, 150, 270, 270 + $delta, $darkorange, IMG_ARC_PIE);
51 imagefilledarc($im, 160, $i, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_PIE);
54 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $orange, IMG_ARC_PIE);
55 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $gray, IMG_ARC_PIE);
58 imagefilledarc($im, 160, $y, 298, 148, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
59 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
60 imagefilledarc($im, 160, $y, 298, 148, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
61 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
64 $image_p = imagecreatetruecolor(80,50);
65 imagecopyresampled($image_p, $im, 0, 0, 0, 0, 80, 50, 320, 200);
67 header ("Content-type: image/png");
70 imagedestroy($image_p);