<!--{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 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">地&#12288;区：</div>
        <div class="layui-input-inline input-120">
          <!--{assign var="distlist" value=vo_list("mod={area} where={v.parentid='0'} orderby={v.orders ASC}")}-->
          <select name="sarea1" id="sarea1" lay-filter="area" data-depth="1" data-name="sarea" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sarea1 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
        </div>
        <div class="layui-input-inline input-120" id="json_sarea2">
          <!--{if $sarea1 > 0}-->
          <!--{assign var="distlist2" value=vo_list("mod={area} where={v.parentid='<!--{$sarea1}-->'}")}-->
          <select name="sarea2" id="sarea2" lay-filter="area" data-depth="2" data-name="sarea" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist2 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sarea2 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sarea2" id="sarea2" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
        <div class="layui-input-inline input-120" id="json_sarea3">
          <!--{if $sarea2 > 0}-->
          <!--{assign var="distlist3" value=vo_list("mod={area} where={v.parentid='<!--{$sarea2}-->'}")}-->
          <select name="sarea3" id="sarea3" lay-filter="area" data-depth="3" data-name="sarea" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist3 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sarea3 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sarea3" id="sarea3" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
        <div class="layui-input-inline input-120" id="json_sarea4">
          <!--{if $sarea3 > 0}-->
          <!--{assign var="distlist4" value=vo_list("mod={area} where={v.parentid='<!--{$sarea3}-->'}")}-->
          <select name="sarea4" id="sarea4" lay-filter="area" data-depth="4" data-name="sarea" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist4 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sarea4 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sarea4" id="sarea4" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
      </div>
      <br />
    
      <div class="layui-inline">
        <div class="layui-form-label">分&#12288;类：</div>
        <div class="layui-input-inline">
          <!--{hook mod='var' item='partycat' name='scatid' type='select' text='不限' value=$scatid}-->
        </div>
      </div>
      <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">
        <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>
      <br />
      <div class="layui-form-item">
        <div class="layui-form-label">状&#12288;态：</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>
          <span f="but_search_cat" data-val="4" data-input="sflag"<!--{if $sflag == '4'}--> class="current"<!--{/if}-->>待审核</span>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-form-label">报&#12288;名：</div>
        <div class="label_box">
          <input type="hidden" name="ssignflag" id="ssignflag" value="<!--{$ssignflag}-->" />
          <span f="but_search_cat" data-val="0" data-input="ssignflag"<!--{if $ssignflag == '0'}--> class="current"<!--{/if}-->>不限</span>
          <span f="but_search_cat" data-val="1" data-input="ssignflag"<!--{if $ssignflag == '1'}--> class="current"<!--{/if}-->>报名中</span>
          <span f="but_search_cat" data-val="2" data-input="ssignflag"<!--{if $ssignflag == '2'}--> class="current"<!--{/if}-->>报名结束</span>
        </div>
      </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" f="handle-array" data-form="myform">
          <i class="layui-icon layui-icon-delete"></i>
          <span>删除</span>
        </div>
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add" class="btn add fl">
          <i class="layui-icon layui-icon-add-1"></i>
          <span>发布活动</span>
        </a>
      </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="8%">分类</th>
          <th width="4%">封面</th>
          <th>标题</th>
          <th width="12%">活动时间</th>
          <th width="12%">截止报名</th>
          <th width="6%">状态</th>
          <th width="4%">推荐</th>
          <th width="8%">报名</th>
          <th width="9%">添加时间</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <!--{if empty($party)}-->
      <tr>
        <td class="text_center" colspan="12">没有符合条件的信息！</td>
      </tr>
      <!--{else}-->
      <!--{foreach $party as $volist}-->
      <tr>
        <td class="check text_center">
          <input type="checkbox" name="id[]" lay-skin="primary" value="<!--{$volist.partyid}-->" />
        </td>
        <td class="text_center">
          <!--{$volist.partyid}-->
        </td>
        <td valign="top" class="text_center">
          <!--{hook mod="var" item="partycat" type="text" value=$volist.catid}-->
        </td>
        <td valign="top" class="text_center">
          <!--{if !empty($volist.thumbimg)}-->
          <img src="<!--{$volist.thumbimg}-->" width="20px" height="20px" data-img="<!--{$volist.drawimg}-->" f="viewimg" />
          <!--{else}-->
          --
          <!--{/if}-->
        </td>
        <td class="text_center" valign="top">
          <a href="<!--{$urlpath}-->index.php?c=party&a=detail&id=<!--{$volist.partyid}-->" target="_blank"><!--{$volist.title}--></a>
        </td>
        <td class="text_center" valign="top">
          <!--{if $volist.starttime > 0}-->
          <!--{$volist.starttime|date_format:"%Y-%m-%d %H:%M"}-->
          <!--{else}--><font color="red">待设置</font>
          <!--{/if}--><br />
          <!--{$volist.endtime|date_format:"%Y-%m-%d %H:%M"}-->
        </td>
        <td class="text_center" valign="top">
          <!--{if $volist.endbmtime > $time}-->
          <font color="green"><!--{$volist.endbmtime|date_format:"%Y/%m/%d %H:%M"}--></font>
          <!--{else}-->
          <font color="red"><!--{$volist.endbmtime|date_format:"%Y/%m/%d %H:%M"}--></font>
          <!--{/if}-->
        </td>
        <td class="text_center" valign="top">
          <!--{if $volist.flag == '1'}-->
          <font color="green">已通过</font>
          <!--{elseif $volist.flag == '2'}-->
          <font color="red">未通过</font>
          <!--{elseif $volist.flag == '3'}-->
          <font color="blue">已结束</font>
          <!--{else}-->
          <font color="gray">待审核</font>
          <!--{/if}-->
        </td>
        <td class="text_center" valign="top">
          <input type="checkbox" name="elite" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.partyid}-->" data-type="elite"<!--{if $volist.elite == '1'}--> checked<!--{/if}--> />
        </td>
        <td valign="top"  class="text_center">
          <a href="<!--{$oefile}-->&c=partybm&spartyid=<!--{$volist.partyid}-->">
          男：<!--{$volist.bmmans}--><br />
          女：<!--{$volist.bmladys}-->
          </a>
        </td>
        <td class="text_center" valign="top">
          <!--{$volist.addtime|date_format:"%Y-%m-%d"}--><br />
          <!--{$volist.addtime|date_format:"%H:%M:%S"}-->
        </td>
        <td class="text_center">
          <div class="oe_manager_btn">
            <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$volist.partyid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-sm oe_mbtn_1">管理</a>
            <i class="oe_tab_line"></i>
            <div class="layui-nav">
              <div class="layui-nav-item">
                <a href="javascript:;">更多<span class="layui-nav-more"></span></a>
                <dl class="layui-nav-child layui-anim layui-anim-upbit">
                  <dd><a href="<!--{$oefile}-->&c=partybm&spartyid=<!--{$volist.partyid}-->">查看报名</a></dd>
                  <dd><a href="javascript:;" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.partyid}-->&<!--{$comeurl}-->">删除活动</a></dd>
                </dl>
              </div>
            </div>
          </div>
          
         </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(){

    });
});
</script>
<!--{/if}-->

<!--{if $a == 'sendmsg'}-->
<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">
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius">
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$party.partyid}-->&<!--{$comeurl}-->">&lt;&lt;返回上一页</a>
      </span>
    </div> 
  </div>
  
  <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%">活动标题：</th>
          <td><!--{$party.title}--></td>
        </tr>
        <tr>
          <th>活动开始时间：</th>
          <td>
            <!--{if $party.starttime > 0}-->
            <!--{$party.starttime|date_format:"%Y-%m-%d %H:%M:%S"}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>活动结束时间：</th>
          <td>
            <!--{if $party.endtime > 0}-->
            <!--{$party.endtime|date_format:"%Y-%m-%d %H:%M:%S"}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>活动地址：</th>
          <td>
            <!--{area type="text" value=$party.area1}--> 
            <!--{area type="text" value=$party.area2}--> 
            <!--{area type="text" value=$party.area3}--> 
            <!--{$party.address}-->
          </td>
        </tr>
        <tr>
          <th>已成功报名会员：</th>
          <td>
            男会员：<!--{$party.bm_suc_1}--> 人<br />
            女会员：<!--{$party.bm_suc_2}--> 人
          </td>
        </tr>
      </table>
    </div>
    <!--//body End -->
    
    <div class="layui-card-header">
      站内通知内容 
      <em>（群发对象：已经成功报名该活动的会员）</em>
    </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="title" id="title" class="layui-input" style="width:40%" />
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font> 消息内容：</th>
          <td>
            <textarea name="remark" id="remark" class="layui-textarea" style="width:40%;height:80px;"></textarea>
          </td>
        </tr>
      </table>
    </div>
    <!--//body End -->
    
    
  </div>
  
  <div class="oe_kong"></div>
  <div class="oe_tbl_form_btn current">
    <button class="layui-btn" id="but_sendmsg" lay-submit lay-filter="sendform">
      确定群发
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
    
    <span id="tips_submit"></span>
  </div>
  
</div>

<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(sendform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
                $title = $("#title").val();
                if ($title.length == 0) {
                    layer.msg("请填写消息标题");
                    return false;
                }
                
                $remark = $("#remark").val();
                if ($remark.length == 0) {
                    layer.msg("请填写消息内容");
                    return false;
                }
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                
                $.ajax({
                    type: "POST",
                    url: "<!--{$oefile}-->&c=<!--{$c}-->",
                    cache: false,
                    data: {
                        a:"savesendmsg", id:"<!--{$party.partyid}-->", 
                        title:$title, remark:$remark, r:get_rndnum(8)
                    },
                    dataType: "json",
                    success: function(data) {
                        $json = eval(data);
                        $response = $json.response;
                        $result = $json.result;
                        
                        $("#"+$obj_id).removeClass("forbid_submit");
                        $("#"+$obj_id).find("span").hide();
                            
                        if ($response == '1') {
                              $("#tips_submit").html("操作成功，已发送 "+$result+" 人");
                        }
                        else {
                            if ($result.length > 0) {
                                $("#tips_submit").html("<font color='red'>"+$result+"</font>");
                            }
                            else {
                                $("#tips_submit").html("<font color='red'>操作失败</font>");
                            }
                        }
                        
                    },
                    error: function() {
                        layer.msg("系统繁忙，请稍后再试！");
                        $("#"+$obj_id).removeClass("forbid_submit");
                        $("#"+$obj_id).find("span").hide();
                    }
                });
               

            }
        });   
    });
    
});
</script>

<!--{/if}-->


<!--{if $a == 'exportbm'}-->
<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">
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius">
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$party.partyid}-->&<!--{$comeurl}-->">&lt;&lt;返回上一页</a>
      </span>
    </div> 
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <input type="hidden" name="a" id="a" value="saveexportbm" />
  <input type="hidden" name="id" id="id" value="<!--{$party.partyid}-->" />
  <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%">活动标题：</th>
          <td><!--{$party.title}--></td>
        </tr>
        <tr>
          <th>活动开始时间：</th>
          <td>
            <!--{if $party.starttime > 0}-->
            <!--{$party.starttime|date_format:"%Y-%m-%d %H:%M:%S"}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>活动结束时间：</th>
          <td>
            <!--{if $party.endtime > 0}-->
            <!--{$party.endtime|date_format:"%Y-%m-%d %H:%M:%S"}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>活动地址：</th>
          <td>
            <!--{area type="text" value=$party.area1}--> 
            <!--{area type="text" value=$party.area2}--> 
            <!--{area type="text" value=$party.area3}--> 
            <!--{$party.address}-->
          </td>
        </tr>
        <tr>
          <th>报名情况：</th>
          <td>
            <a href="<!--{$oefile}-->&c=partybm&spartyid=<!--{$party.partyid}-->">
            男士：<!--{$party.bmmans}--> 人<br />
            女士：<!--{$party.bmladys}--> 人
            </a>
          </td>
        </tr>
      </table>
    </div>
    <!--//body End -->
    
    <div class="layui-card-header">
      筛选条件 
      <em>（将本次活动会员报名名单导出Excel表格）</em>
    </div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%">性&#12288;&#12288;别：</th>
          <td width="85%">
            <div class="input-150">
            <select name="s_gender" id="s_gender">
              <option value="">不限</option>
              <option value="1">男士</option>
              <option value="2">女士</option>
            </select>
            </div>
          </td>
        </tr>
        <tr>
          <th>报名状态：</th>
          <td>
            <div class="input-150">
            <select name="s_status" id="s_status">
              <option value="">不限</option>
              <option value="1">已成功报名</option>
              <option value="2">已取消报名</option>
              <option value="3">待审核报名</option>
              <option value="10">待审&已成功</option>
            </select>
            </div>
          </td>
        </tr>
      </table>
    </div>
    <!--//body End -->
    
    
  </div>
  </form>
  
  <div class="oe_kong"></div>
  <div class="oe_tbl_form_btn current">
    <button class="layui-btn" id="but_submit" lay-submit lay-filter="conform">
      确定导出
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
    
    <span id="tips_submit"></span>
  </div>
  
</div>

<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //确定...
        $form.on('submit(conform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                
                setTimeout(function(){
                    $("#"+$obj_id).removeClass("forbid_submit");
                    if ($("#"+$obj_id).find("span").length > 0) {
                        $("#"+$obj_id).find("span").hide();
                    }
                }, 1000);
                
                $("#myform").submit();
            }
        });   
    });
    
});
</script>

<!--{/if}-->


</body>
</html>