<?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>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<?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']);

$querySql = "";
if($_SESSION['rightLevel'] == "0")
{
	$querySql = "select * from AdminUser,GroupRights where AFlag = '1' and AGroupId = GId order by ACreateTime,GRightLevel";
}
elseif($_SESSION['rightLevel'] == "1")
{
	$querySql = "select AId,AName,AAccount,AFlag,GName from AdminUser,GroupRights where AFlag = '1' and AGroupId = GId And AGroupId = ".$_SESSION['groupId']." order by AId";
}
if($querySql != "")
{
	$db->query($querySql);
}

?>
<SCRIPT language="JavaScript">
function validateForm(objThisUi) 
{
	return true;  
}
</SCRIPT>
<body>
<form name="FileForm" method="post" action="MultiFileUpload.php" id="FileForm"
 onSubmit="return validateForm(this);">
<table border="0" cellspacing="0" cellspadding="0" width="100%">
<tr>
<td align="left" colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td align="left" colspan="2">
<span class="t14b"><b>選擇誰的檔案資料及輸入備註資料</b></span>
</td>
</tr>
<tr>
<td align="left" colspan="2">
<table border="3" cellspacing="2" cellspadding="2" width="100%">
<tr>
<td align="left" width="20%">
<span class="t12">誰的檔案資料</span>
</td>
<td align="left" width="80%">
<?php
if($querySql != "")
{
$i = 0;
while($myrow = $db->fetch_array())
{
	$i = $i + 1;
?>
<input type="radio" value="<?php echo $myrow['AId'];?>" <?php if($i == 1) echo "checked"; ?> name="AId">
<span class="t12"><?php echo $myrow['AName'];?></span>
<?php
	if($i%6 == 0)
	{
		echo "<br>";
	}
}
$db->close_db();
}
else
{
?>
<span class="t12"><?php echo $_SESSION['username'];?></span>
<?php	
}
?>
</td>
</tr>
<tr>
<td align="left" width="30%">
<span class="t12">備註</span>
</td>
<td align="left" width="70%">
<input type="text" name="CMemo" id="CMemo" size="70" maxlength="70" style="font-size: 12.0pt;font-family: 微軟正黑體;"/>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="btnSub" id="btnSub" value="選擇檔案上傳" class="t12" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
