* * _survey get a vote pie chart * @access Public expression function external disclosure * @param $_agree consent votes * @param $_disagree against the votes * Return a statistics pie chart * * * *
Nction _vote ($_agree,$_disagree) {//processing parameter if ($_agree==0&&$_disagree==0) {$_vote = 270;
} if ($_agree==0&&$_disagree!=0) {$_vote = 91;
} if ($_agree!=0&&$_disagree==0) {$_vote = 89;
} if ($_agree!=0&&$_disagree!=0) {$_vote = Intval (360* ($_agree/($_agree+$_disagree)) +90);
//Create Canvas $_img=imagecreatetruecolor (150,100);
Fill Transparent Background imagealphablending ($_img, false);
Imagesavealpha ($_img, true);
$white = Imagecolorallocatealpha ($_img,255,255,255,127);
Imagefill ($_img,0,0, $white);
Create color $_green=imagecolorallocate ($_img,180,210,52);
$_blue=imagecolorallocate ($_img,83,201,237);
$_gary=imagecolorallocate ($_img,192,192,192);
$_green1=imagecolorallocate ($_img,149,178,36);
$_blue1=imagecolorallocate ($_img,41,160,193); $_gary1=imagecOlorallocate ($_img,144,144,144);
For ($i =60 $i >=50; $i-) {Imagefilledarc ($_img,100, $i, 100,50,90,$_vote,$_blue1,img_arc_pie);
Imagefilledarc ($_img,100, $i, 100,50,$_vote,90,$_green1,img_arc_pie);
} imagefilledarc ($_img,100, $i, 100,50,90,$_vote,$_blue,img_arc_pie);
Imagefilledarc ($_img,100, $i, 100,50,$_vote,90,$_green,img_arc_pie);
Header ("Content-type:image/png");
Imagepng ($_IMG);
Imagedestroy ($_IMG); }