<?php
include("CheckSession.php");
?>
<!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" />
<meta name="description" content="馬戲團" />
<title>馬戲團</title>
</head>
<script language="JavaScript" type="text/JavaScript"> 
<!-- 
function MM_openBrWindow(theURL,winName,win_width,win_height) { 
  var PosX = ((screen.width-win_width)/100)*99; 
  var PosY = ((screen.height-win_height)/100)*99;
  features = "status=no,toolbar=no,scrollbars=yes,resizable=yes,width=750,Height=550,top="+PosY+",left="+PosX;; 
  var newwin = window.open(theURL,winName,features); 
} 
//--> 
</script> 
<?php
require_once("class/DBConfig.php");
require_once("class/DBOperation.php");

$db = new DBOperation();
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$webStatus = checkWebStatus($db,$_SESSION['username']);
if($webStatus == "0")
{
	echo '<script type="text/javascript">';
  echo 'alert("網站已關閉，請洽系統管理員!!!");';
  echo 'top.location.href="Login.php";';
  echo '</script>';
  exit;
}

date_default_timezone_set('Asia/Taipei');
$t=time();

if($_SESSION['rights'] == null || $_SESSION['rights'] == "")
{
	echo '<script type="text/javascript">';
  echo 'alert("請重新登入使用!!!!");';
  echo 'top.location.href="Login.php";';
  echo '</script>';
  exit;
}

$rights = $_SESSION['rights'];
?>
<body>
<form name="form" method="post" action="Main.php">
<table border="0" cellspacing="1" cellspadding="1" width="100%">
<tr>
<td align="left">
<span style="font-size: 12.0pt; font-family: 微軟正黑體;">
歡迎<font color="red"><b><?php echo $_SESSION['username']; ?></b></font>登入
<br><br>
現在時間是 : <br><br>
<b><?php echo date("Y-m-d H:i:s"); ?></b>
</span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
if(str_indexof($rights,"A1") >= 0 && $_SESSION['rightLevel'] != "2")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="GroupRightsIndex.php?page=1" target="content">群組權限管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if(str_indexof($rights,"A2") >= 0 && $_SESSION['rightLevel'] != "2")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="AdminUserIndex.php?page=1" target="content">使用者管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if(str_indexof($rights,"A5") >= 0 && $_SESSION['rightLevel'] != "2")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="CustomerMove.php?page=1" target="content">客戶轉移管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if(str_indexof($rights,"A3") >= 0 && $_SESSION['rightLevel'] != "2")
{
?>
<!--
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="AdminLogIndex.php?page=1" target="content">操作紀錄查詢</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
-->
<?php
}
?>
<?php
if(str_indexof($rights,"A4") >= 0 && $_SESSION['rightLevel'] != "2")
{
?>
<!--
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="SysConfigIndex.php?page=1" target="content">系統參數管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
-->
<?php
}
?>
<?php
if(str_indexof($rights,"B1") >= 0 && $_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="CustomerIndex1.php?page=1" target="content">客戶資料管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if(str_indexof($rights,"B2") >= 0)
{
?>
<!--
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="CustomerQueryInput.php" target="content">客戶資料查詢<br><b>(網頁)</b></a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
-->
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="javascript:void(0);" onclick="MM_openBrWindow('CustomerQueryEasyInputW.php','QueryWin',600,500)">客戶資料查詢<br><b>(新視窗)</b></a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
if(str_indexof($rights,"B3") >= 0 && $_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="javascript:void(0);" onclick="MM_openBrWindow('CustomerBuyTimes.php','QueryWin',600,500)">客戶消費次數查詢<br><b>(新視窗)</b></a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
}
?>
<?php
if(str_indexof($rights,"C1") >= 0 && $_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="FileDataIndex.php?page=1" target="content">檔案資料管理</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="LineSetUp.php" target="content">尋寶設定</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="LoginQuerySetUp.php" target="content">查詢次數限制總設定</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="LoginTimeSetUp.php" target="content">登入時段限制設定</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="FileOpIndex.php" target="content">開寶箱</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<!--
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="CountingTimes.php" target="content">統計客戶消費次數</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
-->
<?php
}
?>
<?php
if($_SESSION['username'] == "admin")
{
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="MailSetInput.php" target="content">系統電子信箱設定</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<?php
}
?>
<tr>
<td align="left">
<span style="font-size: 14.0pt; font-family: 微軟正黑體;"><b>
<a href="ChangePassInput.php" target="content">變更密碼</a>
</b></span>
</td>
</tr>
<tr>
<td align="left">
&nbsp;
</td>
</tr>
<tr>
<td align="left">
<span style="font-size: 15.0pt; font-family: 微軟正黑體;"><b>
<a href="Login.php" target="_top">登出</a>
</b></span>
</td>
</tr>
</table>
</form>
</body>
</html>
