/* * _survey get a poll of pie chart * @access Public indicates the function is publicly available * @param $_agree agreed votes * @param $_disagree votes * Return a statistical pie chart * */function _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/)) +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);}