<?
header
("Content-Type : image/png");
function
printPolygon($num, $color, $x1,$y1,$x2,$y2,$x3=0,$y3=0,$x4=0,$y4=0,$x5=0,$y5=0,$x6=0,$y6=0){
global
$im;

$points[0]=$x1; $points[1]=$y1;
$points[2]=$x2; $points[3]=$y2;
$points[4]=$x3; $points[5]=$y3;
$points[6]=$x4; $points[7]=$y4;
$points[8]=$x5; $points[9]=$y5;
$points[10]=$x6; $points[11]=$y6;

ImageFilledPolygon($im,$points,$num,$color);
}

$im=ImageCreate(663,403);
$black=ImageColorAllocate($im,0,0,0);
$white=ImageColorAllocate($im,255,255,255);
$fb1=ImageColorAllocate($im,192,192,192);
$fb2=ImageColorAllocate($im,130,130,130);
$fb3=ImageColorAllocate($im,240,240,240);
$g1=ImageColorAllocate($im,0,153,51);
$g2=ImageColorAllocate($im,0,115,39);
$g3=ImageColorAllocate($im,0,77,26);
$gr1=ImageColorAllocate($im,153,0,0);
$gr2=ImageColorAllocate($im,115,0,0);
$gr3=ImageColorAllocate($im,77,0,0);

printPolygon(4,$white,2,2,657,2,657,397,2,397); //¹è°æ ¸¸µé±â
imagefilledrectangle($im,0,400,5,403,$white); //¿ÞÂÊ ¾Æ·¡ Á¶±×¸¸ Èò»ö »ç°¢Çü
imagefilledrectangle($im,660,0,663,5,$white); //¿À¸¥ÂÊ »ó´Ü Á¶±×¸¸ Èò»ö »ç°¢Çü

//½ÇÁ¦ ±×·¡ÇÁ ¸ð¾ç ¸¸µé±â
printPolygon(6,$fb1,65,25,630,25,630,265,610,285,45,285,45,45); //¹è°æ ´Ù°¢Çü
printPolygon(6,$fb2,630,25,630,265,610,285,610,277,625,261,625,30); //¿À¸¥ÂÊ ¸ð¼­¸® ´Ù°¢Çü
printPolygon(6,$fb3,45,45,51,45,51,277,610,277,610,285,45,285); //Ãà ¹è°æ
printPolygon(4,$fb2,52,45,67,29,67,262,52,276); //YÃà ¹è°æ ¾ÈÂÊ
printPolygon(4,$fb3,68,30,624,30,624,261,68,261); //¹è°æ ´Ù°¢Çü ¾ÈÂÊ ¹è°æ

//Ãà ±âÁØ °ªµé (Á¡¼±)
for ($i=52; $i<242; $i+=21) imageLine($im,68,$i,624,$i,$black);
for (
$i=52; $i<242; $i+=21) imageLine($im,52,$i+15,67,$i,$fb3);
for (
$i=68; $i<258; $i+=21) imageLine($im,45,$i,50,$i,$black);



for (
$i=20; $i<466; $i+=15){
if(!
$j)$j=1;
imageLine($im,$i+93,277,$i+93,285,$black);

$y=rand(100,276);
imagefilledrectangle($im,$i+80,$y,$i+90,276,$g1); //°ª Ç¥¸é
printPolygon(4,$g2,$i+80,$y,$i+95,$y-15,$i+105,$y-15,$i+90,$y); //°ª ¾ÈÂÊ
printPolygon(4,$g3,$i+90,$y,$i+105,$y-15,$i+105,261,$i+90,276); //°ª ¿À¸¥ÂÊ

$y=rand(100,276);
$i+=15;
imagefilledrectangle($im,$i+80,$y,$i+90,276,$gr1); //°ª Ç¥¸é
printPolygon(4,$gr2,$i+80,$y,$i+95,$y-15,$i+105,$y-15,$i+90,$y); //°ª ¾ÈÂÊ
printPolygon(4,$gr3,$i+90,$y,$i+105,$y-15,$i+105,261,$i+90,276); //°ª ¿À¸¥ÂÊ

$i+=10;

Imagestring($im,2,$i+66,286,$j,$black);
$j++;
}

imagefilledrectangle($im,440,320,632,372,$fb2); //ÁÖ¼® »óÀÚ Å׵θ®
imagefilledrectangle($im,442,322,630,370,$white); //ÁÖ¼® »óÀÚ
imagefilledrectangle($im,450,332,460,342,$g1); //¼öÀÔ »óÀÚ
imagefilledrectangle($im,450,352,460,362,$gr1); //ÁöÃâ »óÀÚ
Imagestring($im,2,470,330,': the amount of imports.',$black);
Imagestring($im,2,470,350,': the amount disbursed.',$black);

Imagestring($im,5,150,7,'2006 Year, monthly expenses graph.',$black); //ŸÀÌÆ² Àû±â

$file="per_day.png";

ImageInterlace($im,1);
Imagepng($im);
//Imagepng($im,$file);
ImageDestroy($im);
?>