<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->

<!--{if $a == "run"}-->
<div class="layui-fluid oe_fluid">

  <form class="layui-form" id="mysearch" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容模块</a><span lay-separator="">/</span>
      <a href="javascript:;">动态管理</a><span lay-separator="">/</span>
      <a><cite>动态评论</cite></a>
    </div>
  </div>
  <!--//top end -->
  
  <div class="oe_searchbar layui-form">
    <div class="more_search_open"></div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">评论人UID：</div>
        <div class="layui-input-inline input-200">
          <input type="text" name="suserid" id="suserid" class="layui-input" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">评论用户：</div>
        <div class="layui-input-inline input-200">
          <input type="text" name="susername" id="susername" class="layui-input" value="<!--{$susername}-->" />
        </div>
      </div>
      
      <div class="layui-inline">
        <div class="layui-form-label">内容：</div>
        <div class="layui-input-inline input-200">
          <input type="text" name="scont" id="scont" class="layui-input" value="<!--{$scont}-->" />
        </div>
      </div>
      
      <div class="layui-inline">
        <button class="layui-btn layui-btn-sm search" id="but_submit_search2" lay-submit lay-filter="searchform2">
          <i class="layui-icon layui-icon-search"></i>
          搜索
          <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
        </button>
      </div>
      
    </div>
    <div class="layui-form-item">
      <div class="layui-form-label">状态：</div>
      <div class="label_box">
        <input type="hidden" name="sflag" id="sflag" value="0">
        <span f="but_search_cat" data-val="0" data-input="sflag" <!--{if $sflag == '0'}-->class="current"<!--{/if}-->>不限</span>
        <span f="but_search_cat" data-val="1" data-input="sflag" <!--{if $sflag == '1'}-->class="current"<!--{/if}-->>通过</span>
        <span f="but_search_cat" data-val="2" data-input="sflag" <!--{if $sflag == '2'}-->class="current"<!--{/if}-->>未通过</span>
        <span f="but_search_cat" data-val="3" data-input="sflag" <!--{if $sflag == '3'}-->class="current"<!--{/if}-->>待审核</span>
      </div>
    </div>
  </div> 
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
    <div class="oe_tbl_tool clearfix">
      <div class="oe_gnbar clearfix">
        <div class="select btn fl">
          <input type="checkbox" name="allid[]" lay-skin="primary" title="全选" lay-filter="selectAll">
        </div>
        <div class="btn del fl del_line" f="handle-array" data-form="myform">
          <i class="layui-icon layui-icon-delete"></i>
          <span>删除</span>
        </div>
      </div>
      <div class="oe_tongji_bar clearfix current">
        <span><b><!--{$total}--></b> 条记录</span>
      </div>
    </div>
    
    <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
    <input type="hidden" name="a" id="a" value="del" />
    <table class="layui-table">
      <thead>
        <tr>
          <th width="4%">选</th>
          <th width="8%">ID</th>
          <th width="6%">头像</th>
          <th width="10%">用户名</th>
          <th width="5%">性别</th>
          <th width="5%">年龄</th>
          <th width="8%">评论时间</th>
          <th>评论内容</th>
          <th width="6%">状态</th>
          <th width="10%">操作</th>
        </tr> 
      </thead>
      
      <!--{if empty($dynamiccomm)}-->
      <tr>
        <td colspan="10" class="text_center">没有符合条件的信息</td>
      </tr>
      <!--{else}-->
      <!--{foreach $dynamiccomm as $volist}-->
      <tr>
        <td class="check text_center">
          <input type="checkbox" name="id[]" lay-skin="primary" value="<!--{$volist.commid}-->" />
        </td>
        <td class="text_center">
          <!--{$volist.commid}-->
        </td>
        <td class="text_center drop">
          <div class="down">
            <div><img src="<!--{$urlpath}-->tpl/static/images/loading_img.png" data-src="<!--{$volist.headimg_0}-->" width="20px" height="20px" f="zoom_avatar" preload="0" /></div>
            <div class="sub">
              <img src="<!--{$urlpath}-->tpl/static/images/loading_img.png" data-src="<!--{$volist.headimg}-->" f="viewimg" />
            </div>
          </div>
        </td>
        <td class="text_center">
          <a href="<!--{$oefile}-->&c=user&a=view&id=<!--{$volist.userid}-->"><!--{$volist.username}--></a>
        </td>
        <td class="text_center">
          <!--{if $volist.gender=='1'}-->
          <i class="iconfont icon-nan" title="男"></i>
          <!--{else}-->
          <i class="iconfont icon-nv" title="女"></i>
          <!--{/if}-->
          <!--{hook mod="var" item="gender" type="text" value=$volist.gender}-->
        </td>
        <td class="text_center">
          <!--{$volist.age}-->
        </td>
        
        <td class="text_center"
          <!--{$volist.addtime|date_format:"%Y-%m-%d"}--><br />
          <!--{$volist.addtime|date_format:"%H:%M:%S"}-->
        </td>
        <td><!--{$volist.content}--></td>
        <td class="text_center">
          <input type="checkbox" name="flag" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.commid}-->" data-type="flag"<!--{if $volist.flag == '1'}--> checked<!--{/if}--> />
        </td>
        <td class="text_center">
          <div class="td_btn">
            <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.commid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
            <a href="javascript:;" f="handle-one" data-text="确定要删除吗？" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.commid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
          </div>
        </td>
      </tr>
      <!--{/foreach}-->
      <!--{/if}-->
    </table>
    </form>
    
    <div class="oe_page_box"><!--{$showpage}--></div>
    
  </div>
</div>
<script type="text/javascript">
$(function(){
    //预载图片 9.11.25
    preload_img();
});
</script>
<!--{/if}-->

<!--{if $a == "edit"}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容模块</a><span lay-separator="">/</span>
      <a href="javascript:;">动态管理</a><span lay-separator="">/</span>
      <a><cite>编辑评论</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <button class="layui-btn layui-btn-sm layui-btn-radius" id="but_submit_post2" lay-submit lay-filter="editform">
        编辑保存
        <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
      </button>
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius"><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">返回列表</a></span>
    </div> 
  </div>
  
  <form class="layui-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}-->" />
  <div class="layui-card">
    <div class="layui-card-header">编辑评论</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th>动态ID：</th>
          <td>
            <a target="_blank" href="<!--{$urlpath}-->index.php?c=dynamic&a=detail&id=<!--{$dynamiccomm.dyid}-->"><!--{$dynamiccomm.dyid}--></a>
          </td>
          <th>动态内容：</th>
          <td>
            <!--{$dynamiccomm.dynamic_content}-->
          </td>
        </tr>
        <tr>
          <th>评论会员：<span class="f_red"></span></th>
          <td>
          <img src="<!--{$dynamiccomm.headimg}-->" width="30px" height="30px" f="viewimg" />
          uid:<!--{$dynamiccomm.userid}-->/<!--{$dynamiccomm.username}-->/<!--{hook mod="var" item="gender" type="text" value=$dynamiccomm.gender}-->/<!--{$dynamiccomm.age}-->岁/<!--{area type="text" value=$dynamiccomm.dist1}--> <!--{area type="text" value=$dynamiccomm.dist2}-->
          </td>
        </tr>
        <tr>
          <th width="15%"><font color="red">*</font>审核状态： </th>
          <td width="35%">
            <div class="tbl_input input-200">
              <select name="flag" id="flag">
                <option value="">=请选择=</option>
                <option value="1"<!--{if $dynamiccomm.flag == '1'}--> selected<!--{/if}-->>通过</option>
                <option value="2"<!--{if $dynamiccomm.flag == '2'}--> selected<!--{/if}-->>不通过</option>
                <option value="0"<!--{if $dynamiccomm.flag == '0'}--> selected<!--{/if}-->>待审核</option>
              </select>
            </div>
          </td>
          <th width="15%">评论时间：<span class="f_red"></span> </th>
          <td width="35%"><!--{$dynamiccomm.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
        </tr>
        <tr>
          <th><font color="red">*</font>评论内容：</th>
          <td colspan="3"><textarea name="content" id="content" class="layui-textarea" style="width:70%;height:100px;"><!--{$dynamiccomm.content}--></textarea></td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="editform">
      编辑保存
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(editform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
                if ($("#flag").val().length == 0) {
                    layer.msg("请选择审核状态", "flag");
                    return false;
                }
                if ($("#content").val().length == 0) {
                    layer.msg("请填写评论内容", "content");
                    return false;
                }
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //...
                $("#myform").submit();
            }
        });   
    });
    
});
</script>
<!--{/if}-->
</body>
</html>