<?php
require("../sub_inc/commfunc.php");

$listPageUrl = "CNFconf.php?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&sysNo=$sysNo&subSysNo=$subSysNo"; 

$objDB = 'OBJ_160';
$paramTab = 'param_'.$sysNo;	
?>

<body topmargin="0" leftmargin="12">
	
<?php
if($_SERVER['REQUEST_METHOD'] == "POST")
{
	$objWhereStr = getLevelWhere($levelStr);
	$setValue='';
	for($i=0;$i<48;$i++)
	{
		$tmp = ${"byte_".$i};
		$tmp = strtoupper(omc_keep_length($tmp,'0',2));
		
		$setValue .= $tmp;
	}
	
	$updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$subSysNo'";
	mysqli_query($pubConn,$updSql);
	echo "<script LANGUAGE=\"JavaScript\">";
	if(!$DEBUG)
	{
		echo "\n window.location.href=\"$listPageUrl\";";
	} 	
	echo "\n </script>";
}

$selfPage = "$PHP_SELF?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&sysNo=$sysNo&subSysNo=$subSysNo&levelStr=$levelStr";
echo "<form method=\"POST\" name=\"Set\" action=\"$selfPage\">";
{
	echo "<table border=\"0\" width=\"100%\">";
	echo "<tr>";
	echo "<td width=\"50%\">";
	//echo "Configuration > Network > Element > CNF > Channel";
	echo "Configuration > <a href=\"../overview/overview.php\">Network</a> > <a href=\"$listPageUrl\">CNF</a> > <a href=\"#\">Voice Prompt</a>";
	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 "<b>Voice Prompt Setting:&nbsp;&nbsp;</b>";
	echo "$subChannelName";
	echo "</td>";
	echo "<td width=\"20%\">";
	echo "<input type=\"submit\" value=$strSave class=\"button\" name=\"setSys\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";	
	echo "&nbsp;&nbsp;&nbsp;&nbsp;";
	echo "<input type=\"reset\" value=$strReset  class=\"button\" name=\"Reset\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
	echo "</td>";
	echo "<td width=\"10%\">";
	echo "<p align=\"right\"><a href=\"$listPageUrl\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
	echo "</td></tr>";
	echo "</table>";
}

echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
	$tmpArr=explode('.',$levelStr);
	switch($tmpArr[3])
	{
		case 9:
		$tableName='Join meeting';
		break;
		case 10:
		$tableName='Leave Meeting';
		break;
		case 11:
		$tableName='Conference Full';
		break;
		case 12:
		$tableName='Password Invalid';
		break;
		case 13:
		$tableName='Five Minutes Left';
		break;
		case 14:
		$tableName='End Conference';
		break;
		default:
		break;
	}
	{
		$objWhereStr = getLevelWhere($levelStr);
		$selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo'";
		$result = mysqli_query($pubConn,$selSql);
		$row = mysqli_fetch_array($result);
	}
	echo "<tr><th colspan=\"6\">$tableName</th></tr>";
	for($i=0;$i< 8;$i++)
	{
		echo "<tr>";
		for($j=0; $j< 6; $j++)
		{
			$no = $j*8 + $i;
			$name="byte_" . $no;
			$value = substr("$row[initValue]",2*$no,2);
			echo "<td>Byte $no:&nbsp;";
				echo "<input type=\"text\" size=\"3\" maxlength=\"2\" name=\"$name\" value=\"$value\"> ";
			echo "</td>";
		}
		echo "</tr>";
	}
echo "</talble>";
?>

