﻿<?php require('system/login.php');  ?>
<?php require_once('../Connections/BE2.php'); ?>
<?php


$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  $_SESSION['MM_Username'] = NULL;
  unset($_SESSION['login_boss']);

  $logoutGoTo = "../index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
mysql_select_db($database_BE2, $BE2);
$query_Rtb = sprintf("SELECT * FROM ad_menu WHERE ind > 0 AND lv < '%s' and fn='Y' ORDER BY ind ASC",$_SESSION['login_lv']);
$Rtb = mysql_query($query_Rtb, $BE2) or die(mysql_error());
$row_Rtb = mysql_fetch_assoc($Rtb);
$totalRows_Rtb = mysql_num_rows($Rtb);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<link href="style.css" rel="stylesheet" type="text/css" />		
<div id="sidebar"><table border="0" cellpadding="0" cellspacing="0" style="font-size:10px">
  <tr>
    <td>
    			<ul><li><h2><? echo $toptitle ?></h2>
		      <ul>
		        <?php do { ?>
	            <li><a href="main.php?act=<?php echo $row_Rtb['act']; ?>" target="mainFrame"><?php echo $row_Rtb['act_title']; ?></a></li>
		          <?php } while ($row_Rtb = mysql_fetch_assoc($Rtb)); ?>
				 
                  <li><a href="<?php echo $logoutAction ?>" target="_parent">登出</a></li>
       		      </ul>
			    </li></td>
  </tr>
  
</table>
</div>
<?php
mysql_free_result($Rtb);
?>
