<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改活动</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/bootstrap/bootstrap.min.css" >
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>public/css/jquery.timepicker.min.css">
    <!-- Select2 -->
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/select2/select2.min.css">

    <style type="text/css">
        .thumbnail {
            margin:10px;
        }

        .lang-name {
            margin-left:42px;
        }

        .upimg {
            cursor: pointer;
        }

    </style>
</head>
<body>
<div id="msg-tip">

</div>
<div class="content_wrapper">
    <div class="container-fluid">
        <aside>
            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data"  id="configForm" action="#" style="margin-top: 20px">
                <input type="hidden" value="<?php echo $id;?>" name="id"/>
                <header><i class="fa fa-fw fa-file"></i>体力加速恢复配置</header>
                <section>
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-sm-12">
                                <button type="button" class="btn btn-success" id="configsubmitBtn">提交</button>
                            </div>
                        </div>
                    </div>
                    <div class="container-fluid">
                        <?php foreach ($speedUp as $key => $vl) { ?>
                            <div class="row" style="border: 1px solid #CCC;margin:10px 5px;padding: 5px 0;">
                                <div class="form-group" >
                                    <label class="col-sm-1 control-label">ID*: </label>
                                    <div class="col-sm-1">
                                        <input type="text" class="form-control" readonly name="config[<?php echo $vl['id'];?>][id]" value="<?php echo $vl['id'];?>">
                                    </div>
                                    <label class="col-sm-1 control-label">加速来源*: </label>
                                    <div class="col-sm-2">
                                        <input type="text" class="form-control" readonly name="config[<?php echo $vl['id'];?>][tips]" value="<?php echo $vl['tips'];?>">
                                    </div>
                                    <label class="col-sm-1 control-label">加速倍率*: </label>
                                    <div class="col-sm-1">
                                        <input type="text" class="form-control"  name="config[<?php echo $vl['id'];?>][bet]" value="<?php echo $vl['bet'];?>">
                                    </div>
                                    <label class="col-sm-1 control-label">加速时长(秒)*: </label>
                                    <div class="col-sm-1">
                                        <input type="text" class="form-control"  name="config[<?php echo $vl['id'];?>][effecteTime]" value="<?php echo $vl['effecteTime'];?>">
                                    </div>
                                    <label class="col-sm-1 control-label">加速次数(每天)*: </label>
                                    <div class="col-sm-1">
                                        <input type="text" class="form-control"  name="config[<?php echo $vl['id'];?>][max]" value="<?php echo $vl['max'];?>">
                                    </div>
                                </div>
                            </div>
                        <?php } ?>
                    </div>
                </section>
            </form>
        </aside>
    </div>
</div>
</body>

<script>
    $(function () {
        $('#configsubmitBtn').click(function () {
            var data = new FormData(document.getElementById("configForm"));
            $.ajax({
                url: rootPath + 'activity/actionConfig',
                type: 'POST',
                data: data,
                dataType: 'json',
                contentType: false, //必须
                processData: false, //必须
                success: function (data) {
                    alert(data.msg);
                    window.location.reload();
                },
                error: function (msg) {
                    alert(data.msg);
                }
            });
        });
    });
</script>
</html>
