<?php 
/*********************************************************      
CNF  configuration .
*********************************************************/

require("../sub_inc/operwebfunc.inc");
$helpId = "1.1.1";
$DEBUG = 0;

//==========================================================
//变量定义     
//==========================================================

$backurl_un = "$PHP_SELF?trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&subSysNo=$subSysNo";
$backurl = urlencode($backurl_un);

{//设备类型 与设备编号
	getElementInfo($infoNo,$elementInfoArr);
	$this_sysNo = $TypeNo = $elementInfoArr[sysNo];
	$this_subSysNo = $elementInfoArr[subSysNo];
	$TypeIn = $elementInfoArr[typeValue];
	$webname = $elementInfoArr[webName];
	$Spname = $elementInfoArr[eleName];
	if($DEBUG){
		echo "<br>this_sysNo=$this_sysNo";
		echo "<br>this_subSysNo=$this_subSysNo";
		echo "<br>TypeIn=$TypeIn";
		echo "<br>webname=$webname";
		echo "<br>Spname=$Spname";
	}
	
	$sysId = "160_$this_sysNo" . "_$this_subSysNo";
	$sysIdPub = "160_$this_sysNo" . "_99";
	$objDB = 'OBJ_160';
	$paramTab = 'param_'.$this_sysNo;	
	
	$center_objDB='OBJ_270';
	$center_paramTab='param_0';
	$center_sysId = "270_0_0";
}

{//CNF center	
	$tmpobj		= 'OBJ_222';
	$tmpparam = 'param_99';
	$tmpoid = '2.4.1';
	$objWhereStr = getLevelWhere($tmpoid);
	$paramSql = " SELECT initValue,instanceNo FROM $tmpparam  
				WHERE subSysNo = '99' AND  $objWhereStr 
				";
	
	$Result  = mysqli_query($pubConn,$paramSql);				
	while($Row = mysqli_fetch_array($Result))
	{
		$TypeIn	 = getBitValue($Row[initValue],'4.0-4.7');
		$TypeIn  = hexdec($TypeIn);
		if($TypeIn==6)//CNF Center
		{
			$center_DPC = hexdec(getBitValue($Row[initValue],'0.0-2.7'));
			$center_NI = bindec(getBitValue($Row[initValue],'3.0-3.1'));
			$center_lks_inst = $Row[instanceNo];
			break;
		}
	}
}

$NetIdConfArr=array('International','International-S','National','National-S');

$cnfPubOidArr=array(
	array('oid'=>'2.1.8',		'sysid'=> $sysIdPub,		'selectsysid'=>'-1'),										
	array('oid'=>'2.1.9',		'sysid'=> $sysIdPub,		'selectsysid'=>'-1')									
);

$cnfOidArr=array(
	array('oid'=>'2.2',		'sysid'=> $sysId,		'selectsysid'=>'-1'),																				
);

$cnfCenterOidArr=array(
	array('oid'=>'2.1',		'sysid'=> $center_sysId,	'selectsysid'=>'-1'),										
	array('oid'=>'2.2',		'sysid'=> $center_sysId,	'selectsysid'=>'-1')										
);

$SaveArr=array(
	array('oidstr'=>'2.3.2',	'setvalue'=>'01'	,'sysid' => $center_sysId,	'selectsysid'=>'-1'),
);

?>
<script LANGUAGE="JavaScript">
function delFirm(delName,No,delcheckbox)
{
	var x,y;
	x = document.body.scrollLeft;
	y = document.body.scrollTop;

	if(confirm('Do you want to delete the selected?')!=true)
	{
		delcheckbox.checked=false;
	}
	else
	{
		if(delName=='Prifdel')
			window.location.href='<?php echo $PHP_SELF."?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&subSysNo=$subSysNo";?>&Prifdel=1&delValue='+No+"&scroll_x="+x+"&scroll_y="+y;
		if(delName=='Confdel')
			window.location.href='<?php echo $PHP_SELF."?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&subSysNo=$subSysNo";?>&Confdel=1&delValue='+No+"&scroll_x="+x+"&scroll_y="+y;
	}
}
</script>
<body topmargin="0" leftmargin="12">
<?php
if($_SERVER['REQUEST_METHOD'] == "POST")
{	
	if(isset($setSys))
	{
		echo "<br>Setting parameters<br>";
		SetParam($cnfPubOidArr);				
		SetParam($cnfOidArr);
		SetParam($cnfCenterOidArr);	
			
		SaveParam($SaveArr);
	}
	else
	{ 
		echo "<br>Getting parameters<br>";
		GetParam($cnfPubOidArr);				
		GetParam($cnfOidArr);
		GetParam($cnfCenterOidArr);	
	}
	
	echo "<script LANGUAGE=\"JavaScript\">";
	echo "\n window.location.href=\"$backurl_un\";";
	echo "\n </script>";
	exit();
}

if($Prifdel==1)
{
	$oidstr = "2.1.8";
	$objWhereStr = getLevelWhere($oidstr);		
	$setValue = "0000";
	$updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$delValue'";
	mysqli_query($pubConn,$updSql);
	
	$oidstr = "2.1.9";
	$objWhereStr = getLevelWhere($oidstr);		
	$setValue = "00";
	$updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$delValue'";
	mysqli_query($pubConn,$updSql);
	
	echo "<script LANGUAGE=\"JavaScript\">";
	echo "\n window.location.href=\"$backurl_un\";";
	echo "\n </script>";
	exit();
}
if($Confdel==1)
{
	$oidstr = "2.2";
	$objWhereStr = getLevelWhere($oidstr);	
	$setValue='EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE';
	$updSql = "update $center_paramTab set initValue='$setValue' where $objWhereStr and instanceNo='$delValue' ";
	mysqli_query($pubConn,$updSql);
	
	echo "<script LANGUAGE=\"JavaScript\">";
	echo "\n window.location.href=\"$backurl_un\";";
	echo "\n </script>";
	exit();
}

{//show head part
	echo "<form method=\"POST\" name=\"setForm\" action=\"$backurl_un\">";
	echo "<table border=\"0\" width=\"100%\">";
	echo "<tr>";
	echo "<td width=\"50%\">";
	echo "Configuration > <a href=\"../overview/overview.php\">Network</a> > <a href=\"#\">CNF</a>";
	echo "</td>";
	echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
	//showHelp($helpId);
	echo "</td>";
	echo "</tr>";
	echo "</table>";
	echo "<br>";
	

	echo "<table width=\"100%\">";
	echo "<tr><td width=\"70%\">";
		
	echo "</td>";
	echo "<td width=\"20%\">";
		echo "<input type=\"submit\" name=\"getSys\" value=\"$strGet\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
		echo "&nbsp;&nbsp;&nbsp;";
		echo "<input type=\"submit\" name=\"setSys\" value=\"$strSet\" class=\"button\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
	echo "</td>";
	echo "<td width=\"10%\">";
		echo "<p align=\"right\"><a href=\"../overview/overview.php?scroll_y=$page_top\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
	echo "</td></tr>";
	echo "<input type=\"hidden\" name=\"linkset\" value=\"$linkset\">";
	echo "<input type=\"hidden\" name=\"trunkgp\" value=\"$trunkgp\">";
	echo "<input type=\"hidden\" name=\"cause_edit\" value=\"$cause_edit\">";
	echo "<input type=\"hidden\" name=\"infoNo\" value=\"$infoNo\">";
	echo "</table>";
}
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr><th colspan=\"2\">$Spname</th></tr>";
{// Signaling/Traffic
	{//DPC
	$DPC_sysId = '222_99_99';
	
	$DPC_sysIdArr	= explode('_',$DPC_sysId);
	$DPC_sysTypeNo	= $DPC_sysIdArr[0];
	$DPC_sysNo		= $DPC_sysIdArr[1];
	$DPC_subSysNo	= $DPC_sysIdArr[2];
	
	$DPC_oidstr = '2.4.1';
	$DPC_objWhereStr= '';	
	$DPC_objWhereStr =getLevelWhere($DPC_oidstr);
	$DPC_objDb		= 'OBJ_'.$DPC_sysTypeNo;
	$DPC_paramTable = 'param_'.$DPC_sysNo;		
	
	$DPC_paramSql = " SELECT initValue,readValue,instanceNo FROM $DPC_paramTable  
				WHERE $DPC_objWhereStr AND instanceNo ='$linkset' 
				";
	if($DEBUG) echo "$DPC_paramSql<br>";
	$DPC_Result = mysqli_query($pubConn,$DPC_paramSql);
	$DPC_Row	= mysqli_fetch_array($DPC_Result);
	$linkset_DPC		= hexdec(getBitValue($DPC_Row[initValue],'0.0-2.7'));
	$NetID 		= bindec(getBitValue($DPC_Row[initValue],'3.0-3.1'));		
	}

	{//WXC2 OPC ************************
	$oidstr = '2.2';
	$aas_link_Db = 'OBJ_222';	
	$aas_link_Table  = 'param_99';
	
	$subSysNo = 99;
	$objWhereStr= '';
	$objWhereStr =getLevelWhere($oidstr);
	$paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table  
				WHERE $objWhereStr AND subSysNo = '$subSysNo'
				";
	if($DEBUG) echo "$paramSql<br>";			
	$aas_Result = mysqli_query($pubConn,$paramSql);
	$aas_Row	= mysqli_fetch_array($aas_Result);
								
	$NIbit	= getBitValue($aas_Row[initValue],"0.$NetID");
	$tmp	= $NetID+1+$NIbit*4;
	$oidstr = '2.3.'.$tmp;
	$objWhereStr= '';
	$objWhereStr =getLevelWhere($oidstr);
	$updSql = "SELECT initValue FROM $aas_link_Table
			   WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo'
							";
	$Result	= mysqli_query($pubConn,$updSql);
	$Row	= mysqli_fetch_array($Result);
	$WXC2PC = hexdec($Row[initValue]);
	}

	echo "<tr >";
	echo "<td width=\"20%\" bgcolor=\"#E6E6E6\" >Signaling point code</td>";
	echo "<td >$linkset_DPC&nbsp;</td>";
	echo "<input type=\"hidden\" name=\"DPC\" value=\"$linkset_DPC\">";
	echo "</tr >";
		

	echo "<tr >";
	echo "<td bgcolor=\"#E6E6E6\" >NetWork indicator</td>";
	echo "<td >$NetIdConfArr[$NetID]";
	echo "<input type=\"hidden\" name=\"NetID\" value=\"$NetID\">";
	echo "</td>";
	echo "</tr >";
	
	echo "<tr >";
	echo "<td bgcolor=\"#E6E6E6\" >WXC2 point code</td>";
	echo "<td >$WXC2PC<input type=\"hidden\" name=\"WXC2PC\" value=\"$WXC2PC\">";
	echo "</td>";	
	echo "</tr >";
}

{//card type
echo "<tr>";
	echo "<td bgcolor=\"#E6E6E6\">Card Type</td>";
	echo "<td >";
	showParameter($sysId,'2.2.1',1,1);
	echo"</td>"; 
echo "</tr>";
}//end card type

{//DPLL priority		
echo "<tr>";
	echo "<td bgcolor=\"#E6E6E6\">DPLL priority</td>";
	echo "<td >";
	showParameter($sysId,'2.2.2',1,1);
	echo"</td>"; 
echo "</tr>";
}//end DPLL priority

{//Voice Prompt Setting
	echo "<tr>";
		echo "<td bgcolor=\"#E6E6E6\">Voice prompt setting</td>";
		echo "<td><table width=\"100%\">";
			echo "<tr>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.9\">Join meeting</a></td>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.10\">Leave Meeting</a></td>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.11\">Conference Full</a></td>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.12\">Password Invalid</a></td>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.13\">Five Minutes Left</a></td>";
			echo "<td><a href=\"./cnf_voicePrmt.php?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&sysNo=$this_sysNo&subSysNo=$this_subSysNo&levelStr=2.2.3.14\">End Conference</a></td>";
			echo "<tr>";
		echo "</table></td>";
	echo "</tr>";
}//end voice prompt Setting

{//prefix
	$leadDigArr = array(
		'Internal',
		'Conference',
		'PPS'
	);
	$oidstr = "2.1.8";
	$objWhereStr = getLevelWhere($oidstr);
	
	$selSql = "select instanceNo,initValue from $paramTab where $objWhereStr and subSysNo='99' and initValue!='0000' order by instanceNo ";
	$result = mysqli_query($pubConn,$selSql);
//	echo "<br>selSql: $selSql";
	$n=0;
	$whereStr = "(0";
	while($row = mysqli_fetch_array($result))
	{
		$prefixArr[$n][prefix] = str_replace('E','',$row[initValue]);
		$prefixArr[$n][inst]   = $row[instanceNo];
//		echo "<br>prefixArr[$n][inst]:{$prefixArr[$n][inst]}";
		$whereStr .= " or instanceNo={$prefixArr[$n][inst]}" ;
		$n++;
	}
	$whereStr .= ")";
//	echo "<br>whereStr: $whereStr";
	
	$oidstr = "2.1.9";
	$objWhereStr = getLevelWhere($oidstr);
	
	$selSql = "select instanceNo,initValue from $paramTab where $objWhereStr and subSysNo='99' and $whereStr order by instanceNo ";
	$result = mysqli_query($pubConn,$selSql);
	$n=0;
	while($row=mysqli_fetch_array($result))
	{
		$prefixArr[$n][dialLen] = bindec(getBitValue($row[initValue],'00.0-00.5'));
		$leadDig = bindec(getBitValue($row[initValue],'00.6-00.7'));
		$prefixArr[$n][leadDig] = $leadDigArr[$leadDig];
//		echo "<br>prefixArr[$n][leadDig]: {$prefixArr[$n][leadDig]}";
		$n++;
	}
//	echo "<br>selSql: $selSql";

	{//show prefix
	echo "<tr>" ;
		echo "<td bgcolor=\"#E6E6E6\">";
			echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" ><tr >";
			echo "<td align=left>Prefix</td>";
			echo "<td align=\"right\"><a href='./cnf_prefix.php?instanceNo=new&trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&sysNo=$this_sysNo&subSysNo=$this_subSysNo'><font size=4>+</font></a></td>";
			echo "</tr></table>";
		echo "</td>";
		if($n == 0) echo "<td>&nbsp;--</td>";
		else
		{
			echo "<td>";
			echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\">";
			echo "<tr bgcolor=\"#E6E6E6\">";
				echo "<td >No</td>";
				echo "<td >Prefix</td>";
				echo "<td >Dialed Length</td>";
				echo "<td >Lead digit</td>";
				echo "<td align=\"right\">Delete</td>";
			echo "</tr>";
			
			for($i=0; $i<sizeof($prefixArr); $i++)
			{
				echo "<tr onMouseOver=\"this.bgColor='#D2F0FF'\" onMouseOut=\"this.bgColor='#ffffff'\">";
					echo "<td ><a href='./cnf_prefix.php?instanceNo={$prefixArr[$i][inst]}&trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&sysNo=$this_sysNo&subSysNo=$this_subSysNo'>$i</a></td>";
					echo "<td >{$prefixArr[$i][prefix]}</td>";
					echo "<td >{$prefixArr[$i][dialLen]}</td>";
					echo "<td >{$prefixArr[$i][leadDig]}</td>";
					echo "<td align=\"right\"><input type=\"checkbox\" name=\"check_$i\" value=\"ON\" onclick=\"javascript:delFirm('Prifdel','{$prefixArr[$i][inst]}',this)\"</td>";
				echo "</tr>";
			}
			echo "</table></td>";
		}//end else
	echo "</tr>";
	}
}//end prefix

echo "</table>";

echo "<br>";

/*************** CNF Center parameter part *********************/
{//cnf center table
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
//echo "<tr><th >CNF Center linkset=$center_lks_inst</th></tr>";
echo "<tr><th colspan=\"2\">CNF Center</th></tr>";
{//cc and ndc		
echo "<tr>";
	echo "<td width=\"20%\" bgcolor=\"#E6E6E6\">CC and NDC</td>";
	echo "<td >";
	showParameter($center_sysId,'2.1.1',1,1);
	echo"</td>"; 
echo "</tr>";
}

{//OPC	
echo "<tr>";
	echo "<td width=\"20%\" bgcolor=\"#E6E6E6\">OPC</td>";
	echo "<td >";
	showParameter($center_sysId,'2.1.2',1,1);
	echo"</td>"; 
echo "</tr>";
}
{//NI	
echo "<tr>";
	echo "<td width=\"20%\" bgcolor=\"#E6E6E6\">NI</td>";
	echo "<td >";
	showParameter($center_sysId,'2.1.3',1,1);
	echo"</td>"; 
echo "</tr>";
}
{//	HRL0 IP
echo "<tr>";
	echo "<td width=\"20%\" bgcolor=\"#E6E6E6\">IP</td>";
echo "<td>";
echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\">";
echo "<tr>";
	echo "<td >HLR0 IP:&nbsp;";		
	showParameter($center_sysId,'2.1.4',1,3);		
	echo"</td>"; 
	echo "<td >HLR1 IP:&nbsp;";	
	showParameter($center_sysId,'2.1.5',1,3);		
	echo"</td>"; 
echo "</tr>";
	
echo "<tr>";
	echo "<td >PPS0 IP:&nbsp;";	
	showParameter($center_sysId,'2.1.6',1,3);		
	echo"</td>"; 
	echo "<td >PPS1 IP:&nbsp;";	
	showParameter($center_sysId,'2.1.7',1,3);		
	echo"</td>"; 
echo "</tr>";
echo "</table></td>";
}

{//Conference parameters
	$confParaArr = array(
	array('name' => 'Conf ID',		'bit' => '00.0-00.7', 		'value' => ''),
	array('name' => 'Conf Number',	'bit' => '01.0-08.7', 		'value' => ''),
	array('name' => 'Password',				'bit' => '09.0-10.7', 		'value' => ''),
	array('name' => 'Applicant',			'bit' => '11.0-18.7', 		'value' => ''),
	array('name' => 'Start time',			'bit' => '19.0-22.7', 		'value' => ''),
	array('name' => 'Duration',				'bit' => '23.0-24.7', 		'value' => ''),
	array('name' => 'Maximum party',		'bit' => '25.0-25.7', 		'value' => ''),
	array('name' => 'Status',				'bit' => '26.0-26.7', 		'value' => '')
	);
	{
		$oidstr = "2.2";
		$objWhereStr = getLevelWhere($oidstr);	
		
		$selSql = "select initValue from paramConf where $objWhereStr ";
		$result = mysqli_query($pubConn,$selSql);
		$row = mysqli_fetch_array($result);
		$defualtValue=$row[initValue];
		
		$selSql = "select initValue,instanceNo from $center_paramTab where $objWhereStr ";
		$result = mysqli_query($pubConn,$selSql);
		$n=0;
		while($row = mysqli_fetch_array($result))
		{
			$confNumber = getBitValue($row[initValue],$confParaArr[1][bit]);
			$confNumber = str_replace('E','',$confNumber); 
			if(strlen($confNumber)>0)
			{
				$showParaArr[$n][0][value] = hexdec(getBitValue($row[initValue],$confParaArr[0][bit]));
				$showParaArr[$n][1][value] = $confNumber;
				$showParaArr[$n][2][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[2][bit]));
				$showParaArr[$n][3][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[3][bit]));
				$showParaArr[$n][4][value] = str_replace('E','E',getBitValue($row[initValue],$confParaArr[4][bit]));
				$showParaArr[$n][5][value] = hexdec(getBitValue($row[initValue],$confParaArr[5][bit]));
				$showParaArr[$n][6][value] = hexdec(getBitValue($row[initValue],$confParaArr[6][bit]));
				$showParaArr[$n][7][value] = getBitValue($row[initValue],$confParaArr[7][bit]);
				
				for($j=0; $j<sizeof($confParaArr); $j++)
				{
					if($j==4)
						continue;
					if(strlen($showParaArr[$n][$j][value])==0)
						$showParaArr[$n][$j][value]='--';
				}
				$instanceNoArr[$n] = $row[instanceNo];
				$n++;
			}
		}
	}

	echo "<tr>" ;
		echo "<td bgcolor=\"#E6E6E6\">";
			echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" ><tr >";
			echo "<td align=left>Conference Booking</td>";
			echo "<td align=\"right\"><a href='./cnf_confPara.php?instanceNo=new&trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&subSysNo=$this_subSysNo'><font size=4>+</font></a></td>";
			echo "</tr></table>";
		echo "</td>";
	if($n == 0) echo "<td>&nbsp;--</td>";
	else
	{
		echo "<td>";
		echo "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\">";
		echo "<tr bgcolor=\"#E6E6E6\">";
			echo "<td>No</td>";
			for($i=0; $i< sizeof($confParaArr); $i++)
			{
				echo "<td>";
					echo $confParaArr[$i][name];
				echo "</td>";
			}
			echo "<td align=\"right\">Delete</td>";
		echo "</tr>";	
		$status_label=array(0=>"Not Executable",1=>"Booking",2=>"On Going",3=>"Finished",4=>"Draft");
		
		for($i=0; $i< $n; $i++)
		{
			echo "<tr onMouseOver=\"this.bgColor='#D2F0FF'\" onMouseOut=\"this.bgColor='#ffffff'\">";
				$inst = $instanceNoArr[$i];
				echo "<td><a href='./cnf_confPara.php?instanceNo=$inst&trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&sysNo=$this_sysNo&subSysNo=$this_subSysNo'>$i</a></td>";
				for($j=0; $j< sizeof($confParaArr); $j++)
				{
					echo "<td>";
					if($j==4)
					{
						$startTimeArr=array(
							array('name' => 'm',  'lin' => '-',	'value' => ''),
							array('name' => 'd',  'lin' => '&nbsp;',	'value' => ''),
							array('name' => 'H',  'lin' => ':',	'value' => ''),
							array('name' => 'M',  'lin' => '',	'value' => '')
						);
						$showParaArr[$i][$j][value] = omc_keep_length($showParaArr[$i][$j][value],'0',8,0);
						for($k=0; $k< sizeof($startTimeArr); $k++)
						{
							$startTimeArr[$k][value] = omc_keep_length(hexdec(substr($showParaArr[$i][$j][value],$k*2,2)),'0',2);
							echo $startTimeArr[$k][value] . $startTimeArr[$k][lin];
						}	
					}
					else if($j==7)
					{
						$status_show=$status_label[$showParaArr[$i][$j][value]+0];
						echo $status_show;
					}
					else
					{
						echo $showParaArr[$i][$j][value];
					}
					echo "</td>";
				}
				echo "<td align=\"right\"><input type=\"checkbox\" name=\"confCheck_$i\" value=\"ON\" onclick=\"javascript:delFirm('Confdel','$inst',this)\"></td>";
			echo "</tr>";
		}
		
		echo "</table></td>";
	}
	echo "</tr>";
}

echo "</table>";
}//end cnf  center table


echo "<div>";
	echo "<a href=\"./loaddata.php?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&flag=$flag\">CNF -> MSS</a>";
	echo "</div>";
echo "<br>";
?>
</form>
</body>
</html>
