|
|
|
<?
/*
Variabel initialization.
*/
$rrdname = "/full/path/to/rrdfile.rrd";
$daygraph = "gifday.gif";
$weekgraph = "gifweek.gif";
$monthgraph= "gifmonth.gif";
$yeargraph = "gifyear.gif";
/* I don't suggest you to modify listing code below. */
$daystart = "-2000m";
$weekstart = "-12000m";
$monthstart = "-2880000";
$yearstart = "-34560000";
gambar($daygraph, $rrdname, $daystart);
echo "<p align='center'><font face='verdana' size='2'><b>Daily graph</b></font>";
echo "<center><img src=images/$rowgraph[2]></center><p>";
gambar($weekgraph, $rrdname, $weekstart);
echo "<p align='center'><font face='verdana' size='2'><b>Weekly graph</b></font>";
echo "<center><img src=images/$rowgraph[3]></center><p>";
gambar($monthgraph, $rrdname, $monthstart);
echo "<p align='center'><font face='verdana' size='2'><b>Monthly graph</b></font>";
echo "<center><img src=images/$rowgraph[4]></center><p>";
gambar($yeargraph,$rrdname,$yearstart);
echo "<p align='center'><font face='verdana' size='2'><b>Yearly graph</b></font>";
echo "<center><img src=images/$rowgraph[5]></center><p>";
function gambar($gif,$rrd, $start)
{
$comm="rrdtool graph images/$gif --alt-y-grid --lazy -c MGRID#ee0000 -c GRID#000000 --
start $start -
-end now DEF:data0=$rrd:ds0:AVERAGE DEF:data1=$rrd:ds1:AVERAGE
\"CDEF:input=data0,8,*\" \"CDEF:output=data1,8,*\" CDEF:ijo=input,100
,GT,input,0,IF AREA:ijo#00BF00:\"Incoming traffic in Bits per second\\l\"
LINE2:output#0000FF:\"Outgoing traffic in Bits per second
\\l\" GPRINT:input:MAX:\"Maximal In\: %9.0lf bits.\" GPRINT:output:MAX:\"Maximal Out\: %9.0lf
bits.\\l\" GPRINT:input:AVERAGE:\"Aver
age In\: %9.0lf bits.\" GPRINT:output:AVERAGE:\"Average Out\: %9.0lf bits.\\l\"
GPRINT:input:LAST:\"Current In\: %9.0lf bits.\" GPRI
NT:output:LAST:\"Current Out\: %9.0lf bits.\\l\"";
exec($comm);
}
?> |
|
| Simple way of scaling any image to fit either given width or height. Categories : PHP, Graphics, Arrays | | | Image Cache Categories : Graphics, PHP Classes, PHP | | | img_upload - array img_upload(string 'form field name', string 'image name', string 'destination');
Returns an array with 2 elements.
Index 0 contains the string name of the image.
Index 1 contains the string path to the image. Categories : Graphics, PHP | | | Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality. Categories : PHP, GD image library, Graphics | | | Create a Thumbnail Using PHP, GD and Exif Categories : PHP, Graphics, Exif, GD image library | | | whois domain name lookup dns url Categories : PHP, Search, Network | | | fsockopen -- Open Internet or Unix domain socket connection Categories : PHP, PHP Functions, Network | | | IPTables Bandwidth statics Categories : PHP, Security, Network | | | An email validation script that actually checks against the recipient's mail server. Categories : Email, Complete Programs, PHP, Network, Debugging | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | PHP Email image generator - hide your email from bots - using the GD Library Categories : PHP, Graphics, GD image library, Beginner Guides | | | Simple graphic clock/watch generation using gd library. Categories : Graphics, Date Time, PHP | | | Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex
codes for their text, background, and link colors, and preview the color
scheme with their background image. Example:
http://www.snipe.net/tech/snipeschool/hex.php3 Categories : PHP, HTML and PHP, General, Graphics, HTML | | | A class to draw real 3D graphics with surface area Categories : Graphics, PHP, PHP Classes | | | Three Cool Classes and One Trick Categories : PHP, PHP Classes, Graphics, Email | |
|
|