<!--{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><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">会员ID：</div>
        <div class="layui-input-inline">
          <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 type="text" name="susername" id="susername" class="layui-input" value="<!--{$susername}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">分&#12288;类：</div>
        <div class="layui-input-inline">
          <!--{hook mod="var" item="guestbookcat" name="scatid" type="select" text="不限" value=$scatid}-->
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">标&#12288;题：</div>
        <div class="layui-input-inline">
          <input type="text" name="stitle" id="stitle" class="layui-input" value="<!--{$stitle}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">内&#12288;容：</div>
        <div class="layui-input-inline">
          <input type="text" name="scont" id="scont" class="layui-input" value="<!--{$scont}-->" />
        </div>
      </div>
      
      <div class="layui-inline">
        <div class="layui-form-label">状&#12288;态：</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>
          </select>
        </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>
  <!--//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="7%">ID</th>
          <th width="20%">留言会员</th>
          <th width="20%">标题</th>
          <th width="9%">时间</th>
          <th>留言内容</th>
          <th width="6%">状态</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <!--{if empty($guestbook)}-->
      <tr>
        <td class="text_center" colspan="8">没有符合条件的信息！</td>
      </tr>
      <!--{else}-->
      <!--{foreach $guestbook as $volist}-->
      <tr>
        <td class="check text_center" valign="top">
          <input type="checkbox" name="id[]"  lay-skin="primary" value="<!--{$volist.bookid}-->" />
        </td>
        <td class="check text_center" valign="top">
          <!--{$volist.bookid}-->
        </td>
        
        <td valign="top" class="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>
          
          <!--{if $volist.gender=='1'}-->
          <i class="iconfont icon-nan" title="男"></i>
          <!--{else}-->
          <i class="iconfont icon-nv" title="女"></i>
          <!--{/if}-->
          <!--{$volist.username}-->
          
          <br />
          uid:<!--{$volist.userid}-->/<!--{hook mod="var" item="gender" type="text" value=$volist.gender}-->/<!--{$volist.age}-->岁/<!--{area type="text" value=$volist.dist2}-->
        </td>
        
        <td valign="top">
          <!--{if !empty($volist.title)}-->
          <!--{$volist.title}-->
          <!--{else}-->
          --
          <!--{/if}-->
        </td>
        <td class="text_center" valign="top">
          <!--{$volist.addtime|date_format:"%Y-%m-%d"}--><br />
          <!--{$volist.addtime|date_format:"%H:%M:%S"}-->
        </td>
        <td valign="top"><!--{$volist.content|filterhtml:45}-->...</td>
        <td class="text_center" valign="top">
          <!--{if $volist.flag == '1'}-->
          <font color="green">已处理</font>
          <!--{else}-->
          <font color="red">待处理</font>
          <!--{/if}-->
        </td>
        <td class="text_center" valign="top">
         <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.bookid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-normal layui-btn-xs"> 编辑</a>
          <a href="javascript:;" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.bookid}-->&<!--{$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(){
    //预载图片 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">
      <!--{if $guestbook.flag == '0'}-->
      <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>
      <!--{/if}-->
      <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 width="15%">留言会员：<span class="f_red"></span></th>
          <td width="35%">
          <img src="<!--{$guestbook.headimg}-->" width="20px" height="20px" f="viewimg" /> <!--{$guestbook.username}--><br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uid:<!--{$guestbook.userid}-->/<!--{hook mod="var" item="gender" type="text" value=$guestbook.gender}-->/<!--{$guestbook.age}-->岁/<!--{area type="text" value=$guestbook.dist1}--> <!--{area type="text" value=$guestbook.dist2}-->
          </td>
          <th width="15%">留言标题：</th>
          <td width="35%">
            <!--{if !empty($guestbook.title)}-->
            <!--{$guestbook.title}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>留言分类：<span class="f_red"></span> </th>
          <td>
            <!--{if $guestbook.catid > 0}-->
            <!--{hook mod="var" item="guestbookcat" type="text" value=$guestbook.catid}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
            <th>留言时间：<span class="f_red"></span> </th>
          <td><!--{$guestbook.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
        </tr>
        <tr>
          <th>留言图片：<span class="f_red"></span> </th>
          <td>
            <!--{if !empty($guestbook.img1)}-->
            <img src="<!--{$guestbook.img1}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
            <!--{if !empty($guestbook.img2)}-->
            <img src="<!--{$guestbook.img2}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
            <!--{if !empty($guestbook.img3)}-->
            <img src="<!--{$guestbook.img3}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
            <!--{if !empty($guestbook.img4)}-->
            <img src="<!--{$guestbook.img4}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
            <!--{if !empty($guestbook.img5)}-->
            <img src="<!--{$guestbook.img5}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
            <!--{if !empty($guestbook.img6)}-->
            <img src="<!--{$guestbook.img6}-->" width="20px" height="20px" f="viewimg" />
            <!--{/if}-->
          </td>
          <th>联系邮箱：<span class="f_red"></span> </th>
          <td>
            <!--{if !empty($guestbook.email)}-->
            <!--{$guestbook.email}-->
            <!--{else}-->
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>留言内容：</th>
          <td colspan="3">
            <!--{if !empty($guestbook.content)}-->
            <!--{$guestbook.content|nl2br}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <td colspan="4"><b>处理回复</b></td>
        </tr>
        <!--{if $guestbook.flag == '1'}-->
        <tr>
          <th>处理状态：<span class="f_red"></span> </th>
          <td colspan="3">
            <!--{if $guestbook.flag == '1'}-->
            <font color="green">已处理</font>
            <!--{else}-->
            <font color="red">待处理</font>
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>回复内容：<span class="f_red"></span> </th>
          <td colspan="3">
            <!--{$guestbook.reply|nl2br}-->
          </td>
        </tr>
        <tr>
          <th>回复时间：<span class="f_red"></span> </th>
          <td colspan="3">
            <!--{if $guestbook.replytime > 0}-->
            <!--{$guestbook.replytime|date_format:"%Y-%m-%d %H:%M:%S"}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <!--{else}-->
        <tr>
          <th><font color="red">*</font>处理状态：</th>
          <td colspan="3">
            <div class="layui-inline input-150">
            <select name="flag" id="flag">
              <option value="">=请选择=</option>
              <option value="1"<!--{if $guestbook.flag == '1'}--> selected<!--{/if}-->>已处理</option>
              <option value="0"<!--{if $guestbook.flag == '0'}--> selected<!--{/if}-->>待处理</option>
            </select>
            </div>
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>回复内容：</th>
          <td colspan="3">
            <textarea name="reply" id="reply" class="layui-textarea" style="width:50%;height:80px;"><!--{$guestbook.reply}--></textarea>
            <span class="text_tip_inline">（回复内容将以站内消息提醒会员）</span>
          </td>
        </tr>
        <!--{/if}-->
      </table>
    </div>
  </div>
  </form>
  
  <!--{if $guestbook.flag == '0'}-->
  <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>
  <!--{/if}-->
  
</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 ($("#reply").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>