<!--{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">
      <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-100">
          <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">
        <div class="layui-form-label">状态：</div>
        <div class="layui-input-inline input-100">
          <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>
            <option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>待审核</option>
          </select>
        </div>
      </div>
    </div>
  </div>
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
  
    
    <div class="oe_tbl_tool clearfix">
      <div class="select btn fl">
        <input type="checkbox" name="allid[]" lay-skin="primary" title="全选/反选" lay-filter="selectAll">
      </div>
      <div class="btn fl" f="handle-array" data-form="myform">
        <i class="layui-icon layui-icon-delete"></i>
        <span>删除</span>
      </div>
      <div class="add btn fl">
        <i class="layui-icon layui-icon-add-1"></i>
        <span><a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></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="8%">ID</th>
          <th width="20%">文章</th>
          <th width="10%">评论会员</th>
          <th width="10%">评论时间</th>
          <th>评论内容</th>
          <th width="6%">状态</th>
          <th width="12%">操作</th>
        </tr> 
      </thead>
      
      <!--{if empty($comment)}-->
      <tr>
        <td colspan="7" class="text_center">没有符合条件的信息</td>
      </tr>
      <!--{else}-->
      <!--{foreach $comment as $volist}-->
      <tr>
        <td class="check">
          <input type="checkbox" name="id[]" lay-skin="primary" value="<!--{$volist.commid}-->" />
          <!--{$volist.commid}-->
        </td>
        <td><a href="<!--{$urlpath}-->index.php?c=article&a=detail&id=<!--{$volist.articleid}-->" target="_blank"><!--{$volist.title}--></a></td>
        <td>
          <!--{if $volist.userid > 0}-->
          <!--{$volist.username}-->
          <!--{else}-->
          --
          <!--{/if}-->
        </td>
        <td><!--{$volist.addtime|date_format:"%Y-%m-%d %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">
          <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>
<!--{/if}-->


<!--{if $a == "add"}-->
<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="addform">
        添加保存
        <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="saveadd" />
  <div class="layui-card">
    <div class="layui-card-header">添加评论</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%"><font color="red">*</font>评论文章：</th>
          <td width="85%">
            <input type="text" name="articleid" id="articleid" class="layui-input input-150" placeholder="填写文章ID" /> 
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>评论会员：</th>
          <td>
            <input type="text" name="userid" id="userid" class="layui-input input-150" placeholder="填写会员uid" /> 
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>评论内容：</th>
          <td><textarea name="content" id="content" class="layui-textarea" style="width:60%;height:160px;"></textarea></td>
        </tr>
        <tr>
          <th><font color="red">*</font>审核状态：</th>
          <td>
            <div class="input-150">
            <select name="flag" id="flag">
              <option value="">=请选择=</option>
              <option value="1" selected>通过</option>
              <option value="2">未通过</option>
              <option value="0">待审核</option>
            </select>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="addform">
      添加保存
      <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(addform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
                if ($("#articleid").val().length  == 0) {
                    layer.msg("请填写评论文章");
                    return false;
                }
                if ($("#userid").val().length  == 0) {
                    layer.msg("请填写评价会员");
                    return false;
                }
                if ($("#content").val().length  == 0) {
                    layer.msg("请填写评价内容");
                    return false;
                }
                if ($("#flag").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}-->

<!--{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}-->" />
  <input type="hidden" name="articleid" id="articleid" value="<!--{$comment.articleid}-->" />
  <div class="layui-card">
    <div class="layui-card-header">编辑评论</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%"><font color="red"></font>评论文章：</th>
          <td width="85%">
            <!--{$comment.title}-->
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>评论会员：</th>
          <td>
            <input type="text" name="userid" id="userid" class="layui-input input-150" placeholder="填写会员uid" value="<!--{$comment.userid}-->" /> 
            <!--{$comment.username}-->
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>评论内容：</th>
          <td><textarea name="content" id="content" class="layui-textarea" style="width:60%;height:160px;"><!--{$comment.content}--></textarea></td>
        </tr>
        <tr>
          <th><font color="red">*</font>审核状态：</th>
          <td>
            <div class="input-150">
            <select name="flag" id="flag">
              <option value="">=请选择=</option>
              <option value="1"<!--{if $comment.flag == '1'}--> selected<!--{/if}-->>通过</option>
              <option value="2"<!--{if $comment.flag == '2'}--> selected<!--{/if}-->>未通过</option>
              <option value="0"<!--{if $comment.flag == '0'}--> selected<!--{/if}-->>待审核</option>
            </select>
            </div>
          </td>
        </tr>
        <tr>
          <th>评论时间：</th>
          <td><!--{$comment.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></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 ($("#userid").val().length  == 0) {
                    layer.msg("请填写评价会员");
                    return false;
                }
                if ($("#content").val().length  == 0) {
                    layer.msg("请填写评价内容");
                    return false;
                }
                if ($("#flag").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>