<?php
	include 'conn/conn.php';
	$id = $_GET['id'];
	$selectsql = "select id,title,content,uptime,author from tb_mess where id = ".$id;
	$rst = mysql_query($selectsql);
	if(mysql_num_rows($rst) == 1){
		$arr = mysql_fetch_row($rst);
?>
<div id="showmess">
	<ul>
		<li style="width: 30px;border-bottom: 1px #bcd1de  solid; border-right: 1px #bcd1de  solid;"><?php echo $arr[0]; ?></li>
		<li style="width:200px; overflow:hidden; border-bottom: 1px #bcd1de  solid; border-right: 1px #bcd1de  solid;"><?php echo $arr[1]; ?></li>
		<li style="width:150px;border-bottom: 1px #bcd1de  solid;"><?php echo $arr[3]; ?></li>
	</ul>
	<ul>
		<li style=" width:70%; height:25px; text-align:left; line-height:25px; border-bottom: 1px #bcd1de  solid;">留言人：<?php echo $arr[4]; ?></li><li style=" width: 30%; height:25px; text-align:right; line-height:25px; border-bottom: 1px #bcd1de  solid;">
<?php
		if($_SESSION['name'] == $arr[4]){
?>
			<a href="index.php?act=mod&id=<?php echo $arr[0]; ?>">修改</a> | <a href="del.php?id=<?php echo $arr[0]; ?>">删除</a>&nbsp;&nbsp;
<?php
		}
?>
		</li>
	</ul>
	<ul>
		<li style=" width:100%; height: 50px; text-indent:30px; text-align:left;"><?php echo $arr[2]; ?></li>
	</ul>
</div>
<p />
<?php
	$selectsql2 = "select id,content,author,uptime from tb_mess where review = ".$arr[0];
	$rst = mysql_query($selectsql2);
	if(mysql_num_rows($rst) == 0 ){
		echo '暂时没有回复';
	}else{
?>
<div id="messreview">
<?php
		while($reviewarr = mysql_fetch_row($rst)){
?>
		<ul>
		<li style="width: 50px;border-bottom: 1px #bcd1de  solid; border-right: 1px #bcd1de  solid;">回复人：</li>
		<li style="width:100px; overflow:hidden; border-bottom: 1px #bcd1de  solid; border-right: 1px #bcd1de  solid;"><?php echo $reviewarr[2]; ?></li>
		<li style=" width:75px; overflow:hidden; border-bottom: 1px #bcd1de  solid;border-right: 1px #bcd1de  solid;">回复时间：</li>
		<li style="width:150px;border-bottom: 1px #bcd1de  solid;"><?php echo $reviewarr[3]; ?></li>
	</ul>
		<ul>
		<li style="width: 100%;border-bottom: 1px #bcd1de  solid; text-align:left; text-indent: 30px; "><?php echo $reviewarr[1]; ?></li>
	</ul>
		<ul>
<?php
		if($_SESSION['name'] == $reviewarr[2] or $_SESSION['name'] == $arr[4]){
?>
			<li style=" width:100%; border-bottom:1px #bcd1de  solid; text-align:right; height:25px; line-height:25px;"><a href="index.php?act=mod&id=<?php echo $reviewarr[0]; ?>">修改</a> | <a href="del.php?id=<?php echo $reviewarr[0]; ?>">删除</a>&nbsp;&nbsp;</li>
<?php
		}
?>
	</ul>
	<?php 
		}
	?>
</div>	
	<?php

	}
	}
?>
<ul>
	<form method="post" action="review_chk.php">
	<li>添加回复：</li>
	<li><textarea name="reviewcont" rows="5" cols="40"></textarea></li>
	<li><input id="id" name="id" type="hidden" value="<?php echo $arr[0]; ?>" /><input id="submit" type="submit" value="回复" /></li>
	</form>
</ul>