<?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");
$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 menuTypeNo = '$OmcTypeNo' AND privilege <= '$myPrivilege' AND privilege >= '0'
					ORDER BY level_1,level_2,level_3,level_4,level_5
					";
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>";
?>

<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>
<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');
	$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){
		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]}\">{$menu_arr[$i][5]}</a>";
			}else{
				echo "<li>{$menu_arr[$i][5]}";
			}
		}else{
			if($menu_arr[$i][3] == 0){
				echo "<br>";
				echo "&nbsp;&nbsp;&nbsp;&nbsp;";
				if($menu_arr[$i][6]!=''){
					echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\">{$menu_arr[$i][5]}</a>";
				}else{
					echo "{$menu_arr[$i][5]}";
				}
			}else{
				if($menu_arr[$i][4] == 0){
					echo "<br>";
					echo "&nbsp;&nbsp;&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;&nbsp;&nbsp;";
					if($menu_arr[$i][6]!=''){
						echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\">{$menu_arr[$i][5]}</a>";
					}else{
						echo "{$menu_arr[$i][5]}";
					}
				}else{
					echo "<br>";
					echo "&nbsp;&nbsp;&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;&nbsp;&nbsp;";
					if($menu_arr[$i][6]!=''){
						echo "<a href=\"{$menu_arr[$i][6]}\" title=\"{$menu_arr[$i][7]}\">{$menu_arr[$i][5]}</a>";
					}else{
						echo "{$menu_arr[$i][5]}";
					}
				}//end 4
			}//end 3
		}//end 2
	}//end 1

}
?>
</li></div><!-- END SITE MAP -->
</html>