Code: Select all
<?php
session_start();
include("../inc/config.php");
include("phpchartdir.php");
function query($query, $link, $line, $file)
{
$result = mysql_query($query);
if (empty($result) && ini_get('display_errors') == 1)
{
echo mysql_error().": ";
echo mysql_errno()."<br />\n";
echo $query."<br />\n";
echo "@ $line in $file\n";
}
return $result;
}
#The data for the pie chart
$data =$_SESSION["firstquarter2"];
#The labels for the pie chart
$labels=$_SESSION["firstquarter"];
//$c->setData($data, $labels);
#Create a PieChart object of size 450 x 240 pixels
$c = new PieChart(650, 440);
#Set the center of the pie at (150, 100) and the radius to 80 pixels
$c->setPieSize(360, 200, 120);
#Add a title at the bottom of the chart using Arial Bold Italic font
$c->addTitle2(Bottom, "Jumlah Kerosakan Mengikut Komponen", "arialbd.ttf");
#Draw the pie in 3D
$c->set3D();
#Use the side label layout method
$c->setLabelLayout(SideLayout);
#Set the pie data and the pie labels
$c->setData($data, $labels);
#Explode the 1st sector (index = 0)
$c->setExplode(0);
#output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
session_unset();
?>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form name="myform" action="cleanKomponen.php" method="post">
<CENTER>
<font face="verdana" color="red" size="2"><strong>
Anda dikehendaki menekan butang delete terlebih dahulu sekiranya anda hendak melihat keputusan yang tepat pada
masa yang akan datang......
</strong></strong>
<br><br><br>
<input style="BACKGROUND-COLOR: #cccccc; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid;
BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; COLOR: #333333; FONT-FAMILY: Verdana; FONT-SIZE:
7pt" type="submit" value="DELETE" name="submit">
</center>
</form>
</BODY>
</HTML>