<?
	include('check_admin.php');
	require_once('link.php');
	mysql_select_db($database,$connect);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>管理者-刪除會員</title>
<style>
.style1 {font-size: 13px; color: #FFFFFF; }
BODY {
	SCROLLBAR-FACE-COLOR: #D4D0C8;
	SCROLLBAR-HIGHLIGHT-COLOR: #D4D0C8;
	SCROLLBAR-SHADOW-COLOR: #999999;
	SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
	SCROLLBAR-ARROW-COLOR:  #000000;
	SCROLLBAR-TRACK-COLOR: #E3E3E3;
	SCROLLBAR-DARKSHADOW-COLOR: #666666;
	background-color: #000000;
	background-image: url(img/bg6.png);
	background-attachment: fixed;
}
a:link {
	color: white;
	text-decoration: none;
}
a:visited {
	color: white;
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	color: #FFFFFF;
}
.style2 {
	font-size: 16px;
	font-weight: bold;
}
</style>
</head>

<script  language="JavaScript">
function check()
{
	var r=confirm("是否刪除會員資料?");
	if(r==true)
		return true;
	if(r==false)
		return false;
}
</script>

<body leftmargin="0" topmargin="0" bgproperties="fixed" rightmargin="0"  bottommargin="0" marginwidth="0" marginheight="0">
<form action = "delete_member.php" method = "post" name = "search_member">
  <div align="center">
	  <p>&nbsp;</p>
	  <p class="style2"><a href="admin_link.htm">管理者功能列表</a></p>
	  <table width="400" border="0" cellpadding="1" cellspacing="0" class="style1">
		  <tr>
			  <td><input type = "radio" name = "way" value = "all">
			     所有會員列表
			      <input type = "radio" name = "way" value = "one">
			     會員帳號
			      <input type = "text" name = "condition" size = "15">
				  <input type = "submit" value = "查詢"></td>
		  </tr>
	  </table>
  </div>
	</form>
<center>
 <p>
<form action = "d_m_act.php" method = "post" name = "d_m_act" onSubmit = "return check()">
  <table border="0" align="center" cellpadding="1" cellspacing="0" class="style1">
		<?
			switch($way){
				case "one":
				$query1 = "SELECT * FROM `Member` WHERE `mId` = '$condition'";
				$result1 = mysql_query($query1,$connect);
				$num1 = mysql_num_rows($result1);?>
				<tr bgcolor="#200A23" >
				  <td colspan = "13"><div align="center">會員列表-<? echo "共".$num1."人<br>";?></div></td>
				</tr>
				<tr>
				  <td width="45" height="21" bgcolor="#482A5E"><div align="center">選擇</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">帳號</div></td><td width="0"></td>
				  <td width="45" height="21" bgcolor="#482A5E"><div align="center">權限</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">密碼</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">性別</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">生日</div></td><td width="0"></td>
				  <td width="100" height="21" bgcolor="#482A5E"><div align="center">e-mail</div></td>
				</tr>
		<?
				for($i = 1;$i<=$num1;$i++)
				{
					$row1 = mysql_fetch_object($result1);
		?>
		<tr>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><input type = "checkbox" name = "choice[<? $i;?>]" value = "<? echo $row1->mId;?>"></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->mId;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->level;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->password;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->gender;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->birthday;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row1->email;?></div></td>
		</tr><tr><td colspan = "13"></td></tr>
		<?     }
				echo "<input type = 'submit' value = '刪除'>";
				break;
				case "all":
				$query2 = "SELECT * FROM `Member`";
				$result2 = mysql_query($query2,$connect);
				$num2 = mysql_num_rows($result2);?>
				<tr bgcolor="#200A23">
				  <td colspan = "13"><div align="center">會員列表-<? echo "共".$num2."人<br>";?></div></td>
				</tr>
				<tr>
				  <td width="45" height="21"  bgcolor="#482A5E"><div align="center">選擇</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">帳號</div></td><td width="0"></td>
				  <td width="45" height="21" bgcolor="#482A5E"><div align="center">權限</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">密碼</div></td><td width="0"></td>
				  <td width="60" height="21" bgcolor="#482A5E"><div align="center">性別</div></td><td width="0"></td>
				  <td width="45" height="21" bgcolor="#482A5E"><div align="center">生日</div></td><td width="0"></td>
				  <td width="80" height="21" bgcolor="#482A5E"><div align="center">e-mail</div></td>
				</tr>
			<?
				for($i = 1;$i<=$num2;$i++)
				{
					$row2 = mysql_fetch_object($result2);
		?>
		<tr>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><input type = "checkbox" name = "choice[<? $i;?>]" value = "<? echo $row2->mId;?>"></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row2->mId;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row2->level;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row2->password;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row2->gender;?></div></td><td></td>
		  <td height="21" bgcolor="#9C8E9E"><div align="center"><? echo $row2->birthday;?></div></td><td></td>
		  <td height="21"  bgcolor="#9C8E9E"><div align="center"><? echo $row2->email;?></div></td>
		</tr><tr><td colspan = "13"></td></tr>
		<? }  
		echo "<input type = 'submit' value = '刪除'>";
		break; }?>
	</table>
	<!--<input type = "submit" value = "刪除">
	<input type = "reset" value = "全部取消">-->
</form>
</center>
</body>
</html>
