<?	
	include('check_member.php');
	$mId = $_SESSION['mId'];
	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/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()
{
	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>
<div align = "right">
</div>
<center>
<form action = "delete_share2.php" method = "post" onSubmit = "return check()">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p><a href = "member_link.php" class="style2">會員功能列表</a> </p>
  <table width="385" border="0" align="center" cellpadding="1" cellspacing="0" class="style1">
	<?	
	mysql_select_db($database,$connect);
	$query = "SELECT * FROM `Share` WHERE `mId` = '$mId'";
	mysql_query('SET NAMES utf8');

	$result = mysql_query($query,$connect);
	$num = mysql_num_rows($result);?>

	<tr bgcolor="#2B1A0E" >
		<td colspan = "13"><div align="center"><strong>音樂列表</strong>-<? echo "共".$num."首<br>";?></div></td>
	</tr>
	<tr>
		<td width="43" height="21" bgcolor="#413009"><div align="center">選擇</div></td><td width="0"></td>
		<td width="48" height="21" bgcolor="#413009"><div align="center">帳號</div></td><td width="0"></td>
		<td width="48" height="21" bgcolor="#413009"><div align="center">樂團</div></td><td width="0"></td>
		<td width="48" height="21" bgcolor="#413009"><div align="center">曲名</div></td><td width="0" bgcolor="#413009"></td>
		<td width="180" height="21" bgcolor="#413009"><div align="center">上傳時間</div></td>
	</tr>
	<?
	for($i=0;$i<=$num;$i++)
	{
		$row[$i] = mysql_fetch_array($result);
	}	
	if (!isset($index))
	{
		$index=0;
	}
	if (isset($page)&&$page>0&&$page<($num+10)/10)
	{
		$index=($page)*10-10;
	}
	$tmp=$index+10;
	$tmp2=$index+10;
	if ($num<$tmp)
	{
		$tmp=$num;
	}
	for (;$index<$tmp;$index++)
	{?>

	<tr bgcolor="#6D5C19">
		<td height="21"><div align="center"><input type = "checkbox" name = "choice[<? $i;?>]" value = "<? echo $row1->seq;?>"></div></td><td></td>
		<td height="21"><div align="center"><? echo $row1->mId;?></div></td><td></td>
		<td height="21"><div align="center"><? echo $row1->band;?></div></td><td></td>
		<td height="21"><div align="center"><? echo $row1->song;?></div></td><td></td>
		<td height="21"><div align="center"><? echo $row1->sDateTime;?></div>	</tr><tr><td colspan = "13"></td></tr><input type="hidden" name=mId value="<? echo $mId?>">
<?    }echo "<input type = 'submit' value = '刪除'>";?>
</table><br>
</form>
<table width="288"  border="0" cellpadding="1" cellspacing="0" class="style1">
	<tr><td><div align="center">目前在第 <? echo $tmp2/10;?> 頁
	共 <? if($num%10!=0) {echo (int)($num/10)+1;} elseif($num==0) {echo 1;} else {echo (int)($num/10);}?> 頁</div></td></tr>
	<tr><td><div align="center"><form action="member_share.php" method="post">
	到第
	<input  name="page" type="text" size="2" maxlength="3" style="BORDER: 1px solid; IME-MODE: disabled">
	頁
	<input type="submit" value="送出" style="color: #FFFFFF; border:1px solid #999999;background-color: #505050;padding-left:2;padding-top:2;padding-right:2">
	</form></div></td></tr>
</table>
</center>
</body>
</html>