<?
	include('check_member.php');
	$mId = $_SESSION['mId'];
	require_once('link.php');
	mysql_select_db($database,$connect);

	$query = "SELECT * FROM `Member` WHERE `mId` ='$mId'";
	mysql_query('SET NAMES utf8');
	$result = mysql_query($query,$connect);
	$row = mysql_fetch_object($result);
?>
<!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/bg4.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 {
	color: #FFFFFF;
}
.style2 {
	font-size: 16px;
	font-weight: bold;
}
--></style>

</head>
<script  language="JavaScript">
function check()
{
	if (document.forms[0].password.value == "")
	{
		alert('請輸入密碼');
		return false;
	}
	else if (document.forms[0].checkpass.value == "")
	{
		alert('請輸入確認密碼');
		return false;
	}
	else if (document.forms[0].checkpass.value != document.forms[0].password.value)
	{
		alert('密碼和確認密碼不相同，請清除再輸入一次');
		return false;
	}
	else return true;
}
</script>
<body leftmargin=0 topmargin=0 bgproperties="fixed" rightmargin=0  bottommargin=0 marginwidth=0 marginheight=0>
<div align = "right">
</div>
<center>
<form action = "modmember_act.php" name = "addband" method = "post" onSubmit="return check()" class = "style1">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p><a href = "member_link.php" class="style2">會員功能列表</a> </p>
  <table border="0"  cellpadding="1" cellspacing="0" align="center" class="style1">
		<tr bgcolor="#2B1A0E">
		  <td colspan = "4"><div align = "center"><strong>會員資料修改</strong>-<? echo $row->mId;?><br>
	      (沒有要修改的選項請保持原資料不要更動)</div></td>
	  </tr><tr><td colspan = "2" height = "1"></td>
		<tr>
		  <td width="86" bgcolor="#413009"><div align = "center">輸入密碼</div></td><td width="0"></td>
		  <td width="199" bgcolor="#413009"><div align = "left"><input type="password" size="30" name="pass" value = "<? echo $row->password;?>"></div></td>
		</tr><tr><td colspan = "2" height = "1"></td>
		<tr>
		  <td bgcolor="#6D5C19"><div align = "center">確認密碼</div></td><td width="0"></td>
		  <td bgcolor="#6D5C19"><div align = "left"><input type="password" size="30" name="checkpass" value = "<? echo $row->password;?>"></div></td>
		</tr><tr><td colspan = "2" height = "1"></td>
		<tr>
		  <td bgcolor="#958E41"><div align = "center">E-mail</div></td><td width="0"></td>
		  <td bgcolor="#958E41"><div align = "left"><input type = "text" name = "email" size = "30" value = "<? echo $row->email;?>"></div></td>
		</tr><tr><td colspan = "2" height = "1"></td>
		<tr>
		  <td bgcolor="#C2C178"><div align = "center">生日</div></td><td width="0"></td>
			<td bgcolor="#C2C178"><div align = "left"><input type = "text" name = "birthday" size = "30" value = "<? echo $row->birthday;?>">
		</div></td>
		</tr><tr><td colspan = "2" height = "1"></td>
		<tr>
		  <td bgcolor="#988300"><div align = "center">性別</div></td><td width="0"></td>
			<td bgcolor="#988300"><div align = "left">
		  <?
				if($row->gender=="female"){
				echo "<input type = 'radio' name = 'gender' value = 'female' checked>女";
				echo "<input type = 'radio' name = 'gender' value = 'male'>男";
				}else{
				echo "<input type = 'radio' name = 'gender' value = 'male' checked>男";
				echo "<input type = 'radio' name = 'gender' value = 'female' >女";
				}
			?></div></td>
		</tr><tr><td colspan = "2" height = "1"></td>
	</table>
	<p>
	  <input type = "hidden" name = "mId" value = <? echo $mId;?>>
	  <input type = "submit" name = "submit" value = "修改">
</p>
	<p>&nbsp;    </p>
</form>
</center>
</body>
</html>
