<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div class="tableContent2">
				<div class="sitmap">
		           <span class="r"><!--{include file="elements/uuadvad.html"}--></span>互动社区&nbsp;&gt;&nbsp;论坛管理&nbsp;&gt;&nbsp;论坛内容管理&nbsp;&gt;&nbsp;回帖列表
		    	</div>
			<div class="tabcontent">
				<a href="index.php?r=Forum.postlist" class="link">帖子管理</a>
				<a href="index.php?r=SiteSet.forumset" class="link">属性设置</a>
				<a href="index.php?r=Forum.postallreplylist" class="nolink">回复信息审核</a>
				<a href="index.php?r=Forum.accusationlist" class="link">举报信息管理</a>
				<a href="index.php?r=Forum.shortcutreplylist" class="link">快速回复语</a>
				<a href="index.php?r=Forum.postloglist" class="link">日志管理</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
				    <form id="searchForm" name="searchForm" action="index.php" method="get">
					<input type="hidden" name="r" value="Forum.postreplylist">
					<input type="hidden" name="returnParams" value="<!--{$returnParams}-->">
					<input type="hidden" name="status" id="status">
					<input type="hidden" name="post_id" value="<!--{$post_id}-->">
					</form>
					<div class="operation">
						<button type="button" class="but2font" onClick="createReply()">回帖</button>
						<button type="button" class="but2font" onClick="var returnParams = encodeURIComponent('<!--{$returnParams}-->');batchOperate('index.php?r=Forum.deletepostreply&post_id=<!--{$post_id}-->&returnParams='+returnParams,'recordId', 'reply_ids', '删除之后，信息无法恢复，是否确定删除？')">删除</button>	
						<button type="button" class="but4font" onClick="checkStatus(1,'确定审核通过?')">审核通过</button>
						<button type="button" class="but2font" onClick="window.location.href='index.php?<!--{$returnParams}-->'">返回</button>
					</div>
					<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tbl_list">
						<tr class="noline">
							<td width="5%"><input type="checkbox" class="checkall"/></td>
							<td width="50%">回帖内容</td>
							<td width="10%">回帖者</td>
							<td width="20%">回帖时间</td>
							<td width="10%">
								<select onChange="$('#status').val($(this).val());$('#searchForm').submit()">
									<option value=''>状态</option>
									<option value='1' <!--{if $status==1}--> selected <!--{/if}-->>已审</option>
									<option value='2' <!--{if $status==2}--> selected <!--{/if}-->>待审</option>
								</select>
							</td>
						</tr>
						<!--{foreach from=$replyList item=data name=foo}-->
						<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
							<td><input id="record<!--{$smarty.foreach.foo.index+1}-->" type="checkbox" class="checkid" name="recordId" value="<!--{$data.id}-->"/></td>
							<td class="left"><!--{$data.reply_content}--></td>
							<td class="left"><!--{$data.reply_user_pet_name}--></td>
							<td><!--{$data.reply_date|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
							<td>
								<input type="hidden" id="check_status<!--{$smarty.foreach.foo.index+1}-->" value="<!--{$data.status}-->">
								<!--{if $data.status==2}-->
									<font class="link" onclick="alert(1)">待审核</font>
								<!--{elseif $data.status==1}-->
									已审核
								<!--{/if}-->
							</td>
						</tr>
						<!--{foreachelse}-->
						<tr><td colspan="6">没有对应数据</td></tr>
						<!--{/foreach}-->
					</table>
					<div class="operation">
						<button type="button" class="but2font" onClick="createReply()">回帖</button>
						<button type="button" class="but2font" onClick="var returnParams = encodeURIComponent('<!--{$returnParams}-->');batchOperate('index.php?r=Forum.deletepostreply&post_id=<!--{$post_id}-->&returnParams='+returnParams,'recordId', 'reply_ids', '删除之后，信息无法恢复，是否确定删除？')">删除</button>	
						<button type="button" class="but4font" onClick="checkStatus(1,'确定审核通过?')">审核通过</button>
						<button type="button" class="but2font" onClick="window.location.href='index.php?<!--{$returnParams}-->'">返回</button>
					</div>
					<div class="page"><!--{$pager}--></div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
function checkStatus(status,msg){
	var returnParams = encodeURIComponent('<!--{$returnParams}-->');
	var postReplyIds = '';
	var errorFlag = 0;
	$("input[name=recordId]").each(function(index,element){
		if($(element).attr("checked")==true){
			var idName = $(element).attr("id");
			var index = idName.substr(6);
			var checkStatus = $("#check_status"+index).val();
			if(checkStatus==1){
				errorFlag=1;
				return false;
			}
			postReplyIds = postReplyIds+','+$(element).val();
		}
	});
	if(errorFlag==1){
		alert('不能对已审核的帖子重复审核！');
		return false;
	}
	if(postReplyIds!=null&&postReplyIds!=''){
		postReplyIds = postReplyIds.substr(1);
		if(confirm(msg)){
			window.location.href='index.php?r=Forum.checkpostreply&post_id=<!--{$post_id}-->&returnParams='+returnParams+'&status='+status+'&reply_ids='+postReplyIds;
		}
	}else{
		alert('请选择回复');
	}
}	

function showStatusCheck(replyId){
	var returnParams = encodeURIComponent('<!--{$returnParams}-->');
	var str= '<table width="100%"><tr><td height=50 align="center">';
	str += '<button onclick="window.location.href=\'index.php?r=Forum.checkpostreply&post_id=<!--{$post_id}-->&returnParams='+returnParams+'&status=1&reply_id='+replyId+'\'">审核通过</button>&nbsp;&nbsp;';
	str += '<button style="width:auto" onclick="window.location.href=\'index.php?r=Forum.checkpostreply&post_id=<!--{$post_id}-->&returnParams='+returnParams+'&status=9&reply_id='+replyId+'\'">审核不通过</button>&nbsp;&nbsp;';
	str += '</td></tr></table>';
	$.popbox({title:"回帖审核", content:str});
}

function createReply(){
	var returnParams = '<!--{$returnParams}-->';
	var str = '<form action="index.php?r=Forum.postcreatereply" method="post">';
	str += '<input type="hidden" name="post_id" value="<!--{$post_id}-->">';
	str += '<input type="hidden" name="returnParams" value="'+returnParams+'">';
	str += '<table class="tbl_edit" width="100%"><tr>';
	str += '<td class="td_name">回复内容</td>';
	str += '<td class="td_content"><textarea name="reply_content" cols=50 rows=5></textarea></td>';
	str += '</tr><tr>';
	str += '<td class="noborder"></td>';
	str += '<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>';
	str += '</tr></table></form>';
	$.popbox({title:"回帖", content:str});
}
</script>
</body>
</html>