<?php
/*********************************************************      
程序说明：         
    功能说明：参数维护的上部页面,

    调用关系：调用: header.inc     
              被调用:    
 
    变量说明：

    返回值：无

 作者：      
      
修改注释：      
NO.1      
姓名 ：            
时间：      
修改说明：      
*********************************************************/ 
require("../../inc/header.inc");
$helpId = "2_1"; 
$DEBUG	= 0;
$db='OMC_PUB';
$sysConfTable = 'OMC_PUB.sysConf';

?>
<base target="d_main">
<body leftmargin="15" rightmargin="10" onload="javascript:selectSysName();javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">

<script LANGUAGE="JavaScript">  
function selectSysType(){      
	var base_url,url_add,url; 
	base_url='<?php echo"$PHP_SELF";?>?sysTypeNo=';
	url_add=document.selectform.sysTypeList.options[document.selectform.sysTypeList.selectedIndex].value;      
	url=base_url+url_add;
	window.location=url;
}   

function selectSysName(){      
	var baseURL,addURL,URL; 
	baseURL = 'paramConf_down.php?DPC=0&sysId=';
	addURL	= document.selectform.sysName.options[document.selectform.sysName.selectedIndex].value;      
	URL		= baseURL+addURL;
	window.parent.d_main.location = URL;      
}    
</script>
<form method="post" name="selectform"  id="selectform" action="paramConf_down.php">
<?php
adjust_head_frame("up");
adjust_title_head_frame("up");
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\" align=\"left\">";
echo "Advance > Network > Parameter setting";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
//showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";
?>
<TABLE style="position: relative; top:8; left: 0;" border="1" width="600" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">  
<tr bgcolor="#E6E6E6">
<td  align="left"><?php echo "Entity"; ?>:
<select size="1" name="sysTypeList" onChange="javascript:selectSysType()">      
          
<?php  
//显示选择设备下拉菜单
$sysTypeSql ="SELECT sysTypeNo,sysTypeName,maxSysNum,maxSubSysNum,needGlobalSysParam,needGlobalSubSysParam,needSubSysParam 
			FROM $sysConfTable 
			WHERE needParamConf = '1' 
			AND sysTypeNo != '320' 
			AND sysTypeNo != '311'
			AND sysTypeNo != '340'
			AND sysTypeNo != '380'
			AND sysTypeNo != '330'
			AND sysTypeNo != '375'
			AND sysTypeNo != '355'
			AND sysTypeNo != '260'
			AND sysTypeNo != '350'
			AND sysTypeNo != '325'
			AND sysTypeNo != '225'
			AND sysTypeNo != '385'
			AND sysTypeNo != '390'
			AND sysTypeNo != '378'
			AND sysTypeNo != '379'
			AND sysTypeNo != '386'
			AND sysTypeNo != '389'
			ORDER BY sysTypeName
			";
//AND sysTypeNo != '360'
if($DEBUG)	echo "sysTypeSql=$sysTypeSql<br>";
$sysTypeResult = @mysqli_query($pubConn,$sysTypeSql);
$sysTypeRows = @mysqli_fetch_array($sysTypeResult);
if(!isset($sysTypeNo))
	//$sysTypeNo=$sysTypeRows[sysTypeNo];
	$sysTypeNo=222;
	
do{
	echo "<option value=\"$sysTypeRows[sysTypeNo]\" ";
	
	if($sysTypeRows[sysTypeNo] == $sysTypeNo && isset($sysTypeRows[sysTypeNo])){
		echo "selected";
		$sysTypeName = $sysTypeRows[sysTypeName];
		$maxSysNum	 = $sysTypeRows[maxSysNum];
		$maxSubSysNum= $sysTypeRows[maxSubSysNum];
		$needGlobalSysParam		= $sysTypeRows[needGlobalSysParam]; 
		$needGlobalSubSysParam	= $sysTypeRows[needGlobalSubSysParam]; 
		$needSubSysParam		= $sysTypeRows[needSubSysParam]; 
	}
	echo ">";
	echo "$sysTypeRows[sysTypeName]";
	echo "</option>";
}while($sysTypeRows = @mysqli_fetch_array($sysTypeResult));
?>
</select>

</td>
<td align="left"><?php echo "ID"; ?>:
<select name="sysName" size="1" onChange="javascript:selectSysName()">
<?php

if($needGlobalSysParam > 0){
	$sysName=$sysTypeName.'_pub';
	$sysId  =$sysTypeNo.'_99_99';
	echo "<option value=\"$sysId\">$sysName</option>";
	
	if ( ('222' == $sysTypeNo) || ('223' == $sysTypeNo) ) { //MTP3 OR SCCP
		for($i=0;$i<$maxSysNum;$i++){
			if ( (8 == $i) || (11 == $i) ) {//目前只有VMS AAS用到了MTP3 or SCCP参数
				for($j=0;$j<$PlatTypeDefArr[$i][maxSysNum];$j++){
					$sysName=$sysTypeName.'_'.$i.'_'.$j;
					$sysId  =$sysTypeNo.'_'.$i.'_'.$j;
					if(($sysTypeNo == '222' && $i == 11) || ($sysTypeNo == '223' && ($i == 8 || $i == 11)))
						;
					else
						echo "<option value=\"$sysId\">$sysName({$PlatTypeDefArr[$i][remark]})</option>";
				}
			}
		}
	}	
}

for($i=0;$i<$maxSysNum;$i++){
	if($needGlobalSubSysParam > 0){
		$sysName=$sysTypeName.'_'.$i.'_pub';
		$sysId  =$sysTypeNo.'_'.$i.'_99';
		echo "<option value=\"$sysId\">$sysName</option>";
	}
	if($maxSubSysNum > 0 &&  $needSubSysParam > 0){
		for($j=0;$j<$maxSubSysNum;$j++){
			//$j=omc_keep_length($j,0,$len_of_subsys_num);
			$sysName=$sysTypeName.'_'.$i.'_'.$j;
			$sysId  =$sysTypeNo.'_'.$i.'_'.$j;
			$sysAlias=omc_get_sysAlias($sysTypeNo,$i,$j);
			if($sysAlias != -1){
				echo "<option value=\"$sysId\">$sysName [$sysAlias]</option>";
			}else{
				echo "<option value=\"$sysId\">$sysName</option>";
			}
		}
	}
}
?>
</select> 
</td>

<script LANGUAGE="JavaScript"> 
<!--
function OpenD2H2B(term) {
	if(term.checked){
		URL="./D2H2B.php";
		var D2H2BWindow = open(URL, 'D2H2BWin', 'toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=no,width=625,height=1,outerWidth=22,outerHeight=33,left=300,top=300');
		D2H2BWindow.focus();   
	}else{
		URL="./D2H2B.php";
		var D2H2BWindow = open(URL, 'D2H2BWin', 'toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=no,status=no,width=625,height=1,outerWidth=22,outerHeight=33,left=300,top=300');
		D2H2BWindow.close();
	}
}
-->
</script>
<?php
/* 先屏蔽起来
echo "<td title=\"$strNumericFormatCalculator\">";
echo"&nbsp;&nbsp;<input type=checkbox name=D2H2B onclick=OpenD2H2B(this)>$strOpenCodeCommutator";
echo "<img src=\"../../images/cal.gif\">";
*/
?>
</td>   
</tr>   
</table>

<?php

echo "</td>";
echo "<td align=\"right\">&nbsp;";
echo "</td>";
echo "</tr>";
echo "</table>";
?>

   
</form>
</body>
</html>
