<!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">
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/date/datedropper.min.css">
    <script src="<?php echo base_url();?>public/js/date/datedropper.min.js"></script>
    <style type="text/css">
        .thumbnail {
            margin:10px;
        }

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

        .upimg {
            cursor: pointer;
        }
    </style>
    <style>
        .time{
            height: 34px;
            padding: 6px 12px;
            font-size: 14px;
            line-height: 1.42857143;
            color: #555;
            background-color: #fff;
            background-image: none;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

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

</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12 addOrDelControl">
            <aside>
                <header><i class="fa fa-fw fa-file"></i>回归配置</header>
                <form class="form-horizontal J_ajaxForm" role="form" method="post" action="Config/actionRecall" data-callBack="message" id="actionSginInConfig">
                    <?php foreach ($list as $x => $y) { ?>
                        <div class="modal-body"  style="border: 2px solid rgba(0,0,0,.075)">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">天数</label>
                                <div class="col-sm-10">
                                    <div class="col-sm-2">
                                        <input type="text" class="time" name="day[<?php echo $y['day'];?>]" value="<?php echo $y['day'];?>"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">金币</label>
                                <div class="col-sm-10">
                                    <div class="col-sm-3">
                                        <select class="form-control" name="coins[<?php echo $y['day'];?>]" style="display: inline-block;">
                                            <option value="coins01" <?php if($y['reward']['coins']['coins'] == 'coins01'){ echo 'selected';}?> >coins01</option>
                                            <option value="coins02" <?php if($y['reward']['coins']['coins'] == 'coins02'){ echo 'selected';}?> >coins02</option>
                                            <option value="coins03" <?php if($y['reward']['coins']['coins'] == 'coins03'){ echo 'selected';}?> >coins03</option>
                                            <option value="coins04" <?php if($y['reward']['coins']['coins'] == 'coins04'){ echo 'selected';}?> >coins04</option>
                                            <option value="coins05" <?php if($y['reward']['coins']['coins'] == 'coins05'){ echo 'selected';}?> >coins05</option>
                                            <option value="coins06" <?php if($y['reward']['coins']['coins'] == 'coins06'){ echo 'selected';}?> >coins06</option>
                                        </select>
                                    </div>
                                    <label class="col-sm-2 control-label">倍率</label>
                                    <div class="col-sm-3">
                                        <input type="text" class="time" name="bet[<?php echo $y['day'];?>]" value="<?php echo $y['reward']['coins']['bet'];?>" />
                                    </div>
                                    <button type="button" class="btn btn-danger deleteParent" >删除</button>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">体力</label>
                                <div class="col-sm-10">
                                    <div class="col-sm-2">
                                        <input type="text" class="time" value="<?php echo $y['reward']['spins'];?>" name="spins[<?php echo $y['day'];?>]"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                    <div class="modal-footer" id="addDiv">
                        <button type="button" class="btn btn-success" id="addParent">添加</button>
                        <button type="button" class="btn btn-primary J_ajaxSubmitBtn">提交</button>
                    </div>
                </form>
            </aside>
        </div>
    </div>
</div>

</body>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script src="<?php echo base_url();?>public/js/common.js"></script>
<script>
    function message(returnData, $from) {
        window.location.reload();
    }

    $('.addOrDelControl').on("click",'.deleteParent',function(){
        $(this).parent().parent().parent().remove();
    });

    $('#addParent').on("click",function(){
        var str = '';
        str += '<div class="modal-body"  style="border: 2px solid rgba(0,0,0,.075)"><div class="form-group"><label class="col-sm-2 control-label">天数</label><div class="col-sm-10"><div class="col-sm-2"><input type="text" class="time" name="day[]" value=""/></div></div></div>';
        str += '<div class="form-group"><label class="col-sm-2 control-label">金币</label><div class="col-sm-10"><div class="col-sm-3"><select class="form-control" name="coins[]" style="display: inline-block;"><option value="coins01">coins01</option><option value="coins02">coins02</option>';
        str += '<option value="coins03">coins03</option><option value="coins04">coins04</option><option value="coins05">coins05</option><option value="coins06">coins06</option></select></div><label class="col-sm-2 control-label">倍率</label><div class="col-sm-3"><input type="text" class="time" name="bet[]" value="1" />';
        str += '</div><button type="button" class="btn btn-danger deleteParent" >删除</button></div></div><div class="form-group"><label class="col-sm-2 control-label">体力</label><div class="col-sm-10"><div class="col-sm-2"><input type="text" class="time" value="0" name="spins[]"/></div></div></div></div>';
        $("#addDiv").before(str);
    });
</script>
</html>