<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>评论管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/template/js/admin.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">评论管理</a></li>		
		</ul>
	</div>
	<div class="main">
		<div class="search">
			<form action="?" method="get" name="search">
			<input type="hidden" name="file" value="<?php echo $file;?>"> 
			<input type="hidden" name="action" value="<?php echo $action;?>">
			<input type="hidden" name="contentid" value="<?php echo $contentid;?>">
				<fieldset>
					<legend>搜索评论</legend>
						关键字：
						<input type="text" name="k" size="35" value="<?php echo $k?htmlspecialchars(stripslashes($k)):'';?>" />
						<input type="submit" class="button" value="开始查找" />
				</fieldset>
			</form>
		</div>
		<table cellspacing="0" class="datalist" id="list">
		<tr>
			<th width="40" class="firstcol">反选</th>
			<th width="110">发布者</th>
			<th width="170">发布IP</th>
			<th width="1000">内容</th>
			<th width="70">状态</th>
			<th width="70">支持</th>
			<th width="70">反对</th>
			<th width="140">评论时间</th>
			<th width="70">原文</th>
		</tr>
		<form action="" method="post" name="myform">
		<input type="hidden" name="do_submit" value="1" />
		<input type="hidden" name="cururl" value="<?php echo getcururl();?>" />
		<?php if($result){foreach($result as $val){?>
		<tr>
			<td width="40" align="center">
			<input type="checkbox" name="id[]" value="<?php echo $val['id'];?>" class="checkbox" />
		  </td>
		  	<td width="110" align="center"><?php echo $val['username'];?></td>
			<td width="170" align="center"><?php echo $val['ip'];?></td>
			<td width="1000" align="left"><?php echo strip_tags($val['content']);?></td>
			<td width="70" align="center"><?php echo $val['status']?'通过':'<font color="#ff0000">待审</font>';?></td>
			<td width="70" align="center"><font color="#FF0000"><b><?php echo $val['support'];?></b></font></td>
			<td width="70" align="center"><font color="#33CC00"><b><?php echo $val['against'];?></b></font></td>
			<td width="140" align="center"><?php echo date('Y-m-d',$val['addtime']);?></td>
			<td width="70" align="center"><a href="show.php?id=<?php echo $val['contentid'];?>" target="_blank">查看</a></td>
		</tr>
		<?php }?>
		<tr>
			<td width="40" align="center">
		  <input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
			<td colspan="8" align="left">			
			<input type="button" value="审 核" class="button" name="do_pass" class="dosubmit" onclick="this.form.action='?file=<?php echo $file;?>&action=comment_pass';this.form.submit();" />
			&nbsp;&nbsp;
			<input type="button" value="待 审" class="button" name="do_unpass" class="dosubmit" onclick="this.form.action='?file=<?php echo $file;?>&action=comment_unpass';this.form.submit();" />
			&nbsp;&nbsp;
			<input type="button" value="删 除" class="button" name="do_delete" class="dosubmit" onclick="if(confirm('确定进行删除操作吗？')){this.form.action='?file=<?php echo $file;?>&action=comment_delete';this.form.submit();}" />
			</td>
		</tr>
		</form>
		<?php }else{?>
		<tr><td colspan="9"> 还没有任何评论...</td></tr>	
		<?php }?>
		<tr>
			<td colspan="9"><?php echo $pages;?></td>
		</tr>
		</table>
	</div>
</div>
</body>
</html>