<?php
include ("../include/connect.php")
include ("../include/jpgraph.php");
include ("../include/jpgraph_bar.php");
include ("../include/jpgraph_line.php");
$datax=array("Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec");
$datay= array();
$mmCheck=array(01,02,03,04,05,06,07,08,09,10,11,12);
$queryPlan1 = "select * from booking where Agent_ID=$Agent_ID";
$rsPlan1= mysql_query($queryPlan1);
$num_rows = mysql_num_rows($rsPlan1);
while($row_Plan1 = mysql_fetch_assoc($rsPlan1)){
$subY=substr($row_Plan1[start],0,4);
$subM=substr($row_Plan1[start],5,2);
$subY+=543;
for($i=0;$i>=12;$i++){
if($subM==$mmCheck[$i])
{
$datay[$i]=$datay[$i]+1;
}else{
$datay[$i]=$datay[$i]+0;
}
}
}
//$datay=array(1,2,3,4,5,6,7,8,9,10,11,12);
// Setup the graph.
$graph = new Graph(990,500,"auto");
$graph->img->SetMargin(60,30,30,150);
$graph->SetScale("textlin");
$graph->SetMarginColor("teal");
$graph->SetShadow();
// Setup X-axis labels
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(60);
// Create the bar pot
$bplot = new BarPlot($datay);
//$bplot->SetWidth(0.6);
// This is how you make the bar graph start from something other than 0
$bplot->SetYMin(0.302);
// Setup color for gradient fill style
$tcol=array(100,100,255);
$fcol=array(255,100,100);
$bplot->SetFillGradient($fcol,$tcol,GRAD_HOR);
$bplot->SetFillColor("orange");
$graph->Add($bplot);
// Set up the title for the graph
$graph->title->SetColor("yellow");
// Setup color for axis and labels
$graph->xaxis->SetColor("black","white");
$graph->yaxis->SetColor("black","white");
// Setup font for axis
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$fmtStr = "javascript:window.open('barcsim_details.php?id=%d','_new','width=500,height=300');void(0)";
$n = count($datay);
$targ=array();
$alts=array();
for($i=0; $i < $n; ++$i) {
$targ[$i] = sprintf($fmtStr,$i+1);
$alts[$i] = 'val=%d';
// Note: The format placeholder val=%d will be replaced by the actual value in the ouput HTML by the
// library so that when the user hoovers the mouse over the bar the actual numerical value of the bar
// will be d?splayed
}
$bplot->SetCSIMTargets($targ,$alts);
// Add plot to graph
$graph->Add($bplot);
// Setup the title, also wih a CSIM area
$graph->title->Set("CSIM with popup windows");
$graph->title->SetFont(FF_FONT2,FS_BOLD);
// Assume we can give more details on the graph
$graph->title->SetCSIMTarget(sprintf($fmtStr,-1),'Title for Bar');
// Send back the HTML page which will call this script again to retrieve the image.
$graph->StrokeCSIM();
?>