<?php
ob_start();
session_start();
if($_SESSION["statusCheck"]=="")
{
header('location:index.php');
exit();
}
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
include('../include/connect.php');
include("../include/check.php");
include("../include/function.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($mmCheck[$i]==$subM)
{
$datay[$i]=$datay[$i]+1;
}else{
$datay[$i]=$datay[$i]+0;
}
}
}
echo "</br>datax= ";
print_r($datax);
echo "</br>datay= ";
print_r($datay);
?>
<html>
<title>..:: ระบบจัดการฐานข้อมูล ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="stylesheet" href="../style/styles.css" type="text/css">
<link rel="stylesheet" href="../style/mm_health_nutr.css" type="text/css">
<script language="JavaScript" src="../include/calendar.js">
</script>
<link href="../include/calendar-mos.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<body topmargin="0" bottommargin="0" leftmargin="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><select name="select2" class="txtbox" onChange="MM_jumpMenu('parent',this,0)">
<option value="0">เลือกโครงการ</option>
<? //=========== แสดงหมวดหมู่
$sql_group = "select * from agent where 1 order by Agent_EngName asc";
$dbquery_group = mysql_query($sql_group);
$num_rows_group = mysql_num_rows($dbquery_group);
while ($result = mysql_fetch_array($dbquery_group))
{
if($_GET["Agent_ID"] == $result["Agent_ID"])
{
$sel="selected";
}
else
{
$sel="";
}
?>
<option value="<?=$_SERVER['PHP_SELF'];?>?Agent_ID=<?=$result["Agent_ID"];?>&datay=<?=$datay?>" <?=$sel;?>>
<?=$result["Agent_EngName"];?>
</option>
<?
}
?>
</select>
<select name="year1" class="av11" id="year1" onChange="MM_jumpMenu('parent',this,0)">
<? if($mm==0){ $mm=00; }else{ $mm=$mm;}
if($year1==0){ $year1=$yea = date("Y")+543; }else{ $year1=$year1;}
$yea = date("Y")+543;
for($i=2548;$i<=$yea;$i++){
if($i==$year1){
$sel="selected";
}else{ $sel="";}
?>
<option value="<?=$_SERVER['PHP_SELF'];?>?Agent_ID=<?=$Agent_ID;?>&year1=<?=$i;?>&datay=<?=$datay?>" <?=$sel?>>
<?=$i?>
</option>
<? }?>
</select>
<form name="form1" method="post" action="">
<input type="hidden" name="hiddenField" value="<?=$datay?>">
</form>
</td>
</tr>
<tr>
<td height="10">
</td>
</tr>
</table>
<br>
</body>
<?
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(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();
?>
<?
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(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();
?>
<?php
include ("../include/connect.php");
include ("../include/jpgraph.php");
include ("../include/jpgraph_bar.php");
include ("../include/jpgraph_line.php");
$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($mmCheck[$i]==$subM)
{
$datay[$i]=$datay[$i]+1;
}else{
$datay[$i]=$datay[$i]+0;
}
}
}
$datax=array("Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec");
// 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();
?>
// We need some data
$datay=array(0.13,0.25,0.21,0.35,0.31,0.06);
$datax=array("Jan","Feb","Mar","Apr","May","June");
// Setup the graph.
$graph = new Graph(600,400,"auto");
$graph->img->SetMargin(60,40,50,120);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue");
$graph->SetShadow();
// Set up the title for the graph
$graph->title->Set($title);
$graph->title->SetFont(FF_TAHOMA, FS_BOLD, 16);
//$graph->title->SetFont(FF_TAHOMA,FS_NORMAL,12);
$graph->title->SetColor("darkred");
$graph->legend->SetFont(FF_TAHOMA,FS_BOLD);
// Setup font for axis
$graph->xaxis->SetFont(FF_TAHOMA,FS_NORMAL,12);
$graph->yaxis->SetFont(FF_TAHOMA,FS_NORMAL,12);
// Show 0 label on Y-axis (default is not to show)
$graph->yscale->ticks->SupressZeroLabel(false);
// Setup X-axis labels
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(50);
// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
// Setup color for gradient fill style
$bplot->SetFillGradient("navy","#EEEEEE",GRAD_LEFT_REFLECTION);
// Set color for the frame of each bar
$bplot->SetColor("white");
$graph->Add($bplot);
$bplot->value->Show();
// Finally send the graph to the browser
$graph->Stroke();
?>