0){ echo "
"; }else{ echo ""; } ?> "; if($default_initValue==$rows[initValue]) continue; $trunk_no=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; //echo "$trunk_no|   | $temp | "; echo "||||||||||
| Attempt | "; echo "Success | "; echo "Caller clear | "; echo "Sub busy | "; echo "No answer | "; echo "Signal error | "; echo "Total call duration | "; echo "Average call duration(s) | ";
echo "||||
| $i | "; echo "{$e1_element_title[$i]} | "; for($j=0;$j<9;$j++) { echo "";
if($j==0)
echo "{$e1_csta[$i][$j]}";
if($j>0&&$j<8)
{
echo "{$e1_csta[$i][$j]}";
echo " "; if($e1_csta[$i][0]==0) $rate=0; else { $rate=$e1_csta[$i][$j]/$e1_csta[$i][0]; $rate=$rate*100; $rate=number_format($rate,2,"."," "); } if($rate==0) $rate=0; echo "$rate%"; } if($j==8) { echo "{$e1_csta[$i][$j]}(s)"; $hour=floor($e1_csta[$i][$j]/3600); $minute=floor($e1_csta[$i][$j]%3600/60); $second=$e1_csta[$i][$j]%60; if($hour==0&&$minute==0&&$second==0) echo " "; else echo " $hour:$minute:$second"; } echo " | ";
}
//=====average call duration=========
echo ""; if($e1_csta[$i][1]!=0) $ave=round($e1_csta[$i][8]/$e1_csta[$i][1]); else $ave=0; echo "$ave"; echo " | "; echo "||||||||
| 2.Success/failure | "; echo "|||||||
| Type | "; echo "Success | "; echo "Call deny | "; echo "Net busy | "; echo "Caller clear | "; echo "Sub busy | "; echo "No answer | "; echo "Signal error | "; echo "
| In | "; for($i=0;$i<7;$i++) { echo ""; if($in_e1[0]!=0) { $rate=$in_e1[$i+1]/$in_e1[0]; $rate=$rate*100; $rate=number_format($rate,2,"."," "); } else $rate=0; if($rate==0) $rate=0; echo "$rate%"; echo " | "; } echo "||||||
| Out | "; for($i=0;$i<7;$i++) { echo ""; if($out_e1[0]!=0) { $rate=$out_e1[$i+1]/$out_e1[0]; $rate=$rate*100; $rate=number_format($rate,2,"."," "); } else $rate=0; if($rate==0) $rate=0; echo "$rate%"; echo " | "; } echo "||||||
| In&Out | "; for($i=0;$i<7;$i++) { echo ""; if($total_e1[0]!=0) { $rate=$total_e1[$i+1]/$total_e1[0]; $rate=$rate*100; $rate=number_format($rate,2,"."," "); } else $rate=0; if($rate==0) $rate=0; echo "$rate%"; echo " | "; } echo "||||||
3.In/Out(Attempt Call)
";
$sizex=510;
$sizey=240;
$im = ImageCreate ($sizex, $sizey);
$background_color=ImageColorAllocate($im,255,255,255);
imageLine($im,0,0,0,200,$black_color);
imageLine($im,0,200,600,200,$black_color);
$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)));
$white_color=ImageColorAllocate($im,255,255,255);
$black_color=ImageColorAllocate($im,0,0,0);
$color[0]=ImageColorAllocate($im,0x33,0x33,0xff);
$color[1]=ImageColorAllocate($im,0x66,0xaa,0);
//====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);
imageLine($im,40,20,40,200,$black_color);
imageLine($im,40,20,490,20,$black_color);
imageLine($im,490,200,490,20,$black_color);
imageLine($im,40,200,490,200,$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=490;
$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(450/9);
for($i=0;$i<10;$i++)
{
$x1=40+$i*$u;
$y1=20;
$x2=$x1;
$y2=200;
ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color);
}
//=====get the two block height====
if($total_e1[0]==0)
{
$in_e1_percent="0%";
$out_e1_percent="0%";
$height[0]=0;
$heighr[1]=0;
}
else
{
$in_e1_percent=change_percent($in_e1[0]/$total_e1[0]);
$out_e1_percent=change_percent($out_e1[0]/$total_e1[0]);
$height[0]=floor(180*$in_e1[0]/$total_e1[0]);
$height[1]=floor(180*$out_e1[0]/$total_e1[0]);
}
//======draw the data block=====
for($i=0;$i<2;$i++)
{
$x1=90+(4*$i+1)*50;
if($height[$i]==0)
$height[$i]=1;
$y1=200-$height[$i];
$x2=90+(4*$i+2)*50;
$y2=199;
imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]);
}
//=====draw the legend string=====
imagestring($im,2,160,205,"In",$black_color);
imagestring($im,2,138,220,"(".$in_e1_percent.")",$black_color);
imagestring($im,2,355,205,"Out",$black_color);
imagestring($im,2,335,220,"(".$out_e1_percent.")",$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);
}
$tt=time()+34;
$filename="e11_".$tt.".png";
if(1)
{
ImagePng ($im,"$filename");
ImageDestroy($im);
}
//-----显示图片
echo "";
//========================================================================================|
//===========================Draw the Graphics-2==========================================|
//========================================================================================|
echo "
4.Success/Failure
";
$sizex=600;
$sizey=250;
$image=imagecreate($sizex,$sizey);
$bgcolor=imagecolorallocate($image,255,255,255);
$black_color=ImageColorAllocate($image,0,0,0);
$white_color=imagecolorallocate($image,255,255,255);
$bgcolor=F8F8F8;
$fgcolor=000000;
$color[0]=ImageColorAllocate($image,0x33,0x33,0xff);
$color[1]=ImageColorAllocate($image,0x66,0xaa,0);
$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);
imageLine($image,40,20,40,200,$black_color);
imageLine($image,40,20,580,20,$black_color);
imageLine($image,580,200,580,20,$black_color);
imageLine($image,40,200,580,200,$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($image, $style);
for($i=10;$i>0;$i--)
{
$x1=40;
$y1=20+(10-$i)*18;
$x2=580;
$y2=$y1;
if($i!=10)
imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED);
imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color);
}
//=====draw the vitical line======
$u=floor(540/15);
for($i=0;$i<16;$i++)
{
$x1=40+$i*$u;
$y1=20;
$x2=$x1;
$y2=200;
ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color);
}
//======get the block height======
for($j=0;$j<7;$j++)
{
if($total_e1[0]==0)
$total_height[$j][0]=1;
else
{
$total_height[$j][0]=floor(180*$in_e1[$j+1]/$total_e1[0]);
}
}
for($j=0;$j<7;$j++)
{
if($total_e1[0]==0)
$total_height[$j][1]=1;
else
{
$total_height[$j][1]=floor(180*$out_e1[$j+1]/$total_e1[0]);
}
}
//=======draw the data block=====
for($i=0;$i<7;$i++)
{
for($j=0;$j<2;$j++)
{
if($total_height[$i][$j]<1)
$total_height[$i][$j]=1;
//echo "lie-$i-hang-$j-{$total_height[$i][$j]}
";
$x1=40+(2*$i+1)*36;
$y1=199;
for($z=0;$z<$j+1;$z++)
{
$y1=$y1-$total_height[$i][$z];
}
$x2=40+(2*$i+2)*36;
$y2=199;
for($z=0;$z<$j;$z++)
{
$y2=$y2-$total_height[$i][$z];
}
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]);
}
}
//======draw the legend string======
imagefilledrectangle($image,170,230,185,245,$color[0]);
imagestring($image,2,190,230,"In",$black_color);
imagefilledrectangle($image,360,230,375,245,$color[1]);
imagestring($image,2,380,230,"Out",$black_color);
imagestring($image,2,75,205,"Success",$black_color);
imagestring($image,2,138,205,"Call deny",$black_color);
imagestring($image,2,215,205,"Net busy",$black_color);
imagestring($image,2,294,200,"Caller",$black_color);
imagestring($image,2,297,212,"clear",$black_color);
imagestring($image,2,363,205,"SubBusy",$black_color);
imagestring($image,2,433,205,"No answer",$black_color);
imagestring($image,2,508,200,"Signal",$black_color);
imagestring($image,2,510,212,"error",$black_color);
//=====show the answer failure graphics=======
$tt=time()-525;
$file_name="e12_".$tt.".png";
imagepng($image,$file_name);
imagedestroy($image);
echo "";
?>