<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>点评管理->商品点评</div>
  <div class="oe_content">
	
	<form id="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  评论会员ID：<input type="text" name="suserid" id="suserid" class="input-120" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />&nbsp;
	  店铺名：<input type="text" name="sshopname" id="sshopname" class="input-150" value="<!--{$sshopname}-->" />&nbsp;
	  内容：<input type="text" name="scontent" id="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" name="btn_search" id="btn_search" class="button_2" value="搜索" />
	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">全选/反选</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="15%">店铺</th>
		<th width="15%">商品</th>
		<th width="10%">评论会员</th>
		<th width="8%">评论时间</th>
		<th width="6%">评分</th>
		<th width="6%">状态</th>
		<th>评论内容</th>
		<th width="10%">操作</th>
	  </tr>
	  <!--{if empty($comment)}-->
	  <tr>
	    <td class="text_center" colspan="10">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $comment as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.commid}-->" /><!--{$volist.commid}--></td>
		<td><!--{$volist.shopname}--></td>
		<td><!--{$volist.goodsname}--></td>
		<td><!--{$volist.username}-->(<!--{$volist.userid}-->)</td>
		<td class="text_center"><!--{$volist.cmtime|date_format:"%Y-%m-%d"}--><br /><!--{$volist.cmtime|date_format:"%H:%M:%S"}--></td>
		<td class="text_center"><!--{$volist.cmscore}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='1'}-->
			<input type="hidden" id="attr_flag<!--{$volist.commid}-->" value="flagclose" />
			<img id="flag<!--{$volist.commid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.commid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.commid}-->" value="flagopen" />
			<img id="flag<!--{$volist.commid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.commid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td><!--{$volist.content|filterhtml:30}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.commid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.commid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->

<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>点评管理->商品点评->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑商品点评</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">所属店铺：<span class="f_red"></span></th>
		<td width="35%"><!--{$comment.shopname}--></td>
		<th width="15%">点评会员：<span class="f_red"></span></th>
		<td width="35%"><!--{$comment.username}-->(<!--{$comment.userid}-->)<span class="oe_trap"></span></td>
	  </tr>
	  <tr>
	    <th>所属商品：<span class="f_red"></span></th>
		<td colspan="3">
		  <!--{$comment.goodsname}-->
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>审核状态：<span class="f_red"></span> </th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1"<!--{if $comment.flag == '1'}--> checked<!--{/if}--> />通过，
		  <input type="radio" name="flag" id="flag" value="0"<!--{if $comment.flag == '0'}--> checked<!--{/if}--> />待审核
		</td>
		<th>评分：<span class="f_red"></span></th>
		<td>
		  <select name="cmscore" id="cmscore">
		  <option value="0"<!--{if $comment.cmscore == '0'}--> selected<!--{/if}-->>0分</option>
		  <option value="1"<!--{if $comment.cmscore == '1'}--> selected<!--{/if}-->>1分</option>
		  <option value="2"<!--{if $comment.cmscore == '2'}--> selected<!--{/if}-->>2分</option>
		  <option value="3"<!--{if $comment.cmscore == '3'}--> selected<!--{/if}-->>3分</option>
		  <option value="4"<!--{if $comment.cmscore == '4'}--> selected<!--{/if}-->>4分</option>
		  <option value="5"<!--{if $comment.cmscore == '5'}--> selected<!--{/if}-->>5分</option>
		  </select>
		  <span class="oe_trap"></span>
		  （评分直接影响商品的总分）
		</td>
	  </tr>
	  <tr>
	    <th>评论：<span class="f_red">*</span> </th>
		<td colspan="3"><textarea name="content" id="content" style="width:60%;height:100px;"><!--{$comment.content}--></textarea></td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){

		if ($("#content").val().length == 0) {
			ToastShow("评论内容不能为空", "content");
			return false;
		}
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>