<!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>
<meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />

<title>问卷评论</title>
<!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_head')}-->
</head>
<body>
<!--{include file="<!--{$cptplpath}-->lang_all.tpl"}-->
<!--{if $a eq "run"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：模块管理<span>&gt;&gt;</span>调查征集<span>&gt;&gt;</span>问卷评论</p></div>
  <div class="main-cont">

    <h3 class="title">
	  问卷评论
	</h3>

	<div class="search-area ">
	  <form method="post" id="search_form" action="<!--{$cpfile}-->?c=<!--{$c}-->" />
	  <div class="item">
		问卷：<input type="text" id="stopicname" name="stopicname" class="input-150" value="<!--{$stopicname}-->" />&nbsp;
		评论：<input type="text" id="scontent" name="scontent" class="input-150" value="<!--{$scontent}-->" />&nbsp;
		审核：
		<select name="sflag" id="sflag">
		<option value=""></option>
		<option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>待审核</option>
		<option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>已审核</option>
		</select>
		&nbsp;&nbsp;<input type="submit" class="button_s" value="搜 索" />
	  </div>
	  </form>
	</div>
	<form action="<!--{$cpfile}-->?c=<!--{$c}-->" method="post" name="myform" id="myform" style="margin:0">
	<input type='hidden' name='a' id='a'>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
		<th width="8%"><div class="th-gap">选择</div></th>
		<th width="20%"><div class="th-gap">问卷</div></th>
		<th width="10%"><div class="th-gap">评论人</div></th>
		<th width="14%"><div class="th-gap">评论时间</div></th>
		<th width="20%"><div class="th-gap">评论内容</div></th>
		<th width="6%"><div class="th-gap">审核</div></th>
		<th width="8%"><div class="th-gap">回复</div></th>
		<th><div class="th-gap">操作</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <!--{if empty($quecomment)}-->
	  <tr>
	    <td colspan="8" align="center">没有找到符合条件的信息</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $quecomment as $volist}-->
	  <tr onMouseOver="overColor(this)" onMouseOut="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<!--{$volist.commentid}-->" onClick="checkItem(this, 'chkAll')"><!--{$volist.commentid}--></td>
		<td><!--{$volist.topicname}--></td>
		<td align="center"><!--{$volist.user}--></td>
		<td align="center"><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td><!--{$volist.content|filterhtml:35}-->...</td>
		<td align="center">
		<!--{if $volist.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$volist.commentid}-->" value="flagopen" />
			<img id="flag<!--{$volist.commentid}-->" src="<!--{$urlpath}-->tpl/static/images/no.gif" onClick="javascript:fetch_ajax('flag','<!--{$volist.commentid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.commentid}-->" value="flagclose" />
			<img id="flag<!--{$volist.commentid}-->" src="<!--{$urlpath}-->tpl/static/images/yes.gif" onClick="javascript:fetch_ajax('flag','<!--{$volist.commentid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
        </td>
		<td align="center">
		  <!--{if $volist.isreply == '1'}-->
		  <font color="green">已回复</font>
		  <!--{else}-->
		  <font color="gray">待回复</font>
		  <!--{/if}-->
		</td>
		<td align="center">
		  <a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=edit&id=<!--{$volist.commentid}-->&<!--{$comeurl}-->">审核/回复</a>&nbsp;&nbsp;
		  <a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=del&id[]=<!--{$volist.commentid}-->&<!--{$comeurl}-->" onClick="{if(confirm('确定要删除吗？')){return true;} return false;}">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onClick="checkAll(this, 'id[]')" value="checkbox"></td>
		<td class="hback" colspan="7">
		<input class="button" name="btn_del" type="button" value="删 除" onClick="{if(confirm('确定要删除吗？')){$('#a').val('del');$('#myform').submit();return true;}return false;}" class="button">
		
		&nbsp;&nbsp;共[ <b><!--{$total}--></b> ]条记录</td>
	  </tr>
	  
	  <!--{/if}-->
	</table>
	</form>
  </div>
</div>
<!--{/if}-->

<!--{if $a eq "edit"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：模块管理<span>&gt;&gt;</span>调查征集<span>&gt;&gt;</span>编辑问卷评论</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="<!--{$cpfile}-->?c=<!--{$c}-->&<!--{$comeurl}-->" class="btn-general"><span>返回列表</span></a>编辑问卷评论</h3>
    <form name="myform" id="myform" method="post" action="<!--{$cpfile}-->?c=<!--{$c}-->&<!--{$comeurl}-->" />
    <input type="hidden" name="a" value="saveedit" />
	<input type="hidden" name="id" value="<!--{$id}-->" />
	<table cellpadding='1' cellspacing='1' class='tab'>
	  <tr>
		<td class='hback_c3' colspan="2"><b>评论信息</b></td>
	  </tr>
	  <tr>
	    <td class='hback_1'>问卷：</td>
		<td class='hback'><!--{$quecomment.topicname}--></td>
	  </tr>
	  <tr>
		<td class='hback_1' width="15%">评论人 <span class="f_red">*</span></td>
		<td class='hback' width="85%"><input type="text" name="user" id="user" class="input-txt" value="<!--{$quecomment.user}-->" /> <span id='dorders' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>评论内容 <span class="f_red">*</span></td>
		<td class='hback'>
		  <textarea name="content" id="content" style="width:60%;height:100px;overflow:auto;"><!--{$quecomment.content}--></textarea>
		  <span id='dcontent' class='f_red'></span>
		</td>
	  </tr>
	  <tr>
		<td class='hback_c3' colspan="2"><b>审核/回复处理</b></td>
	  </tr>
	  <tr>
		<td class='hback_1'>审核状态 <span class="f_red"></span></td>
		<td class='hback'>
		 <select name="flag" id="flag">
		 <option value=""></option>
		 <option value="0"<!--{if $quecomment.flag == "0"}--> selected<!--{/if}-->>待审核</option>
		 <option value="1"<!--{if $quecomment.flag == "1"}--> selected<!--{/if}-->>已审核</option>
		 </select>
		（审核通过的评论才能显示在网页上）
		</td>
	  </tr>
	  <tr>
		<td class='hback_1'>回复内容 <span class="f_red"></span></td>
		<td class='hback'>
		  <textarea name="reply" id="reply" style="width:60%;height:100px;overflow:auto;"><!--{$quecomment.reply}--></textarea>
		  <span id='dreply' class='f_red'></span>
		</td>
	  </tr>
	  <tr>
		<td class='hback_1'>回复时间 <span class="f_red"></span></td>
		<td class='hback'>
		  <input type="text" name="replytime" id="replytime" class="input-150" readonly="only" value="<!--{if $words.replytime > 0}--><!--{$quecomment.replytime|date_format:"%Y-%m-%d %H:%M:%S"}--><!--{/if}-->" />
		  <span id='dreplytime' class='f_red'></span>
		  <script>
			laydate({
				elem: "#replytime",
				format: "YYYY-MM-DD hh:mm:ss",
				istime: true,
				choose: function(datas){}
			});
		  </script>
		</td>
	  </tr>
	  <tr>
		<td class='hback_none'></td>
		<td class='hback_none'><input type="button" f="submitform" data-form="myform" name="btn_save" class="button" value="编辑保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>

<script type="text/javascript">
$(function(){
	//提交保存
	$("[f='submitform']").bind("click", function(){
		$_form = $(this).attr("data-form");
		$_input = "";
		
		$_input = "user";
		if ($("#"+$_input).val().length == 0) {
			dmsg("评论人不能为空", $_input);
			return false;
		}

		$_input = "content";
		if ($("#"+$_input).val().length == 0) {
			dmsg("评论内容不能为空", $_input);
			return false;
		}

		$("#"+$_form).submit();

	});
});
</script>
<!--{/if}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_footer')}-->

</body>
</html>