<?php
require("../../inc/header.inc");
require("./function.inc");
?>
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">

<script language="javascript">
function changeType()
{
	if(document.getElementById('service_type_id').style.display == "")
	{
		document.getElementById('service_type_id').style.display="none";
		document.getElementById('tg_type_id').style.display="";
	}
	else
	{
		document.getElementById('service_type_id').style.display="";
		document.getElementById('tg_type_id').style.display="none";
	}
}
</script>
<?php
adjust_head();

adjust_title_head();
echo "<FORM NAME=\"myform\" action=\"./erlang.php\" method=\"post\">";
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
	echo "<tr>";
		echo "<td width=\"50%\">";
		echo "Performance > MSC > Erlang";
		echo "</td>";
		echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
		$helpId="1.2.2";
		showHelp($helpId);
		echo "</td>";
	echo "</tr>";
	echo "<tr>";
		echo "<td width=\"50%\">";
		echo "&nbsp;";
		echo "</td>";
		echo "<td width=\"50%\" align=\"right\" title=\"Clear\">";
		
		echo "&nbsp;</td>";
	echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();

if($_SERVER['REQUEST_METHOD'] == "POST")
{
	echo "<center><br><font size=2 color=\"blue\">Mo,MT Erlang statistic 2010-10-19 to 2010-10-20</font></center><br>";
	echo "<table border=\"1\" width=100% cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#ffffff\">";
	echo "<tr bgcolor=\"#E6E6E6\">";
	echo "<td align=\"center\">&nbsp</td>";
	echo "<td align=\"center\"colspan=13>Erlang</td>";
	echo "</tr>";
	
	echo "<tr bgcolor=\"#E6E6E6\">";
	echo "<td align=\"center\" >Time</td>";
	echo "<td align=\"center\" >SUB SUB</td>";
	echo "<td align=\"center\" >SUB TRK</td>";
	echo "<td align=\"center\" >TRK SUB</td>";
	echo "<td align=\"center\" >TRK TRK</td>";
	echo "<td align=\"center\" >INTRA</td>";
	echo "<td align=\"center\" >SUB IP</td>";
	echo "<td align=\"center\" >TRK IP</td>";
	echo "<td align=\"center\" >MO</td>";
	echo "<td align=\"center\" >MT</td>";
	echo "<td align=\"center\" >IN TRK</td>";
	echo "<td align=\"center\" >OUT TRK</td>";
	echo "<td align=\"center\" >IP</td>";
	echo "<td align=\"center\" >TOTAL</td>";
	echo "</tr>";
	
	echo "<tr>";
	echo "<td align=\"center\">";
	echo "2010-10-19";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "35.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "35.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "35.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	
	echo "</tr>";
	echo "<tr>";
	echo "<td align=\"center\">";
	echo "2010-10-20";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "35.34";
	echo "</td>";
	
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "<td align=\"center\">";
	echo "25.34";
	echo "</td>";
	echo "</tr>";
	echo "</table>";
	
	
	
	
	
	
	//Graphics-1
{

		$tmpColor[]=array(0x66,0xff,0x33);
		$tmpData[]=100;

		$tmpColor[]=array(0x66,0xff,0xff);
		$tmpData[]=100;

		$tmpColor[]=array(0,0x66,0x66);
		$tmpData[]=$netbusy_value;

		$tmpColor[]=array(0x66,0,0xcc);
		$tmpData[]=100;

		$tmpColor[]=array(0x66,0x33,0);
		$tmpData[]=100;

		$tmpColor[]=array(0xcc,0,0x66);
		$tmpData[]=100;

		$tmpColor[]=array(0xff,0,0);
		$tmpData[]=100;
		
		$tmpColor[]=array(0x66,0xff,0xff);
		$tmpData[]=100;

		$tmpColor[]=array(0,0x66,0x66);
		$tmpData[]=100;

		$tmpColor[]=array(0x66,0,0xcc);
		$tmpData[]=100;

		$tmpColor[]=array(0x66,0x33,0);
		$tmpData[]=100;

		$tmpColor[]=array(0xcc,0,0x66);
		$tmpData[]=100;

		$tmpColor[]=array(0xff,0,0);
		$tmpData[]=100;
	
	echo "<br><b>Erlang Statistic Chart</b><br>";
	


	$image=CreateImage(820,390);
	$image=DrawLineHistogram(
		$image,
		$tmpData,
		$tmpColor,
		750/(24*2),
		24,
		array(50,20),
		array(750,280),
		0,1,0,1
	);
	
	$remarkBlock=array(
		"SUB SUB",
		"SUB TRK",
		"TRK SUB",
		"TRK TRK",
		"INTRA",
		"SUB IP",
		"TOTAL",
		"MO",
		"MT",
		"IN TRK",
		"OUT TRK",
		"IP"
	);
	$pointArr=array(
		array(60,367),
		array(160,367),
		array(260,367),
		array(360,367),
		array(460,367),
		array(560,367),
		array(660,367)
	);
	unset($tmpColor);
	$tmpColor[]=array(0x66,0xff,0x33);
	$tmpColor[]=array(0x66,0xff,0xff);
	$tmpColor[]=array(0,0x66,0x66);
	$tmpColor[]=array(0x66,0,0xcc);
	$tmpColor[]=array(0x66,0x33,0);
	$tmpColor[]=array(0xcc,0,0x66);
	$tmpColor[]=array(0xff,0,0);
	$image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2);
	DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,360),750/24);

	
	DrawImage($image);
}
	
	
	
	
	
	
	
}
else
{


echo "<br>";
echo "<font size=2>Customize the statistic condition for Erlang</font><br><br>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#ffffff\">";

echo "<tr bgcolor=\"#E6E6E6\">";

echo "<td width=\"8%\" align=\"center\">Type</td>";

echo "<td width=\"16%\">";
echo "<select onchange=\"javascript:changeType();\">";
echo "<option value=0>Service</option>";
echo "<option value=1>Trunk Group</option>";
echo "</select>";
echo "</td>";

echo "<td width=\"10%\" align=\"center\">Interval</td>";

echo "<td width=\"12%\">";
echo "<select>";
echo "<option value=0>Daily</option>";
echo "<option value=1>Hourly</option>";
echo "</select>";
echo "</td>";

echo "<td width=\"10%\" align=\"center\">Start Time</td>";

echo "<td width=\"16%\">";
echo "<select>";
echo "<option value=0>2010-10-19</option>";
echo "<option value=1>2010-10-20</option>";
echo "</select>";
echo "</td>";

echo "<td width=\"10%\" align=\"center\">End Time</td>";

echo "<td width=\"25%\">";
echo "<select>";
echo "<option value=0>2010-10-19</option>";
echo "<option value=1>2010-10-20</option>";
echo "</select>";
echo "</td>";

echo "<td width=\"10%\" align=\"center\">Merge";
echo "<input type=\"checkbox\">";
echo "</td>";

echo "<td width=\"25%\">";
echo "<input type=submit class=button value=\"search\">";
echo "</td>";

echo "</tr>";

echo "<tr id=\"service_type_id\">";

echo "<td colspan=10>";

echo "<table border=0 width=100%>";
echo "<tr>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "SUB SUB";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "SUB TRK";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "TRK SUB";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "TRK IP";
echo "</td>";

echo "</tr>";



echo "<tr>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "TRK TRK";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "INTRA";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "SUB IP";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "IP";
echo "</td>";

echo "</tr>";



echo "<tr>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "MO";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "MT";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "IN TRK";
echo "</td>";

echo "<td width=5>";
echo "<input type=checkbox>";
echo "</td>";

echo "<td>";
echo "OUT TRK";
echo "</td>";

echo "</tr>";



echo "</table>";

echo "</td>";

echo "</tr>";

echo "<tr id=\"tg_type_id\" style=\"display:none;\">";

echo "<td colspan=10>";


echo "<table border=0 width=100%>";
for($i=0;$i<32;$i++)
{
	echo "<tr>";
	for($j=0;$j<8;$j++)
	{
		echo "<td>";
		echo "<input type=checkbox>";
		echo "TG ".($i*8+$j);
		echo "</td>";
	}
	echo "</tr>";
}
echo "</table>";


echo "</td>";

echo "</tr>";


echo "</table>";
echo "</form>";



}
adjust_content_tail();

?>

