3 * brisk - donometer.php
5 * Copyright (C) 2006-2012 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.
27 require_once("Obj/brisk.phh");
30 $im = @imagecreatetruecolor(320, 200)
31 or die("Cannot Initialize new GD image stream");
33 // allocate some solors
34 // $white = imagecolorallocate($im, 0xfa, 0xfa, 0xfa);
35 $bg = imagecolorallocate($im, 0xff, 0xd7, 0x80);
36 $gray = imagecolorallocate($im, 0x70, 0x70, 0x70);
37 $darkgray = imagecolorallocate($im, 0x00, 0x00, 0x00);
38 $orange = imagecolorallocate($im, 0xff, 0xae, 0x00);
39 $darkorange = imagecolorallocate($im, 0xc4, 0x86, 0x00);
41 imagefilledrectangle($im, 0,0, 399,399, $bg);
44 $delta = ($G_donors_cur * 360) / $G_donors_all;
48 imagefilledellipse($im, 160, $y + 16, 300, 150, $darkgray);
49 imagefilledellipse($im, 160, $y + 17, 299, 149, $darkgray);
51 for ($i = $y+15 ; $i > $y ; $i--) {
52 imagefilledarc($im, 160, $i, 300, 150, 270, 270 + $delta, $darkorange, IMG_ARC_PIE);
53 imagefilledarc($im, 160, $i, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_PIE);
56 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $orange, IMG_ARC_PIE);
57 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $gray, IMG_ARC_PIE);
60 imagefilledarc($im, 160, $y, 298, 148, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
61 imagefilledarc($im, 160, $y, 300, 150, 270, 270 + $delta, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
62 imagefilledarc($im, 160, $y, 298, 148, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
63 imagefilledarc($im, 160, $y, 300, 150, 270 + $delta, 630, $darkgray, IMG_ARC_EDGED | IMG_ARC_NOFILL);
66 $image_p = imagecreatetruecolor(80,50);
67 imagecopyresampled($image_p, $im, 0, 0, 0, 0, 80, 50, 320, 200);
69 header ("Content-type: image/png");
72 imagedestroy($image_p);