<?php
global $objDbConn;
for($i=0;$i<18;$i++){
	$flagNum="flag$i";
	${$flagNum}=$_REQUEST[$flagNum];
}
if(0)
{
	echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to<br>";
	echo "keyOne=$keyOne,keyTwo=$keyTwo<br>";
}

$cstaConf=GetCstaConf($sysTypeNo);

$slot=$sel_date_from-$sel_date_to+1;
$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y")));
//echo "startTime=$startTime,endTime=$endTime<br>";

$total_hour_num=24*$slot;
echo "<input type=\"hidden\" name=\"select_checkbox_id\" value=\"$select_checkbox_id\">";
echo "<input type=\"hidden\" name=\"scroll_y\" value=\"$scroll_y\">";

//Service
if($keyTwo == 0)
{
	$cstaData[5]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",5);
	$cstaData[6]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",6);
	$cstaData[7]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",7);
	$cstaData[8]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",8);
	$cstaData[9]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",9);
	$cstaData[10]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",10);
	$cstaData[11]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",11);
	$cstaData[12]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",12);
	$cstaData[13]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",13);
	$cstaData[14]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",14);
	$cstaData[15]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",15);
	$cstaData[16]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",16);
	$cstaData[17]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",17);
	$cstaData[18]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",18);
	$cstaData[19]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",19);
	$cstaData[20]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",20);
	$cstaData[21]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",21);
	$cstaData[22]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",22);
	
	if(0)
	{
		echo "<pre>";
		print_r($cstaData);
		echo "</pre>";
	}
	
	//Table-1
	{
		$table_title="Service Erlang Statistic&nbsp;&nbsp;Date:";
		if($slot>1)
			$table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y")));
		else
			$table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
		
		echo "<br><b><center>$table_title</center></b>";
		echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
			
		$service_label=array(
			1=>"SUB SUB",
			2=>"SUB TRK",
			3=>"TRK SUB",
			4=>"TRK TRK",
			5=>"INTRA",
			6=>"SUB IP",
			7=>"TRK IP",
			8=>"MO",
			9=>"MT",
			10=>"IN TRK",
			11=>"OUT TRK",
		);
		$service_num=sizeof($service_label);
		
		$service_labelobj=array(
			"SUB SUB"=>"5,17",
			"SUB TRK"=>"6,18",
			"TRK SUB"=>"7,19",
			"TRK TRK"=>"8",
			"INTRA"=>"9",
			"SUB IP"=>"10,20",
			"TRK IP"=>"11",
			"MO"=>"12,21",
			"MT"=>"13,22",
			"IN TRK"=>"14",
			"OUT TRK"=>"15",
			"IP"=>"16"
		);
		
		
		$objInderRelation=array(
			5=>1,6=>1,7=>1,8=>1,
			9=>2,
			10=>3,
			11=>3,
			12=>4,
			13=>4,
			14=>5,
			15=>5,
			16=>6,
			17=>7,18=>7,19=>7,20=>7,21=>7,22=>7);
		
		for($i=1;$i<=$service_num;$i++)
		{
			$service_dataobj=explode(',',$service_labelobj[$service_label[$i]]);
			echo "<tr><td colspan=14 align=\"center\" bgcolor=\"#E6E6E6\">{$service_label[$i]}&nbsp;&nbsp;Erlang(Hour)</td></tr>";
			for($day=0;$day<$slot;$day++)
			{
				$value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
				if(sizeof($service_dataobj)>1)
					echo "<tr><td rowspan=6 width=\"10%\">$value</td>";
				else
					echo "<tr><td rowspan=4 width=\"10%\">$value</td>";
				for($hour=0;$hour<24;$hour++)
				{
					if($hour==0)
						echo "<td bgcolor=\"#E6E6E6\">&nbsp;</td>";
					if($hour==12)
						echo "<td bgcolor=\"#E6E6E6\">&nbsp;</td>";
					$value=omc_keep_length($hour,'0',2);
					echo "<td bgcolor=\"#E6E6E6\">$value</td>";
					
					if($hour == 11)
					{
						for($ii=0;$ii<sizeof($service_dataobj);$ii++)
						{			
							echo "</tr>";
							for($iii=0;$iii<12;$iii++)
							{
								if($ii==0&&$iii==0)
									echo "<td>GSM</td>";
								else if($ii==1&&$iii==0)
									echo "<td>UMTS</td>";
								$objindex=$objInderRelation[$service_dataobj[$ii]];
								$duration=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Duration][$day*24+$iii]+0;
								$erlang=change2point($duration/3600);
								$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Erlang][$day*24+$iii]=$erlang;
								echo "<td>$erlang</td>";
							}
							echo "</tr>";
						}
					}
					if($hour == 23)
					{
						for($ii=0;$ii<sizeof($service_dataobj);$ii++)
						{	
							echo "</tr>";
							for($iii=12;$iii<24;$iii++)
							{
								if($ii==0&&$iii==12)
									echo "<td>GSM</td>";
								else if($ii==1&&$iii==12)
									echo "<td>UMTS</td>";
								$objindex=$objInderRelation[$service_dataobj[$ii]];
								$duration=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Duration][$day*24+$iii]+0;
								$erlang=change2point($duration/3600);
								$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Erlang][$day*24+$iii]=$erlang;
								echo "<td>$erlang</td>";
							}
							echo "</tr>";
						}
					}
				}
			}
		}
		echo "</table>";
	}
	
	//Graphics-1 GSM
	{
		unset($tmpColor);
		unset($tmpData);
		if($flag0 == "on")
		{
			$tmpColor[]=array(0x99,0x22,0x33);
			$tmpData[]=$cstaData[5][1][5][Erlang];
		}
		if($flag1 == "on")
		{
			$tmpColor[]=array(0x99,0x00,0xcc);
			$tmpData[]=$cstaData[6][1][6][Erlang];
		}
		if($flag2 == "on")
		{
			$tmpColor[]=array(0x99,0x99,0x00);
			$tmpData[]=$cstaData[7][1][7][Erlang];
		}
		if($flag3 == "on")
		{
			$tmpColor[]=array(0x99,0x99,0x99);
			$tmpData[]=$cstaData[8][1][8][Erlang];
		}
		if($flag4 == "on")
		{
			$tmpColor[]=array(0x99,0xff,0x33);
			$tmpData[]=$cstaData[9][2][9][Erlang];
		}
		if($flag5 == "on")
		{
			$tmpColor[]=array(0xff,0x99,0x66);
			$tmpData[]=$cstaData[10][3][10][Erlang];
		}
		if($flag6 == "on")
		{
			$tmpColor[]=array(0xff,0x00,0x00);
			$tmpData[]=$cstaData[11][3][11][Erlang];
		}
		if($flag7 == "on")
		{
			$tmpColor[]=array(0xff,0xff,0x00);
			$tmpData[]=$cstaData[12][4][12][Erlang];
		}
		if($flag8 == "on")
		{
			$tmpColor[]=array(0x33,0x3,0x33);
			$tmpData[]=$cstaData[13][4][13][Erlang];
		}
		if($flag9 == "on")
		{
			$tmpColor[]=array(0x00,0xcc,0xff);
			$tmpData[]=$cstaData[14][5][14][Erlang];
		}
		if($flag10 == "on")
		{
			$tmpColor[]=array(0x00,0x22,0xcc);
			$tmpData[]=$cstaData[15][5][15][Erlang];
		}
		if($flag11 == "on")
		{
			$tmpColor[]=array(0xEE,0x00,0xff);
			$tmpData[]=$cstaData[16][6][16][Erlang];
		}
		
		echo "<br><b>Erlang Statistic Chart(GSM)</b><br>";
		
		
		if($select_checkbox_id>=0&&$select_checkbox_id<12)
		{
			if(0)
			{
				echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,boldline1=$select_checkbox_id<br>";
			}
				$boldline1=$select_checkbox_id;
			for($i=0;$i<$select_checkbox_id;$i++)
			{
				$param="flag$i";
				if($$param != "on")
					$boldline1--;
			}
		}
		$image=CreateImage(820,420);
		$image=DrawLineHistogram(
			$image,
			$tmpData,
			$tmpColor,
			750/(24*$slot),
			24,
			array(50,20),
			array(750,280),
			$boldline1,1,0,1
		);
	
		$remarkBlock=array(
			"SUB SUB",
			"SUB TRK",
			"TRK SUB",
			"TRK TRK",
			"INTRA",
			"SUB IP",
			"TRK IP",
			"MO",
			"MT",
			"IN TRK",
			"OUT TRK",
			"IP"
		);
		
		$pointArr=array(
			array(90,365),
			array(260,365),
			array(430,365),
			array(600,365),
			array(90,385),
			array(260,385),
			array(430,385),
			array(600,385),
			array(90,405),
			array(260,405),
			array(430,405),
			array(600,405)
		);
		
		unset($tmpColor);
		$tmpColor[]=array(0x99,0x22,0x33);
		$tmpColor[]=array(0x99,0x00,0xcc);
		$tmpColor[]=array(0x99,0x99,0x00);
		$tmpColor[]=array(0x99,0x99,0x99);
		$tmpColor[]=array(0x99,0xff,0x33);
		$tmpColor[]=array(0xff,0x99,0x66);
		$tmpColor[]=array(0xff,0x00,0x00);
		$tmpColor[]=array(0xff,0xff,0x00);
		$tmpColor[]=array(0x33,0x3,0x33);
		$tmpColor[]=array(0x00,0xcc,0xff);
		$tmpColor[]=array(0x00,0x22,0xcc);
		$tmpColor[]=array(0xEE,0x00,0xff);
		
		$image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2);
		DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24);
		
		echo "<table border=0 width=\"820\">";
		echo "<tr>";
		for($i=0;$i<sizeof($remarkBlock);$i++)
		{
			echo "<td>";
			AddCheckbox($remarkBlock[$i]);
			echo "</td>";
		}
		echo "</tr>";
		echo "</table>";
		
		DrawImage($image);
	}	
	
	//Graphics-2 UMTS
	{
		unset($tmpData);
		unset($tmpColor);
		if($flag12 == "on")
		{
			$tmpColor[]=array(0x99,0x22,0x33);
			$tmpData[]=$cstaData[17][7][17][Erlang];
		}
		if($flag13 == "on")
		{
			$tmpColor[]=array(0x99,0x00,0xcc);
			$tmpData[]=$cstaData[18][7][18][Erlang];
		}
		if($flag14 == "on")
		{
			$tmpColor[]=array(0x99,0x99,0x00);
			$tmpData[]=$cstaData[19][7][19][Erlang];
		}
		if($flag15 == "on")
		{
			$tmpColor[]=array(0xff,0x99,0x66);
			$tmpData[]=$cstaData[20][7][20][Erlang];
		}
		if($flag16 == "on")
		{
			$tmpColor[]=array(0xff,0xff,0x00);
			$tmpData[]=$cstaData[21][7][21][Erlang];
		}
		if($flag17 == "on")
		{
			$tmpColor[]=array(0x33,0x3,0x33);
			$tmpData[]=$cstaData[22][7][22][Erlang];
		}
	
		
		echo "<br><b>Erlang Statistic Chart(UMTS)</b><br>";
		
		
		if($select_checkbox_id>11)
		{
			if(0)
			{
				echo "flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16,flag17=$flag17,boldline=$select_checkbox_id<br>";
			}
			$boldline=$select_checkbox_id;
			for($i=12;$i<$select_checkbox_id;$i++)
			{
				$param="flag$i";
				if($$param != "on")
					$boldline--;
			}
		}
		$image=CreateImage(820,420);
		$image=DrawLineHistogram(
			$image,
			$tmpData,
			$tmpColor,
			750/(24*$slot),
			24,
			array(50,20),
			array(750,280),
			$boldline,1,0,1
		);
		
		unset($remarkBlock);
		unset($pointArr);
		$remarkBlock=array(
			"SUB SUB",
			"SUB TRK",
			"TRK SUB",
			"SUB IP",
			"MO",
			"MT"
		);
		
		$pointArr=array(
			array(90,365),
			array(260,365),
			array(430,365),
			array(600,365),
			array(90,385),
			array(260,385)
		);
		
		unset($tmpColor);
		$tmpColor[]=array(0x99,0x22,0x33);
		$tmpColor[]=array(0x99,0x00,0xcc);
		$tmpColor[]=array(0x99,0x99,0x00);
		$tmpColor[]=array(0xff,0x00,0x00);
		$tmpColor[]=array(0xff,0xff,0x00);
		$tmpColor[]=array(0x33,0x3,0x33);
		
		$image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2);
		DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24);
		
		echo "<table border=0 width=\"820\">";
		echo "<tr>";
		for($i=0;$i<sizeof($remarkBlock);$i++)
		{
			echo "<td>";
			AddCheckbox($remarkBlock[$i]);
			echo "</td>";
		}
		echo "</tr>";
		echo "</table>";
		
		DrawImage($image);
	}
	
	
}
//Trunk Group
else if($keyTwo == 1)
{
	//Get the trunk title
	for($i=0;$i<=256;$i++)
	{
		$trunk_element_title[$i]="--";
	}
	$dualTableLevelWhere="T1.level_1=T2.level_1 AND
						  T1.level_2=T2.level_2 AND
						  T1.level_3=T2.level_3 AND
						  T1.level_4=T2.level_4 AND
						  T1.level_5=T2.level_5 AND
						  T1.level_6=T2.level_6 AND
						  T1.level_7=T2.level_7 AND
						  T1.level_8=T2.level_8 AND
						  T1.level_9=T2.level_9 AND
						  T1.level_10=T2.level_10";
						  
	
	//===get the title of tg=====
	$database="OBJ_320";
	$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'";
	$result=@mysqli_query($objDbConn,$sql);
	$TrunkGroupCount=mysqli_num_rows($result);
	
	if($TrunkGroupCount>0)
	{
		while($rows = @mysqli_fetch_array($result))
		{
			//get the instanceNo of the tg
			$trunk_no=$rows[instanceNo]+0;
			$trunk_status[$trunk_no]=1;
			$trunk_element_title[$trunk_no]=$rows[initValue];
		}
	}
	if(0)
	{
		echo "<pre>";
		print_r($trunk_status);
		print_r($trunk_element_title);
		echo "</pre>";
	}

	$cstaData[3]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",3);
	$cstaData[4]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",4);
	if(0)
	{
		echo "<pre>";
		print_r($cstaData);
		echo "</pre>";
	}
	
	//Table-1
	{
		$table_title="Trunk Group Erlang Statistic&nbsp;&nbsp;Date:";
		if($slot>1)
			$table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y")));
		else
			$table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
		
		echo "<br><b><center>$table_title</center></b>";
		echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
		for($tg_no=0;$tg_no<=256;$tg_no++)
		{
			if($trunk_status[$tg_no] != 1)
				continue;
			echo "<tr>";
			echo "<td colspan=\"13\" bgcolor=\"#E6E6E6\" align=\"center\">TG {$tg_no}[{$trunk_element_title[$tg_no]}]&nbsp;&nbsp;Erlang(Hour)</td>";
			echo "</tr>";
			for($day=0;$day<$slot;$day++)
			{
				$value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
				echo "<tr><td rowspan=4 width=\"10%\">$value</td>";
				for($hour=0;$hour<24;$hour++)
				{
					$value=omc_keep_length($hour,'0',2);
					echo "<td bgcolor=\"#E6E6E6\">$value</td>";
					if($hour == 11)
					{
						echo "</tr>";
						for($i=0;$i<12;$i++)
						{
							$duration=$cstaData[3][0][3][$tg_no][Duration][$day*24+$i]+$cstaData[4][0][4][$tg_no][Duration][$day*24+$i];
							$erlang=change2point($duration/3600);
							$cstaData[2][0][2][$tg_no][Erlang][$day*24+$i]=$erlang;
							echo "<td>$erlang</td>";
						}
						echo "</tr>";
					}
					if($hour == 23)
					{
						echo "</tr>";
						for($i=12;$i<24;$i++)
						{
							$duration=$cstaData[3][0][3][$tg_no][Duration][$day*24+$i]+$cstaData[4][0][4][$tg_no][Duration][$day*24+$i];
							$erlang=change2point($duration/3600);
							$cstaData[2][0][2][$tg_no][Erlang][$day*24+$i]=$erlang;
							echo "<td>$erlang</td>";
						}
						echo "</tr>";
					}
				}
			}
		}
		echo "</table>";
	}
	
	//Graphics-1
	{
		
		$tmp=explode(",",$trunk_text);
		$trunk_no_0=$tmp[0]+0;
		$trunk_no_1=$tmp[1]+0;
		if(0)
		{
			echo "trunk_text=$trunk_text<br>";
			echo "trunk_no_0=$trunk_no_0<br>";
			echo "trunk_no_1=$trunk_no_1<br>";
		}
		unset($tmpColor);
		unset($tmpData);
		if($flag0 == "on")
		{
			$tmpColor[]=array(0x66,0xff,0x33);
			for($i=0;$i<$total_hour_num;$i++)
			{
				$duration=$cstaData[3][0][3][$trunk_no_0][Duration][$i]+$cstaData[4][0][4][$trunk_no_0][Duration][$i];
				$erlang=change2point($duration/3600);
				$tk_erl_0[$i]=$erlang;
			}
			$tmpData[]=$tk_erl_0;
		}
		if($flag1 == "on")
		{
			$tmpColor[]=array(0x66,0xff,0xff);
			for($i=0;$i<$total_hour_num;$i++)
			{
				$duration=$cstaData[3][0][3][$trunk_no_1][Duration][$i]+$cstaData[4][0][4][$trunk_no_1][Duration][$i];
				$erlang=change2point($duration/3600);
				$tk_erl_1[$i]=$erlang;
			}
			$tmpData[]=$tk_erl_1;
		}
		
		if(0)
		{
			echo "<pre>";
			print_r($tmpData);
			echo "</pre>";
		}
		echo "<br><b>Erlang Statistic Chart</b><br>";
	
		if(0)
		{
			echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16<br>";
		}
		$boldline=$select_checkbox_id;
		for($i=0;$i<$select_checkbox_id;$i++)
		{
			$param="flag$i";
			if($$param != "on")
				$boldline--;
		}
		
		$image=CreateImage(820,390);
		$image=DrawLineHistogram(
			$image,
			$tmpData,
			$tmpColor,
			750/(24*$slot),
			24,
			array(50,20),
			array(750,280),
			$boldline,1,0,1
		);
		
		$remarkBlock=array(
			"Trunk Group {$trunk_no_0}",
			"Trunk Group {$trunk_no_1}"
		);
		$pointArr=array(
			array(60,367),
			array(390,367),
		);
		unset($tmpColor);
		$tmpColor[]=array(0x66,0xff,0x33);
		$tmpColor[]=array(0x66,0xff,0xff);
		$image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2);
		DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24);
		
		echo "<table border=0 width=\"820\">";
		echo "<tr>";
		for($i=0;$i<sizeof($remarkBlock);$i++)
		{
			echo "<td>";
			AddCheckbox($remarkBlock[$i]);
			echo "</td>";
		}
		echo "</tr>";
		echo "</table>";
		
		DrawImage($image);
		echo "<input type=\"hidden\" name=\"trunk_text\" value=\"$trunk_text\">";
	}
}

	//=======show the remark label========
{
	echo "<table width=\"820\" border=0>";
	echo "<tr>";
		echo "<td width=\"34%\"><font color=blue>SUB SUB</font>-> Subscriber to subscriber</td>";
		echo "<td width=\"34%\"><font color=blue>TRK TRK</font>-> Trunk to trunk</td>";
		echo "<td width=\"33%\"><font color=blue>MO</font>-> Mobile originated</td>";
	echo "</tr>";
	echo "<tr>";
		echo "<td width=\"33%\"><font color=blue>SUB TRK</font>-> Subscriber to trunk</td>";
		echo "<td width=\"33%\"><font color=blue>INTRA</font>-> Intraconnection</td>";
		echo "<td width=\"33%\"><font color=blue>MT</font>-> Mobile terminated</td>";
	echo "</tr>";
	echo "<tr>";
		echo "<td width=\"33%\"><font color=blue>TRK SUB</font>-> Trunk to subscriber</td>";
		echo "<td width=\"33%\"><font color=blue>SUB IP</font>-> Subscriber to IP</td>";
		echo "<td width=\"34%\"><font color=blue>IN TRK</font>-> In trunk</td>";
	echo "</tr>";
	echo "<tr>";	
		echo "<td width=\"33%\"><font color=blue>TRK IP</font>-> Trunk to IP</td>";
		echo "<td width=\"33%\"></td>";
		echo "<td width=\"34%\"><font color=blue>OUT TRK</font>-> Out trunk</td>";
	echo "</tr>";
	echo "<tr>";		
		echo "<td width=\"33%\"></td>";
		echo "<td width=\"33%\"></td>";
		echo "<td width=\"33%\"><font color=blue>IP</font>-> IP terminated</td>";
	echo "</tr>";	
	echo "</table>";
}
?>
