<?php
/*********************************************************      
 程序说明:         
    功能说明:所有已知系统列表
    调用关系:调用: connectdb.inc，inc/header.inc     
              被调用:      
    变量说明:$device_table;
              $language_type是公共变量在config.inc文件定义
    返回值:无
 作者:     
修改注释:      
NO.1      
姓名:            
时间:      
修改说明:      
*********************************************************/    
$selectedLanguage=$userInfo['language'];
require("../../inc/header.inc");
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">

<?php
adjust_head_frame("down");
adjust_title_head_frame("down");
adjust_title_tail_frame("down");

adjust_content_head_frame("down");	
echo "<br>";

$DEBUG = 0;
$sysConfTable = 'OMC_PUB.sysConf';
$sysInfoTable = 'OMC_PUB.sysInfo';
$sysInfoDefTable = 'OMC_PUB.sysInfoDef';
$pubDb			 ='OMC_PUB';
$sysListSql = "SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime,needHeartBeat ,needInstall,needUninstall
				FROM $sysConfTable,$sysInfoTable
				WHERE $sysConfTable.sysTypeNo = $sysInfoTable.sysTypeNo
				ORDER BY $sysInfoTable.sysTypeNo,$sysInfoTable.sysNo,$sysInfoTable.subSysNo";
if($DEBUG) echo "<br>sysListSql = $sysListSql<br>";
$sysListResult = mysqli_query($pubConn,$sysListSql);
echo mysqli_error($pubConn);
?>
<form method="POST" name=confForm action="./systemConf.php" >
<table  border="1" width="100%" cellpadding="2" cellspacing="0"  bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" > 
 <tr bgcolor="#E6E6E6">    
	<td width="100%" colspan="12" align="center">
		<font size=3><b>
		<?php 
		echo "$strSystenList"; 
		?></b></font>
	</td>
  </tr>
<?php
if ($selectedLanguage == 'eng'){
	echo "<tr>";
	echo "<td>system Name</td>";
	echo "<td>sysAlias</td>";
	echo "<td>Network Type</td>";
	echo "<td>NetId</td>";
	echo "<td>DPC</td>";
	echo "<td>IP</td>";
	echo "<td>base Status</td>";
	echo "<td>Update Time</td>";
	echo "<td>&nbsp;</td>";
	echo "<td>&nbsp;</td>";
	echo "</tr>";
}elseif($selectedLanguage == 'chn'){
	echo "<tr>";
	echo "<td>系统名</td>";
	echo "<td>系统别名</td>";
	echo "<td>网络类型</td>";
	echo "<td>网络表示</td>";
	echo "<td>DPC</td>";
	echo "<td>IP</td>";
	echo "<td>基本状态</td>";
	echo "<td>更新时间</td>";
	echo "<td>&nbsp;</td>";
	echo "<td>&nbsp;</td>";
	echo "</tr>";
}
while($sysListRows=@mysqli_fetch_array($sysListResult)){
	$sysId=$sysListRows[sysTypeNo].'_'.$sysListRows[sysNo].'_'.$sysListRows[subSysNo];
	$sysName=$sysListRows[sysTypeName].'_'.$sysListRows[sysNo].'_'.$sysListRows[subSysNo];
	echo "<tr>";
	echo "<td>$sysName</td>";
	if(strlen($sysListRows[sysAlias]) > 0 ){
		echo "<td>$sysListRows[sysAlias]</td>";
	}else{
		echo "<td> -- </td>";
	}
	if($sysListRows[isRemote] > 0 ){
		echo "<td> SS7 </td>";
	}else{
		echo "<td> Ethernet </td>";
	}
	if($sysListRows[isRemote] > 0 ){
		echo "<td>$sysListRows[netId]&nbsp;</td>";
	}else{
		echo "<td> -- </td>";
	}

	echo "<td>$sysListRows[DPC]&nbsp;</td>";
	echo "<td>$sysListRows[ip]&nbsp;</td>";
	if($sysListRows[needHeartBeat] > 0){
		if($sysListRows[baseStat] > 0){
			echo "<td>Normal</td>";
		}else{
			echo "<td>False</td>";
		}
	}else{
		echo "<td>--</td>";
	}

	if($sysListRows[needHeartBeat] > 0){
		echo "<td>$sysListRows[updateTime]</td>";	
	}else{
		echo "<td>--</td>";
	}
	if($sysListRows[needInstall] > 0){
		echo "<td><a href=\"./systemConf.php?sysId=$sysId&ip=$sysListRows[ip]&mode=edit\">Edit</a></td>";
	}else{
		echo "<td>--</td>";
	}
	if($sysListRows[needUninstall] > 0){
		echo "<td><a href=\"./systemConf.php?sysId=$sysId&ip=$sysListRows[ip]&mode=delete&sysName=$sysName\">Delete</a></td>";
	}else{
		echo "<td>--</td>";
	}

	echo "</tr>";
}
echo "</table>";
echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo "</FORM>";

adjust_content_tail("down");
?>