File: C:/xampp/htdocs/cmykDe51/lineGraphDT.php
<?php
extract($_REQUEST);
session_start();
//error_reporting(E_ALL ^ E_NOTICE);?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5"><title>PSA Production Report--</title>
</head>
<?php
$host="127.0.0.1";
$user="root";
$pass="fredsql";
$db="tvicheck-st";
error_reporting(0);
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_query("SET NAMES 'utf8'");
//$link = mssql_connect("MACBOOK7", "sa", "fred5697");
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "SELECT * from spotDe where job='$po' order by id";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
$i=0;
// iterate iii through resultset
// print title with links to edit and delete scripts
$timear= array();
$mLar = array();
$maar = array();
$mbar = array();
$dear = array();
while($row = mysql_fetch_object($result))
{
$TL=$row->TL;
$Ta=$row->Ta;
$Tb=$row->Tb;
$i=$i+1;
//echo $i."-".$tm."__";
array_push($timear, $tm);
$mL=$row->mL;
array_push($mLar, $mL);
$ma=$row->ma;
array_push($maar, $ma);
$mb=$row->mb;
array_push($mbar, $mb);
$de=$row->de;
array_push($dear, $de);
}
$max=$i;
?>
<p>
<table width="800" border="1" align="center"> <font color="green">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"
require_once ('../jpgraph/jpgraph.php');
require_once ('../jpgraph/jpgraph_line.php');
require_once ('../jpgraph/jpgraph_plotline.php');
unlink('CMYSID.png');
$datay1 = $dear;
// Setup the graph
$graph = new Graph(750,430);
//$graph->SetScale("textint",0,6,0,0);
$graph->SetScale("textint");
$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);
$graph->title->Set('de');
$graph->SetBox(false);
$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
//$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#55bbdd");
$p1->SetLegend('Spot De');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();
$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);
// Output line
$graph->Stroke('CMYSID.png');
?>
<img src="CMYSID.png">
</div></td></tr>
</table>
<p><p> <p><p> <p><p>
<table width="800" border="1" align="center">
</tr>
</table>
<p>
<p><p> <p><p> <p><p>
<table width="200" border="1" align="center">
</table>
<p> </p>
<p> </p>
<table border="1" align="center" cellpadding="1" cellspacing="1">
<col width="87">
<col width="87">
<col width="83">
<col width="71" >
<col width="83">
<tr>
<td width="87">�ؼ�</td>
<td width="83" align="right" bgcolor="#FFFFFF"><?php echo $TL;?></td>
<td width="71" align="right" bgcolor="#FFFFFF"><?php echo $Ta;?></td>
<td width="71" align="right" bgcolor="#FFFFFF"><?php echo $Tb;?></td>
<td width="83" align="right" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td width="87">id</td>
<td width="83" align="center" bgcolor="#00CCFF">�q��L</td>
<td width="71" align="center" bgcolor="#FFCCFF">�q��a</td>
<td width="71" align="center" bgcolor="#FFFF99">�q��b</td>
<td width="83" align="center" bgcolor="#CCCCCC">��t</td>
</tr>
<?php
for ( $i = 1; $i <= $max; $i+= 1) {
?>
<tr>
<td><?php echo $i;?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo $mLar[$i-1];?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo $maar[$i-1];?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo $mbar[$i-1];?></td>
<td align="right" bgcolor="#FFFFFF"><?php echo $dear[$i-1];?></td>
</tr>
<?php } ?>
</table>
<p> </p>
<!-- graph code ends here-->