<link href="<?php echo base_url(); ?>public/h5/css/bootstrap.min14ed.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>public/h5/css/font-awesome.min93e3.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>public/h5/css/animate.min.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>public/h5/css/style.min862f.css" rel="stylesheet">
<style>
    .c1 {
        color: #8c8c8c;
    }

    .c2 {
        color: #c9302c;
    }

    .c3 {
        color: #00ff1f;
    }

    .unshow {
        display: none;
    }
</style>
<div class="container-fluid" style="background-color: #f3f3f4;">
    <div class="row">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>配置后台/邮件配置</h5>
            </div>
        </div>
    </div>
    <div class="tab-content">
        <div id="tab-1" class="tab-pane active">
            <div class="panel-body">
                <form method="post" class="form-horizontal" id="emailFrom" enctype="multipart/form-data" action="#">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title" style="border-top: 0;">
                            <h3 style="font-weight: bold">邮箱填写弹出配置</h3>
                        </div>
                        <div class="ibox-content" style="padding:25px 0;">
                            <div class="form-group ">
                                <label class="col-sm-2 control-label m-b">开关:</label>
                                <div class="col-sm-4 input-group">
                                    <label class="checkbox-inline">
                                        <input type="radio" name="switch" <?php if($switch==0) echo "checked";?> value="0"> 关闭
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="radio" name="switch" <?php if($switch==1) echo "checked";?> value="1"> 开启
                                    </label>
                                </div>
                            </div>
                            <div class="form-group ">
                                <label class="col-sm-2 control-label m-b">弹出关卡数（按所填数字的倍数弹出）:</label>
                                <div class="col-sm-2">
                                    <input type="number" class="form-control" name="popCustomsRate" value="<?php echo $popCustomsRate;?>">
                                </div>
                            </div>
                            <div class="form-group ">
                                <label class="col-sm-2 control-label m-b">最多可弹出次数:</label>
                                <div class="col-sm-2">
                                    <input type="number" class="form-control" name="maxPopTimes" value="<?php echo $maxPopTimes;?>">
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-sm-2 control-label m-b"></label>
                                <div class="col-sm-4">
                                    <button class="btn btn-primary" id="submitBtn" type="button">提交</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="<?php echo base_url(); ?>public/h5/js/jquery.min.js"></script>
    <script src="<?php echo base_url(); ?>public/h5/js/bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>public/h5/js/content.min.js"></script>
    <script>
        $('#submitBtn').click(function () {
            var datas = $('#emailFrom').serializeArray();
            $.ajax({
                url: 'Email/emailPopConfigUpdate',
                type: 'POST',
                data: datas,
                dataType: 'json',
                success: function (data) {
                    alert(data.msg);
                    // if(data.code==1){
                    window.location.reload();
                    // }
                },
                error: function (data) {
                    alert(data.msg);
                }
            });
        });

    </script>