<?
	include('check_member.php');
	$bName = $_GET['bName'];
	$aName = $_GET['aName'];
	$mId = $_SESSION['mId'];
	$morenum = $_POST['morenum'];

	
	require_once('link.php');
	mysql_select_db($database,$connect);

	$query = "SELECT * FROM `Album` WHERE `bName` ='$bName' AND `aName` = '$aName'";
	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/bmnum.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;
}
-->
</style>
</head>

<body leftmargin=0 topmargin=0 bgproperties="fixed" rightmargin=0  bottommargin=0 marginwidth=0 marginheight=0>
<div align = "center"><p>&nbsp;</p>
<a href = "a_show.php?bName=<? echo $bName;?>&aName=<? echo $aName;?>"><strong>返回專輯資料</strong></a>
</div>
<center>
<form action="amodify_act.php" name="modify" method="post" enctype = "multipart/form-data">
  <table border = "0" width="350" cellpadding="1" cellspacing="0" align="center" class="style1">
	<tr bgcolor="#291830">
		<td colspan = "4"><div align="center"><? echo $row->bName; ?>-<? echo $row->aName;?><br>
		(不修改的選項 請保持原本的資料不作更動)</div></td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td width="97" bgcolor="#523659"><div align="center" >發行日期</div></td><td width="0"></td>
		<td width="249" bgcolor="#523659"><div align="left">
		  <input type = "text" name = "aDate" value = "<? echo $row->aDate;?>" size="34">
	    </div></td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td bgcolor="#7C5C7A"><div align="center">發行公司</div></td><td width="0"></td>
		<td bgcolor="#7C5C7A"><div align="left">
		  <input type = "text" name = "company" value = "<? echo $row->company;?>" size="34">
		  </div></td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td bgcolor="#8F748D"><div align="center">曲目</div></td><td width="0"></td>
		<td bgcolor="#8F748D">		  <?
				$query3 = "SELECT * FROM `Song` WHERE `bName` = '$bName' AND `aName` = '$aName'";
				$result3 = mysql_query($query3,$connect);
				$num2 = mysql_num_rows($result3);
				for($i = 1;$i<=$num2;$i++)
				{
					$row3 = mysql_fetch_object($result3);?>
          <input type = "text" name="song[<? echo $i;?>]2" value ="<? echo $row3->song;?>" size="34">				  
          <div align="left">					      <br>
	                <?  }
				if($morenum!='')
				{
					for($i=$num2+1;$i<=$num2+$morenum;$i++)
					{?>
                    <input type = "text" name="song[<? echo $i;?>]" size="34">				    
    <br>
					        <? }
				}
			?>
	      </div></td></tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
	<?
		if($row->aPhoto=="")
		{?>
			
				<td bgcolor="#7C5967"><div align="center" >專輯圖片</div></td><td width="0"></td>
				<td bgcolor="#7C5967"><div align="center" ><input type = "hidden" name = "MAX_FILE_SIZE" value = "2048000">
				    <input type="file" name="aPhoto[0]" size = "25"></div></td>
			
		<? }?>	</tr><tr><td colspan = "3" height = "0"></td></tr>
		<tr bgcolor="#836D6C">
		<td colspan = "3"><div align="center">
			<input type = "hidden" name = "bName" value = "<? echo $bName;?>">
			<input type = "hidden" name = "aName" value = "<? echo $aName;?>">
			<input type = "hidden" name = "mId" value = "<? echo $mId;?>">
			<input type = "submit" value = "修改完畢"></div>
	</tr>
</table>

</form>
</center>
</body>
</html>
