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

<form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
<input type="hidden" name="a" id="a" value="saveexport" />
<div class="layui-fluid oe_fluid" style="padding-top:5px;">
  <div class="layui-card oe_table_edit">
    <div class="layui-card-header">筛选会员</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th>性别：<span class="f_red"></span></th>
          <td colspan="3">
            <div class="tbl_select input-150">
              <select name="sgender" id="sgender">
                <option value="">全部</option>
                <option value="2">女会员</option>
                <option value="1">男会员</option>
              </select>
            </div>
          </td>
        </tr>
        <tr>
          <th>地区：<span class="f_red"></span></th>
          <td colspan="3">
            <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="sdist1" id="sdist1" lay-filter="area" data-depth="1" data-name="sdist" data-text="=请选择=">
                <option value="">=请选择=</option>
                <!--{foreach $distlist as $val}-->
                <option value="<!--{$val.areaid}-->"><!--{$val.areaname}--></option>
                <!--{/foreach}-->
              </select>
            </div>
            <div class="layui-input-inline input-120" id="json_sdist2">
              <select name="sdist2" id="sdist2" lay-filter="area">
                <option value="">=请选择=</option>
              </select>
            </div>
            <div class="layui-input-inline input-120" id="json_sdist3">
              <select name="sdist3" id="sdist3" lay-filter="area">
                <option value="">=请选择=</option>
              </select>
            </div>
          </td>
        </tr>
        <tr>
          <th width="15%">年龄：<span class="f_red"></span></th>
          <td width="35%">
            <div class="tbl_input input-80"><input type="text" name="sage" id="sage" class="layui-input" /></div> - 
            <div class="tbl_input input-80"><input type="text" name="eage" id="eage" class="layui-input" /></div>岁
          </td>
          <th width="15%">身高：<span class="f_red"></span></th>
          <td width="35%">
            <div class="tbl_input input-80"><input type="text" name="sheight" id="sheight" class="layui-input" /></div> - 
            <div class="tbl_input input-80"><input type="text" name="eheight" id="eheight" class="layui-input" /></div>CM
          </td>
        </tr>
        <tr>
          <th>婚况：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">            
              <!--{hook mod="var" item="marry" name="smarry" type="select" text="不限"}-->
            </div>
          </td>
          <th>学历：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="education" name="seducation" type="select" text="不限"}-->
            </div>
          </td>
        </tr>
        <tr>
          <th>职业：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="job" name="sjob" type="select" text="不限"}-->
            </div>
          </td>
          <th>购车：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="car" name="scar" type="select" text="不限"}-->
            </div>
          </td>
        </tr>
        <tr>
          <th>住房：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="house" name="shouse" type="select" text="不限"}-->
            </div>
          </td>
          <th>类型：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="sort" name="ssort" type="select" text="不限"}-->
            </div>
          </td>
        </tr>
        <tr>
          <th>生肖：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="lunar" name="slunar" type="select" text="不限"}-->
            </div>
          </td>
          <th>星座：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="var" item="astro" name="sastro" type="select" text="不限"}-->
            </div>
          </td>
        </tr>

        <tr>
          <th>头像：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <select name="sheadflag" id="sheadflag">
                <option value="">不限</option>
                <option value="1">通过</option>
                <option value="2">待审</option>
                <option value="3">未通过</option>
                <option value="4">无</option>
              </select>
            </div>
          </td>
          <th>独白：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <select name="sintroflag" id="sintroflag">
                <option value="">不限</option>
                <option value="1">通过</option>
                <option value="2">待审</option>
                <option value="3">未通过</option>
                <option value="4">无</option>
              </select>
            </div>
          </td>
        </tr>
        <tr>
          <th>状态：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <select name="sflag" id="sflag">
                <option value="">不限</option>
                <option value="1">通过</option>
                <option value="2">未通过</option>
                <option value="3">待审核</option>
              </select>
            </div>
          </td>
          <th>会员等级：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <!--{hook mod="group" type="select" name="sgroupid" text="不限"}-->
            </div>
          </td>
        </tr>
        <tr>
          <th>身份认证：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <select name="sidrz" id="sidrz">
                <option value="">不限</option>
                <option value="1">已认证</option>
                <option value="2">未认证</option>
              </select>
            </div>
          </td>
          <th>手机认证：<span class="f_red"></span></th>
          <td>
            <div class="tbl_select input-150">
              <select name="smobilerz" id="smobilerz">
                <option value="">不限</option>
                <option value="1">已认证</option>
                <option value="2">未认证</option>
              </select>
            </div>
          </td>
        </tr>
        <!--//0.02.15 -->
        <tr>
          <th><span class="f_red"></span></th>
          <td colspan="3">
            <a href="javascript:;" id="btn_count" style="color:blue;">点击查询筛选结果</a>
            &nbsp;&nbsp;&nbsp;<span id="tips_count"></span>
          </td>
        </tr>        
      </table>
    </div>
    <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>
            <input type="radio" name="extype" value="1" lay-filter="extype" title="会员资料(Excel表)" checked />
            <input type="radio" name="extype" value="2" lay-filter="extype" title="联系方式(Txt文本)" />
          </td>
        </tr>
        
        <tr f="show_2" style="display:none;">
          <th><font color="red">*</font>导出内容：</th>
          <td>
            <div class="layui-inline input-150">
              <select name="excont" id="excont">
                <option value="">请选择</option>
                <option value="mobile" selected>手机号码</option>
                <option value="email">邮箱</option>
              </select>
            </div>
          </td>
        </tr>
        <tr f="show_2" style="display:none;">
          <th><font color="red">*</font>分隔符号：</th>
          <td>
            <div class="layui-inline input-150">
              <select name="split" id="split">
                <option value="">请选择</option>
                <option value="1">逗号</option>
                <option value="2" selected>回车符号</option>
              </select>
            </div>
          </td>
        </tr>
        
        <tr>
          <th><font color="red">*</font>会员排序：</th>
          <td>
            <div class="layui-inline input-150">
              <select name="orderby" id="orderby">
                <option value="">请选择</option>
                <option value="id_asc">id升序</option>
                <option value="id_desc" selected>id降序</option>
                <option value="login_asc">登录升序</option>
                <option value="login_desc">登录降序</option>
              </select>
            </div>
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font> 导出范围：</th>
          <td>
            从第&nbsp;<input type="text" name="start" id="start" value="1" class="layui-input input-100" />&nbsp;条
            &nbsp;到第&nbsp;<input type="text" name="end" id="end" value="500" class="layui-input input-100" />&nbsp;条
            
            <span class="text_tip_inline">(导出条数不要太大，否则将影响导出速度)</span>
          </td>
        </tr>

      </table>
    </div>
  </div>
  
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="exform">
      确定导出
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
</form>
<script type="text/javascript">
$(function(){

    //选择链接....
    $(document).on("click", "[f='but_sel_url']", function(){
        $url = $(this).attr("data-url");
        $("#url").val($url);
    });
    

    layui.use('form', function(){
        $form = layui.form;
        //选择类型...
        $form.on('radio(extype)', function(data){
            $val = data.value;
            if ($val == "2") {
                $("[f='show_2']").show();
            }
            else {
                $("[f='show_2']").hide();
            }
        
        });   
        
        $form.on('submit(exform)', 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();
                }
                $("#myform").submit();
            }
        });   
    });
    
    //统计数量...
    $(document).on("click", "#btn_count", function(){
        $("#tips_count").html("loading...");

        $sgender = $("#sgender").val();
        $sdist1 = $("#sdist1").val();
        $sdist2 = $("#sdist2").val();
        if (typeof($sdist2) == "undefined") {
            $sdist2 = "";
        }
        $sdist3 = $("#sdist3").val();
        if (typeof($sdist3) == "undefined") {
            $sdist3 = "";
        }
        $sdist4 = $("#sdist4").val();
        if (typeof($sdist4) == "undefined") {
            $sdist4 = "";
        }

        $sage = $("#sage").val();
        $eage = $("#eage").val();
        $sheight = $("#sheight").val();
        $eheight = $("#eheight").val();

        $smarry = $("#smarry").val();
        $seducation = $("#seducation").val();
        $sjob = $("#sjob").val();
        $scar = $("#scar").val();
        $shouse = $("#shouse").val();
        $ssort = $("#ssort").val();
        $slunar = $("#slunar").val();
        $sastro = $("#sastro").val();
        
        $sheadflag = $("#sheadflag").val();
        $sintroflag = $("#sintroflag").val();
        $sflag = $("#sflag").val();
        $sgroupid = $("#sgroupid").val();
        
        $sidrz = $("#sidrz").val();
        $smobilerz = $("#smobilerz").val();

        $.ajax({
            type: "POST",
            url: _OECPFILE+"&c=user",
            data: {
                a:"excount", sgender:$sgender, sdist1:$sdist1, sdist2:$sdist2, sdist3:$sdist3, sdist4:$sdist4, 
                sage:$sage, eage:$eage, sheight:$sheight, eheight:$eheight, smarry:$smarry, seducation:$seducation, 
                sjob:$sjob, scar:$scar, shouse:$shouse, ssort:$ssort, slunar:$slunar, sastro:$sastro, 
                sheadflag:$sheadflag, sintroflag:$sintroflag, sflag:$sflag, sgroupid:$sgroupid, 
                sidrz:$sidrz, smobilerz:$smobilerz, 
                sgiveupcat:$sgiveupcat, //0.02.15
                r:get_rndnum(8)
            },
            dataType: "json",
            success: function(data) {
                $json = eval(data);
                $response = $json.response;
                $result = $json.result;
                if ($response == '1') {
                    $("#tips_count").html("<font color='green'>筛选会员："+$result+" 人</font>");
                }
                else {
                   
                }
            },
            error: function() {
            
            }
        });
    });
    
});
</script>

</body>
</html>