<?php
/*********************************************************      
Create:
        
Function: Site Map
Invoke: header.inc  
Author: Li Long
Date: Tuesday, March 02, 2004

Modification:
[No.1]
Name£º         
Time£º  
Description£º
/*********************************************************/ 
require("../../inc/header.inc");
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
adjust_head();
$DEBUG = 0;

$OmcTypeNo = (isset($thisOmcType)?$thisOmcType:0);
$myPrivilege = $userInfo[privilege];
if($selectedLanguage == 'eng'){
	$menuName	= name_2;
	$remark		= remark_2;
}else{
	$menuName	= name_1;
	$remark		= remark_1;
}

$dbName		= "OMC_PUB";
$tableName	= "sysMenuConf";
$selSQL		= "SELECT level_1,level_2,level_3,level_4,level_5,$menuName,httpLink,$remark
			FROM $tableName
			WHERE privilege <= '$myPrivilege' AND privilege >= '0'
			ORDER BY level_1,level_2,level_3,level_4,level_5
					";
//WHERE menuTypeNo = '$OmcTypeNo' AND					
if($DEBUG)	
	echo "selSQL=$selSQL<br>";
$selResult = @mysqli_query($pubConn,$selSQL);
echo mysqli_error($pubConn);
$selRowsNum = mysqli_num_rows($selResult);
if($DEBUG)	echo "selRowsNum=$selRowsNum<br>";
adjust_title_head();
?>

<html>
<STYLE type=text/css media=all>#main {
	FONT-SIZE: 10px
}
H1 {
	FONT-SIZE:20px; PADDING-BOTTOM: 3px; COLOR: #76797c; PADDING-TOP: 5px; BORDER-BOTTOM: #a1a5a9 
}
H2 {
	FONT-SIZE:16px; PADDING-BOTTOM: 3px; COLOR: #76797c; PADDING-TOP: 5px; BORDER-BOTTOM: #a1a5a9 
}
#header {
	TEXT-ALIGN: left
}
</STYLE>
<!--
<div id=header><a name=top><img height=30 alt="WXC2 OMC Site Map" 
src="../../images/title_sitemap.gif" width=288 align=top 
border=0></a></div>
-->
<!-- BEGIN SITE MAP -->
<H1>Site map</H1>
<?php
adjust_title_tail();
adjust_content_head();
?>
<div id=main>
<?php
//init menu array
for($i=0;$i<$selRowsNum;$i++){
	$menuRow=mysqli_fetch_array($selResult);
	$menu_arr[$i]=array(0,0,0,0,0,'menuName','httpLink','remark');
	$menu_arr[$i][0]=$menuRow[level_1];
	$menu_arr[$i][1]=$menuRow[level_2];
	$menu_arr[$i][2]=$menuRow[level_3];
	$menu_arr[$i][3]=$menuRow[level_4];
	$menu_arr[$i][4]=$menuRow[level_5];
	$menu_arr[$i][5]=$menuRow[$menuName];
	$menu_arr[$i][6]=$menuRow[httpLink];
	$menu_arr[$i][7]=$menuRow[$remark];

	if($menu_arr[$i][1] == 0){	//display level_1
		echo " <H2>{$menu_arr[$i][5]}</H2>";
	}else{
		if($menu_arr[$i][2] == 0){
			if($menu_arr[$i][6]!=''){
				echo "<li><a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\"><u>{$menu_arr[$i][5]}</u></a>";
			}else{
				echo "<li>{$menu_arr[$i][5]}";
			}
			$preLevel2 = $menu_arr[$i][1];
			$middleLineFlag = 1;
			$compartFlag = 1;
		}else{
			if($menu_arr[$i][3] == 0){
				if ( ($menu_arr[$i][1] == $preLevel2) && (1 == $middleLineFlag) ){
					echo " -- ";
					unset($middleLineFlag);
				}
				if( 1 == $compartFlag ){
					unset($compartFlag);
				}else{
					echo " | ";
				}
				if($menu_arr[$i][6]!=''){
					echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\"><u>{$menu_arr[$i][5]}</u></a>";
				}else{
					echo "{$menu_arr[$i][5]}";
				}
				$preLevel3 = $menu_arr[$i][2];
				$arrowFlag = 1;
				$spaceFlag = 1;
			}else{
				if($menu_arr[$i][4] == 0){
					if ( ($menu_arr[$i][2] == $preLevel3) && (1==$arrowFlag) ) {
						echo " -> ";
						unset($arrowFlag);
					}
					if( 1 == $spaceFlag ){
						unset($spaceFlag);
					}else{
						echo "&nbsp;&nbsp;";
					}
					if($menu_arr[$i][6]!=''){
						echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\"><u>{$menu_arr[$i][5]}</u></a>";
					}else{
						echo "{$menu_arr[$i][5]}";
					}
				}else{
					echo "&nbsp;&nbsp;";
					if($menu_arr[$i][6]!=''){
						echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\"><u>{$menu_arr[$i][5]}</u></a>";
					}else{
						echo "{$menu_arr[$i][5]}";
					}
				}//end 4
			}//end 3
		}//end 2
	}//end 1

}
?>
</li></div><!-- END SITE MAP -->
<?php
adjust_content_tail();
?>
</body>
</html>