<!--{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 class="oe_tool_bar ft" style="display:none;">
      <button class="layui-btn layui-btn-sm search" id="but_submit_search" 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>
  <!--//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">日记：</div>
        <div class="layui-input-inline input-150">
          <input type="text" name="stitle" id="stitle" class="layui-input" value="<!--{$stitle}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">会员UID：</div>
        <div class="layui-input-inline input-100">
          <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-120">
          <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-150">
          <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="<!--{$sflag}-->" />
        <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="2%">选</th>
          <th width="5%">ID</th>
          <th width="20%">所属日记</th>
          <th width="12%">评论会员</th>
          <th width="4%">性别</th>
          <th width="4%">年龄</th>
          <th width="9%">时间</th>
          <th>评论内容</th>
          <th width="5%">状态</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <!--{if empty($diarycomm)}-->
      <tr>
        <td class="text_center" colspan="10">没有符合条件的信息！</td>
      </tr>
      <!--{else}-->
      <!--{foreach $diarycomm as $volist}-->
      <tr>
        <td class="check text_center">
          <input type="checkbox" name="id[]" id="id[]" class="selall" lay-skin="primary" value="<!--{$volist.commid}-->" />
        </td>
        <td class="text_center"><!--{$volist.commid}--></td>
        <td class="text_center">
          <a href="<!--{$urlpath}-->index.php?c=diary&a=detail&id=<!--{$volist.commid}-->" target="_blank"><!--{$volist.title}--></a>
        </td>
        <td valign="middle" class="drop">
          <!--{if $volist.cmuid > 0}-->
          <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>
          <a href="<!--{$oefile}-->&c=user&a=view&id=<!--{$volist.cmuid}-->"><!--{$volist.username}--></a>
          <!--{/if}-->
        </td>
        <td class="text_center">
        <!--{if $volist.cmuid > 0}-->
        <!--{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}-->
        <!--{else}-->
          --
        <!--{/if}-->
        </td>
        <td class="text_center">
        <!--{if $volist.cmuid > 0}-->
        <!--{$volist.age}-->
        <!--{else}-->
          --
        <!--{/if}-->
        </td>
        <td class="text_center">
          <!--{$volist.cmtime|date_format:"%Y-%m-%d"}--><br />
          <!--{$volist.cmtime|date_format:"%H:%M:%S"}-->
        </td>
        <td>
        <!--{$volist.cmcont}-->
        </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">
          <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.commid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a>
          <a href="javascript:;" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.commid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
         </td>
      </tr>
      <!--{/foreach}-->
      <!--{/if}-->
    </table>
    </form>
    
    <div class="oe_page_box"><!--{$showpage}--></div>
    
  </div>
</div>
<script type="text/javascript">
$(function(){
    layui.use(['layer', 'element'], 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>
      <a href="<!--{$oefile}-->&c=<!--{$c}-->&id=<!--{$diarycomm.commid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius">返回列表</a>
    </div> 
  </div>
  
  <div class="layui-card">
    <div class="layui-card-header">编辑日记评论</div>
    <div class="layui-card-body">
    	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
        <input type="hidden" name="a" id="a" value="saveedit" />
	      <input type="hidden" name="id" id="id" value="<!--{$id}-->" />
        <table class="oe_tbl_form layui-form oe_edit_table">
          <tr>
            <th width="15%">评论会员：</th>
            <td width="35%">
            <img src="<!--{$diarycomm.headimg}-->" width="20px" height="20px" f="viewimg" />
            <a href="<!--{$oefile}-->&c=user&a=view&id=<!--{$diarycomm.cmuid}-->"><!--{$diarycomm.username}--></a>
            (uid:<a href="<!--{$urlpath}-->index.php?c=home&a=detail&id=<!--{$diarycomm.cmuid}-->" target="_blank"><!--{$diarycomm.cmuid}--></a>)
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <!--{hook mod="var" item="gender" type="text" value=$diarycomm.gender}-->/<!--{$diarycomm.age}-->岁/<!--{area type="text" value=$diarycomm.dist1}--> <!--{area type="text" value=$diarycomm.dist2}-->
            </td>
            <th width="15%">日记标题：</th>
            <td width="35%">
              <!--{$diarycomm.title}--> 
            </td>
          </tr>
          <tr>
            <th><font color="red">*</font>审核状态：</th>
            <td>
              <div class="tbl_input input-150">
                <select name="flag" id="flag">
                  <option value="">=请选择=</option>
                  <option value="1"<!--{if $diarycomm.flag == '1'}--> selected<!--{/if}-->>通过</option>
                  <option value="2"<!--{if $diarycomm.flag == '2'}--> selected<!--{/if}-->>不通过</option>
                  <option value="0"<!--{if $diarycomm.flag == '0'}--> selected<!--{/if}-->>待审核</option>
                </select>
              </div>
            </td>
            <th>评论时间：<span class="f_red"></span> </th>
            <td><!--{$diarycomm.cmtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
          </tr>
          <tr>
            <th><font color="red">*</font>评论内容：</th>
            <td colspan="3">
              <textarea class="layui-textarea" name="cmcont" id="cmcont" style="width:60%;height:120px;"><!--{$diarycomm.cmcont}--></textarea>
            </td>
          </tr>
        </table>
      </form>
    </div>
    <!--//body End -->
  </div>
  
  <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("请选择审核状态");
                  return false;
              }
              if ($("#cmcont").val().length == 0) {
                  layer.msg("请填写评论内容");
                  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>