<!--<?php
print <<<EOT
-->
<!--
EOT;
require($this->getSegmentFile('manage.nav'));
print <<<EOT
--><script language="JavaScript">
var comment = {
		doCheckDel : function (url) {
			showDialog('confirm', "确定要删除所选评论吗？", 0, function(){
				location.href = url;
			});
		},
		doDeleCheck : function (form) {
			var ifcheck = false;
			for (var i=0;i<form.elements.length-1;i++){
				var e = form.elements[i];
				if(e.type == 'checkbox'){
					if(e.checked){
						ifcheck = true;
						break;
					}
				}
			}
			if(ifcheck) {
				showDialog('confirm', "确定要删除所选评论吗？", 3, function(){
					form.submit();
				});
				return false;
			}else{
				showDialog('error',"请选择要删除的评论！",2)
				return false;
			}
		}
};
</script>
<!--
EOT;
$keyword = ($_viewer->keyword) ? stripslashes($_viewer->keyword) : '';
print <<<EOT
-->
<div id="contentC" class="fl">
<div class="p15">
<h2 class="h1">评论管理</h2>
<div class="admin_table mb10">
	<form action="{$_viewer->baseUrl}&a=run" method="post" />
	<input type="hidden" value="{$_viewer->dianpuinfo->dianpuid}" name="dianpuid" />
	<input type="hidden" value="shangjiaC1" name="v" />
	<table width="100%">
		<tr class="tr1">
			<td class="td2">
				<input name="act_title" type="text" class="input input_wa mr10" value="{$keyword}" />
				<label class="mr10"><input name="type" type="radio" value="1" {$_viewer->type[1]}/>内容</label>
				<label class="mr10"><input name="type" type="radio" value="2"  {$_viewer->type[2]}/>作者</label>
		  		<span class="mr10">
				     <select name="state">
				         <option value="all" {$_viewer->state['all']}>全部</option>
				         <option value="n" {$_viewer->state['n']}>未回复</option>
				         <option value="y" {$_viewer->state['y']}>已回复</option>
				    </select></span>
				<span class="btn2"><span><button type="submit">搜索</button></span></span>
			</td>
		</tr>
	</table>
	</form>
</div>
<h2 class="h1"><span class="mr20">评论列表</span><span class="f12 fn s1">{$_viewer->rightMessage}</span></h2>
<div class="admin_table mb10">
<!--
EOT;
if($_viewer->comments){
print <<<EOT
--><form method="POST" action="{$_viewer->baseUrl}&a=deleteComments" name="FORM" onsubmit="return comment.doDeleCheck(document.FORM)">
	<input type="hidden" name="content" value="{$_viewer->search['content']}" />
	<input type="hidden" name="usename" value="{$_viewer->search['usename']}" />
	<input type="hidden" name="state" value="{$_viewer->search['state']}" />
	<input type="hidden" name="page" value="{$_viewer->search['page']}" />
	<input type="hidden" name="dianpuid" value="{$_viewer->dianpuid}" />
	<input type="hidden" value="shangjiaD1" name="po" />
	<table width="100%">
		<tr class="tr2">
<!--
EOT;
if ($_viewer->commentRight) {print<<<EOT
-->
			<td width="60"><input name="commentid[]" type="checkbox" value="" onclick="DP.CheckAll('commentid[]',this);" /><span OnClick="CheckAll(document.FORM)" style = "cursor:pointer;"> 全选</span></td>
<!--
EOT;
}print<<<EOT
-->
			<td>发布者</td>
			<td>内容</td>
			<td>发布时间</td>
<!--
EOT;
if ($_viewer->commentRight) {print<<<EOT
-->
			<td width="100">操作</td>
<!--
EOT;
}print<<<EOT
-->
		</tr>
<!--
EOT;
foreach($_viewer->comments as $comment){
print <<<EOT
--><tr class="tr1">
<!--
EOT;
if ($_viewer->commentRight) {print<<<EOT
-->			<td class="td2"><input type="checkbox" name="commentid[]" value="{$comment['commentid']}"></td>
<!--
EOT;
}print<<<EOT
-->
			<td class="td2"><a href="u.php?uid={$comment['uid']}" target=_blank>{$comment['username']}</a></td>
			<td class="td2">
			    <a href="{$comment['frontURL']}#x_comment_list" target="_blank" class="mesPop"><span>{$comment['content']}</span>{$comment['shortcontent']}</a>
			<td class="td2">{$comment['postdate']}</td>
<!--
EOT;
if ($_viewer->commentRight) {print<<<EOT
-->
			<td class="td2">
<!--
EOT;
if($_viewer->right['reply']){
if($comment['state']){print <<<EOT
-->
	<span class="help_a">[已回复]</span>
<!--
EOT;
}else{print <<<EOT
-->
    <a href="javascript:;" onClick="DP.get('{$_viewer->baseUrl}&a=ajaxreply&parentid={$comment['commentid']}&rootid={$comment['rootid']}&p=step&objectid={$comment['objectid']}&typeid={$comment['typeid']}&dianpuid={$_viewer->dianpuid}&uid={$comment['uid']}','',this.id)" id="openreply">[回复]</a>
<!--
EOT;
}}print <<<EOT
-->
			<a href="javascript:;" onclick="comment.doCheckDel('{$_viewer->backurl}&a=deleteComment&commentid={$comment['commentid']}&dianpuid={$_viewer->dianpuid}');">[删除]</a>
			</td>
		</tr>
<!--
EOT;
}
}
print <<<EOT
-->
<!--
EOT;
if ($_viewer->commentRight) {print<<<EOT
-->
<tr class="tr2">
			<td width="50"><input name="commentid[]" type="checkbox" value="" onclick="DP.CheckAll('commentid[]',this);" /><span OnClick="CheckAll(document.FORM)" style = "cursor:pointer;"> 全选</span></td>
			<td><span class="bt2"><span><button type="submit">批量删除</button></span></span></td>
			<td colspan="6">&nbsp;</td>
		</tr>
<!--
EOT;
}print<<<EOT
-->
	</table>
</form>
<div class="cc">{$_viewer->pager}</div>
<!--
EOT;
}else{
print <<<EOT
--><div class="p15 tac">啊哦，没有你要的信息！</div>
<!--
EOT;
}
print <<<EOT
--></div>
</div></div>
<!--
EOT;
?>