init web ems all
This commit is contained in:
137
wxc2_omc/performance/pubCsta/cstaImgDownload.php
Executable file
137
wxc2_omc/performance/pubCsta/cstaImgDownload.php
Executable file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
//-----<2D><>ҪԤ<D2AA>ȶ<EFBFBD><C8B6><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$maxYNum=5000;
|
||||
$legendArr=array(
|
||||
//array('Name','ColorHex',$color),
|
||||
array('Request','0000FF',0),
|
||||
array('Success','00CC00',0)
|
||||
);
|
||||
$title="Download";
|
||||
$imgFileName="cstaDownload_$randval.png";
|
||||
@unlink($imgFileName);
|
||||
|
||||
//-----ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꣬<EFBFBD><EAA3AC>ʾ<EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD>Ԫ<EFBFBD>أ<EFBFBD><D8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8>ⲿ<EFBFBD><E2B2BF>
|
||||
$DEBUG=0;
|
||||
$sizex=400;
|
||||
$sizey=180;
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
//$date=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
|
||||
|
||||
$im = ImageCreate ($sizex, $sizey);
|
||||
|
||||
$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)));
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
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);
|
||||
|
||||
//<2F>߿<EFBFBD>
|
||||
$xBgn=75;
|
||||
$yBgn=15;
|
||||
$xEnd=383;
|
||||
$yEnd=115;
|
||||
$unitXPix=1;
|
||||
ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color);
|
||||
ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color);
|
||||
ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color);
|
||||
ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע
|
||||
for($i=0;$i<25;$i++){
|
||||
if($i % 2 == 0){
|
||||
ImageDashedLine($im, $xBgn + $i*12, $yBgn, $xBgn + $i*12, $yEnd, $text_color);
|
||||
Imagestring($im, 2, $xBgn + $i*12 - 4, $yEnd, "$i", $text_color);
|
||||
}
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע
|
||||
for($i=0;$i<4;$i++){
|
||||
ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color);
|
||||
$yRemark=$maxYNum / 4 * (4 - $i);
|
||||
Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color);
|
||||
}
|
||||
|
||||
for($i=0;$i<sizeof($legendArr);$i++){
|
||||
$tmpName=$legendArr[$i][0];
|
||||
$tmpColor=$legendArr[$i][1];
|
||||
$color = ImageColorAllocate ($im, hexdec(substr($tmpColor, 0, 2)), hexdec(substr($tmpColor, 2, 2)),hexdec(substr($tmpColor, 4, 2)));
|
||||
$legendArr[$i][2]=$color;
|
||||
ImageFilledRectangle($im,82 + $i* 100,$yEnd + 22,80 + $i* 100 + 10,$yEnd + 30,$legendArr[$i][2]);
|
||||
Imagestring($im, 2, 95 + $i* 100,$yEnd + 20, "$tmpName", $text_color);
|
||||
}
|
||||
|
||||
//<2F>²<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//$title="This is a image tamplate.";
|
||||
Imagestring($im, 2, 20,$yEnd + 40, $title, $text_color);
|
||||
|
||||
//<2F><><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Imagestring($im, 2, $xEnd-90,$yEnd + 40, "Date:$date", $text_color);
|
||||
|
||||
//-----<2D><>ʼ<EFBFBD><CABC>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ɫ<EFBFBD>飩<EFBFBD><E9A3A9><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>
|
||||
//-----<2D><>ʼ<EFBFBD><CABC>ͼ
|
||||
$i=0;
|
||||
while($rows = mysqli_fetch_array($result)){
|
||||
$pointArr_1[$i]=$rows[timeNo];
|
||||
$pointArr_2[$i]=$rows[timeNo];
|
||||
$pointArr_1[$i+1]=$rows[dnRequ];
|
||||
$pointArr_2[$i+1]=$rows[dnSucc];
|
||||
$i += 2;
|
||||
}
|
||||
|
||||
$pointArr=getNewXY($pointArr_1);
|
||||
if($DEBUG){
|
||||
for($i=0;$i<sizeof($pointArr_1);$i++){
|
||||
echo "<br>pointArr[$i]={$pointArr[$i]}";
|
||||
}
|
||||
}
|
||||
$pointNum= sizeof($pointArr) / 2;
|
||||
|
||||
$tmpColor=$legendArr[0][2];
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
imagepolygon($im, $pointArr, $pointNum, $tmpColor);
|
||||
|
||||
$pointArr=getNewXY($pointArr_2);
|
||||
if($DEBUG){
|
||||
for($i=0;$i<sizeof($pointArr);$i++){
|
||||
echo "<br>pointArr[$i]={$pointArr[$i]}";
|
||||
}
|
||||
}
|
||||
$pointNum= sizeof($pointArr) / 2;
|
||||
|
||||
$tmpColor=$legendArr[1][2];
|
||||
//ɫ<><C9AB>
|
||||
imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor);
|
||||
|
||||
//-----<2D><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//<2F>ٻ<EFBFBD>һ<EFBFBD>α߿<CEB1>
|
||||
ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color);
|
||||
ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color);
|
||||
ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color);
|
||||
ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color);
|
||||
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD>
|
||||
ImagePng ($im,"$imgFileName");
|
||||
ImageDestroy($im);
|
||||
|
||||
/*
|
||||
//-----<2D><>ʾͼƬ
|
||||
echo "<body topmargin=\"0\" leftmargin=\"5\">";
|
||||
echo "<img src=\"$imgFileName\">";
|
||||
echo "<br><br>";
|
||||
echo "</body>";
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user