<?php 
/*********************************************************      
 程序说明：         
    功能说明：本程序将数据表中的分级目录，按树状菜单的形式显示出来，
              类似于windows资源管理器的效果。

    调用关系：调用: connectdb.inc,header.inc     
              被调用:      
 
    变量说明：$language_type是公共变量在config.inc文件定义

     返回值：无

 作者：  
      
修改注释：      
NO.1      
姓名：            
时间：      
修改说明：      
*********************************************************/     
require("../../inc/header.inc");
$DEBUG=0;
$pubDb='OMC_PUB';
$sysConfTable = 'sysConf';
//所链接的页面
$targetPage = 'systemConf_main.php';
$pageType=$_REQUEST['pageType'];
if($pageType == 'ledOffset'){
	$showFieldList="ledOffset,sysTypeName,sysTypeNo,maxSysNum,maxSubSysNum,needHeartBeat";
	$treeMenuSql = "SELECT $showFieldList
			FROM $sysConfTable
			WHERE needHeartBeat > '0'
			ORDER BY ledOffset 
			"; 
}else{
	$showFieldList  = "snmpHead,sysTypeName,sysTypeNo,maxSysNum,maxSubSysNum,ledOffset,needHeartBeat";
	$showFieldList .= ",needParamConf";
	$treeMenuSql = "SELECT $showFieldList
			FROM $sysConfTable
			WHERE snmpHead like '%1373%'
			ORDER BY sysTypeNo 
			"; 
	echo "<base target=\"sysConf_main\">";
}


?>
<body bgcolor=#efefef>
<!--<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">-->
<?php
/*
adjust_head();
adjust_title_head();
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
	echo "<tr>";
		echo "<td width=\"50%\">";
		echo "Template > LED Definition > Offset";
		echo "</td>";
		echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
		//showHelp($helpId);
		echo "</td>";
	echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
echo "<br>";
*/
?>
<FORM METHOD=POST name=selectForm>
<?php
if($DEBUG) echo "<br>$treeMenuSql";
$treeMenuResult = mysqli_query($pubConn,$treeMenuSql);
echo mysqli_error($pubConn);

//echo "<a href=\"$PHP_SELF?pageType=ledOffset\">LED</a>";
?>

 <table  border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" > 
<?php
$fieldArr=explode(',',$showFieldList);

echo "<tr bgcolor=\"#E6E6E6\">";
for($i=0;$i<sizeof($fieldArr);$i++){
	echo "<td>$fieldArr[$i]</td>";
}
echo "</tr>";
while($treeMenuRows = @mysqli_fetch_array($treeMenuResult)){
	echo "<tr>";
	for($i=0;$i<sizeof($fieldArr);$i++){
		
		if($fieldArr[$i] == 'sysTypeName' ){
			echo "<td><a href=$targetPage?sysTypeNo=$treeMenuRows[sysTypeNo]>";
			echo "{$treeMenuRows[sysTypeName]}</a></td>";
		}else{
			echo "<td>{$treeMenuRows[$fieldArr[$i]]}</td>";
		}
	}
	echo "</tr>";
}
?>
</table>
</FORM>
<?php
//adjust_content_tail();
?>
</body>
</html>