<?
	$bName = $_GET['bName'];
?>
<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/search.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 = "right">
	<p>&nbsp;</p>
	<p align="center"><strong><a href = "b_show.php?bName=<? echo $bName;?>">樂團資料</a>
    <a href = "band_article_edit.php?bName=<? echo $bName;?>">發表評論</a>
            </strong></p>
</div>
<center>
<?
	require_once('link.php');
	mysql_select_db($database,$connect);
	$query = "SELECT * FROM `Article` WHERE `rcBand1` = '$bName' ORDER BY `arDateTime` DESC";
	mysql_query('SET NAMES utf8');
	$result = mysql_query($query,$connect);
	$num = mysql_num_rows($result);
	for($i=0;$i<=$num;$i++)
	{
		$row[$i] = mysql_fetch_array($result);
	}	
	if (!isset($index))
	{
		$index=0;
	}
	if (isset($page)&&$page>0&&$page<($num+5)/5)
	{
		$index=($page)*5-5;
	}
	$tmp=$index+5;
	$tmp2=$index+5;
	if ($num<$tmp)
	{
		$tmp=$num;
	}
	for (;$index<$tmp;$index++)
	{?>
<table  border = "0" width="300" cellpadding="1" cellspacing="0" align="center" class="style1">
	<tr>
		<td bgcolor="#1F001F"><div align = "center">發表人</div></td><td width="0"></td>
		<td bgcolor="#1F001F"><? echo $row[$index][mId]; ?></td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td bgcolor="#480A27"><div align = "center">發表時間</div></td><td width="0"></td>
		<td bgcolor="#480A27"><? echo $row[$index][arDateTime];?></td>
	</tr><td colspan = "3" height = "1"></td></tr>
		<tr>
		<td bgcolor="#A11E30"><div align = "center">推薦</div></td><td width="0"></td>
		<td bgcolor="#A11E30"><? 
				if($row[$index][bLevel]=='1'||$row[$index][aLevel]=='1')
				{
					echo "正推";
				}
				else
				{
					echo "反推";
				}

		?></td>
		</td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td bgcolor="#D76B40"><div align = "center">標題</div></td><td width="0"></td>
		<td bgcolor="#D76B40"><? echo $row[$index][title];?></td>
	</tr><tr><td colspan = "3" height = "1"></td></tr>
	<tr>
		<td colspan = "3" bgcolor="#FCBD68"><? echo $row[$index][content];?></td>
	</tr>
</table>
 <br>
<? }?>
<table width="288"  border="0" cellpadding="1" cellspacing="0" class="style1">
	<tr><td><div align="center">目前在第 <? echo $tmp2/5;?> 頁
	共 <? if($num%5!=0) {echo (int)($num/5)+1;} elseif($num==0) {echo 1;}  else {echo (int)($num/5);}?> 頁</div></td></tr>
	<tr><td><div align="center"><form action="b_positive.php?bName=<? echo $bName;?>" 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>