0){ //echo "
"; echo ""; }else{ echo ""; } adjust_head_frame("down"); adjust_title_head_frame("down"); adjust_title_tail_frame("down"); adjust_content_head_frame("down"); echo "| Type | "; echo "Attempt | "; echo "Success | "; echo "Normal | "; echo "No Resource | "; echo "No Service | "; echo "Invalid Service | "; echo "Invalid Message | "; echo "Signal Error | "; echo "Duration | "; echo "Average Duration | "; echo "
| $service_type_label[$i] | "; for($j=0;$j"; if($service_csta[$i][1]!=0) $ave=round($service_csta[$i][2]/$service_csta[$i][1]); else $ave=0; echo "$ave"; echo " | "; echo "
| Type | "; echo "Attempt | "; echo "Success | "; echo "Normal | "; echo "Call Deny | "; echo "Net Busy | "; echo "Caller Clear | "; echo "Sub Busy | "; echo "No Answer | "; echo "Signal Error | "; echo "Duration | "; echo "Average Duration | "; echo "
| $service_type_label[$i] | "; for($j=0;$j"; if($service_csta[$i][1]!=0) $ave=round($service_csta[$i][2]/$service_csta[$i][1]); else $ave=0; echo "$ave"; echo " | "; echo "
| Type | "; echo "Attempt | "; echo "Success | "; echo "Normal | "; echo "Sub Error | "; echo "No Service | "; echo "Net Busy | "; echo "Message Error | "; echo "Signal Error | "; echo "No Resource | "; echo "Duration | "; echo "Average Duration | "; echo "
| $service_type_label[$i] | "; for($j=0;$j"; if($service_csta[$i][1]!=0) $ave=round($service_csta[$i][2]/$service_csta[$i][1]); else $ave=0; echo "$ave"; echo " | "; echo "
2.Service(Attempt)
";
//=====graphics size=======
$sizex=500;
$sizey=250;
$im = ImageCreate ($sizex, $sizey);
$background_color=ImageColorAllocate($im,255,255,255);
$black_color=ImageColorAllocate($im,0,0,0);
$white_color= imagecolorallocate($im, 255, 255, 255);
$bgcolor=F8F8F8;
$fgcolor=000000;
$background_color = ImageColorAllocate ($im,
hexdec(substr($bgcolor, 0, 2)),
hexdec(substr($bgcolor, 2, 2)),
hexdec(substr($bgcolor, 4, 2)));
$text_color = ImageColorAllocate ($im,
hexdec(substr($fgcolor, 0, 2)),
hexdec(substr($fgcolor, 2, 2)),
hexdec(substr($fgcolor, 4, 2)));
//====graphics background=======
ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198));
ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130));
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color);
imagedashedline($im,30,30,100,100,$black_color);
//======draw the horizonal line========
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
imagesetstyle($im, $style);
for($i=10;$i>0;$i--)
{
$x1=40;
$y1=20+(10-$i)*18;
$x2=447;
$y2=$y1;
if($i!=10)
{
imageline($im, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED);
}
imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color);
}
//=======draw the vitical line=======
$u=floor(750/20);
for($i=0;$i<12;$i++)
{
$x1=40+$i*$u;
$y1=20;
$x2=$x1;
$y2=200;
ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color);
}
//=======get colors============
$color[0]=ImageColorAllocate($im,0x99,0x00,0x33);
$color[1]=ImageColorAllocate($im,0x99,0x00,0xcc);
$color[2]=ImageColorAllocate($im,0x99,0x99,0x00);
$color[3]=ImageColorAllocate($im,0x99,0xcc,0x99);
$color[4]=ImageColorAllocate($im,0x99,0xff,0x33);
$color[5]=ImageColorAllocate($im,0xff,0x99,0x66);
$color[6]=ImageColorAllocate($im,0xff,0x99,0xff);
$color[7]=ImageColorAllocate($im,0xff,0xff,0x00);
$color[8]=ImageColorAllocate($im,0x33,0x3,0x33);
$color[9]=ImageColorAllocate($im,0x00,0xcc,0xff);
$color[10]=ImageColorAllocate($im,0x00,0x66,0xcc);
$color[11]=ImageColorAllocate($im,0x33,0xff,0x99);
//=====get the precent and block height(Part-1)======
$attempt_sum_one=0;
for($i=0;$i<6;$i++)
{
$attempt_sum_one+=$service_csta[$i][0];
}
if($attempt_sum_one==0)
{
//lu precent
$lu_attempt_precent="0%";
//mo precent
$mo_attempt_precent="0%";
//mt precent
$mt_attempt_precent="0%";
//smo precent
$smo_attempt_precent="0%";
//smt precent
$smt_attempt_precent="0%";
for($t=0;$t<5;$t++)
$height[$t]=0;
}
else
{
//lu precent
$lu_attempt_precent=number_format($service_csta[1][0]*100/$attempt_sum_one,2,'.','')."%";
//mo precent
$mo_attempt_precent=number_format($service_csta[2][0]*100/$attempt_sum_one,2,'.','')."%";
//mt precent
$mt_attempt_precent=number_format($service_csta[3][0]*100/$attempt_sum_one,2,'.','')."%";
//smo precent
$smo_attempt_precent=number_format($service_csta[4][0]*100/$attempt_sum_one,2,'.','')."%";
//interconnection precent
$smt_attempt_precent=number_format($service_csta[5][0]*100/$attempt_sum_one,2,'.','')."%";
for($t=1;$t<6;$t++)
{
$height[$t-1]=floor(180*$service_csta[$t][0]/$attempt_sum_one);
}
}
//======draw the data block======
for($i=0;$i<5;$i++)
{
$x1=40+(2*$i+1)*$u;
if($height[$i]==0)
$height[$i]=1;
$y1=200-$height[$i];
$x2=40+(2*$i+2)*$u;
$y2=199;
imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]);
}
//======draw the legend string=======
imagestring($im,2,90,205,"LU",$black_color);
imagestring($im,2,70,220,"(".$lu_attempt_precent.")",$black_color);
imagestring($im,2,150,205,"Call MO",$black_color);
imagestring($im,2,148,220,"(".$mo_attempt_precent.")",$black_color);
imagestring($im,2,225,205,"Call MT",$black_color);
imagestring($im,2,225,220,"(".$mt_attempt_precent.")",$black_color);
imagestring($im,2,305,205,"SM MO",$black_color);
imagestring($im,2,300,221,"(".$smo_attempt_precent.")",$black_color);
imagestring($im,2,380,205,"SM MT",$black_color);
imagestring($im,2,375,221,"(".$smt_attempt_precent.")",$black_color);
//draw the outline
imageLine($im,40,20,40,200,$black_color);
imageLine($im,40,20,447,20,$black_color);
imageLine($im,447,200,447,20,$black_color);
imageLine($im,40,200,447,200,$black_color);
//======show the service attempt graphics==========
//-----输出图形文件,请勿修改
//delete *.png
$handle=opendir('.');
while($file=readdir($handle)){
$retval="";
$pt=strrpos($file,".");
if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt);
if($retval=='png') unlink($file);
}
$filename="ser3_".time().".png";
if(1){
ImagePng ($im,"$filename");
ImageDestroy($im);
}
//-----显示图片
echo "";
//=====================================================================================|
//========================Draw The Graphics-2==========================================|
//=====================================================================================|
//=======draw the Success failure graphics==========
/*
echo "
3.Success/Failure
";
$sizex=500;
$sizey=250;
$image=imagecreate($sizex,$sizey);
$bgcolor=imagecolorallocate($image,255,255,255);
$black_color=ImageColorAllocate($image,0,0,0);
$bgcolor=F8F8F8;
$fgcolor=000000;
$background_color = ImageColorAllocate ($image,
hexdec(substr($bgcolor, 0, 2)),
hexdec(substr($bgcolor, 2, 2)),
hexdec(substr($bgcolor, 4, 2)));
$text_color = ImageColorAllocate ($image,
hexdec(substr($fgcolor, 0, 2)),
hexdec(substr($fgcolor, 2, 2)),
hexdec(substr($fgcolor, 4, 2)));
//=====background========
ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198));
ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130));
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color);
//first
imageLine($image,40,20,40,200,$black_color);
imageLine($image,40,20,450,20,$black_color);
imageLine($image,450,200,450,20,$black_color);
imageLine($image,40,200,450,200,$black_color);
//======show the answer failure graphics=====
$tt=time()-2500;
$file_name="ser4_".$tt.".png";
imagepng($image,$file_name);
imagedestroy($image);
echo "";
*/
adjust_content_tail("down");
?>