<?php /*a:3:{s:100:"/home/u833649990/domains/beyondtravel.tours/public_html/app/app/admin/view/system/system_config.html";i:1763702586;s:93:"/home/u833649990/domains/beyondtravel.tours/public_html/app/app/admin/view/public/header.html";i:1763702586;s:93:"/home/u833649990/domains/beyondtravel.tours/public_html/app/app/admin/view/public/footer.html";i:1763702586;}*/ ?>
<!doctype html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>后台登录-<?php echo htmlentities($system_name); ?></title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/xadmin.css">
    <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
    <!-- <link rel="stylesheet" href="./css/theme5.css"> -->
    <script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js?date=<?php echo date('Ymd'); ?>"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="/static/admin/js/html5.min.js"></script>
    <script src="/static/admin/js/respond.min.js"></script>
    <![endif]-->
</head>

<style>
    .layui-form-item .layui-form-label {
        width: 100px;
    }
</style>
<body>
<div class="x-nav">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form">
            <input type="hidden" name="id" value="1">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>APP名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="config[app_name]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['app_name']) && ($info['app_name'] !== '')?$info['app_name']:'')); ?>">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>默认语言
                </label>
                <div class="layui-input-inline">
                    <select name="config[default_lange]" id="">
                        <option <?php echo $info['default_lange']=="arab" ? 'selected' : ''; ?> value="arab">اللغة العربية</option>
                        <option <?php echo $info['default_lange']=="italien" ? 'selected' : ''; ?> value="italien">Italien</option>
                        <option <?php echo $info['default_lange']=="français" ? 'selected' : ''; ?> value="français">Français</option>
                        <option <?php echo $info['default_lange']=="español" ? 'selected' : ''; ?> value="español">Español</option>
                        <option <?php echo $info['default_lange']=="português" ? 'selected' : ''; ?>  value="português">Português</option>
                        <option <?php echo $info['default_lange']=="ru" ? 'selected' : ''; ?> value="ru">Русский</option>
                        <option <?php echo $info['default_lange']=="en" ? 'selected' : ''; ?> value="en">English</option>
                        <option <?php echo $info['default_lange']=="vi" ? 'selected' : ''; ?> value="vi">Tiếng Việt</option>
                        <option <?php echo $info['default_lange']=="zh" ? 'selected' : ''; ?> value="zh">中文</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">Logo</label>
                <div class="layui-input-inline" id="uploadControl">
                    <div class="layui-upload-drag <?php if(!(empty($info['logo']) || (($info['logo'] instanceof \think\Collection || $info['logo'] instanceof \think\Paginator ) && $info['logo']->isEmpty()))): ?>layui-hide<?php endif; ?>">
                        <i class="layui-icon" style="font-size: 30px"></i>
                        <p>点击上传，或将文件拖拽到此处</p>
                    </div>
                    <div class="<?php if(empty($info['logo']) || (($info['logo'] instanceof \think\Collection || $info['logo'] instanceof \think\Paginator ) && $info['logo']->isEmpty())): ?>layui-hide<?php endif; ?>" id="uploadView">
                        <img src="<?php echo htmlentities((isset($info['logo']) && ($info['logo'] !== '')?$info['logo']:'')); ?>" alt="上传成功后渲染" style="max-width: 200px" width="100%">
                    </div>
                    <input type="hidden" name="config[logo]" value="<?php echo htmlentities((isset($info['logo']) && ($info['logo'] !== '')?$info['logo']:'')); ?>">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>开盘时间
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="config[open_time]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['open_time']) && ($info['open_time'] !== '')?$info['open_time']:'')); ?>" readonly id="open_time">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>闭盘时间
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="config[close_time]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['close_time']) && ($info['close_time'] !== '')?$info['close_time']:'')); ?>" readonly id="close_time">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>提现-开始时间
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="config[with_open_time]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['with_open_time']) && ($info['with_open_time'] !== '')?$info['with_open_time']:'')); ?>" readonly id="with_open_time">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>提现-结束时间
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="config[with_close_time]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['with_close_time']) && ($info['with_close_time'] !== '')?$info['with_close_time']:'')); ?>" readonly id="with_close_time">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    时间以服务器时区为准 (<?php echo htmlentities((isset($timezone) && ($timezone !== '')?$timezone:'Asia/Shanghai')); ?>, <?php echo htmlentities((isset($timezone_offset) && ($timezone_offset !== '')?$timezone_offset:'UTC+8')); ?>)
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>注册奖励
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[register_reward]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['register_reward']) && ($info['register_reward'] !== '')?$info['register_reward']:'')); ?>">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>返佣倍数
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[back_comm_multiple]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['back_comm_multiple']) && ($info['back_comm_multiple'] !== '')?$info['back_comm_multiple']:'1')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>设置卡单或者连单用户才会生效
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>一级返佣比例
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[comm_reward_0]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['comm_reward_0']) && ($info['comm_reward_0'] !== '')?$info['comm_reward_0']:'0')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>佣金*返佣比例
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>二级返佣比例
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[comm_reward_1]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['comm_reward_1']) && ($info['comm_reward_1'] !== '')?$info['comm_reward_1']:'0')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>佣金*返佣比例
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>三级返佣比例
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[comm_reward_2]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['comm_reward_2']) && ($info['comm_reward_2'] !== '')?$info['comm_reward_2']:'0')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>佣金*返佣比例
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>四级返佣比例
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[comm_reward_3]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['comm_reward_3']) && ($info['comm_reward_3'] !== '')?$info['comm_reward_3']:'0')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>佣金*返佣比例
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>五级返佣比例
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="config[comm_reward_4]" lay-verify="required" autocomplete="off"
                           class="layui-input" value="<?php echo htmlentities((isset($info['comm_reward_4']) && ($info['comm_reward_4'] !== '')?$info['comm_reward_4']:'0')); ?>">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>佣金*返佣比例
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                </label>
                <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    layui.use(['form', 'laydate', 'upload'], function () {
        var form = layui.form,
            date = layui.laydate;
        var upload = layui.upload;
        date.render({
            elem: '#open_time', //指定元素
            type: 'time',
        });
        date.render({
            elem: '#close_time', //指定元素
            type: 'time',
        });
        date.render({
            elem: '#with_open_time', //指定元素
            type: 'time',
        });
        date.render({
            elem: '#with_close_time', //指定元素
            type: 'time',
        });

        //拖拽上传
        upload.render({
            elem: '#uploadControl'
            , url: '<?php echo url("admin/Index/upload"); ?>' //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
            , accept: 'images' //允许上传的文件类型
            , field: 'file'//设定文件域的字段名
            , done: function (res) {
                //上传完毕
                if (res.status == '200') {
                    tipAction(1, res.msg);
                    $('.layui-upload-drag').addClass('layui-hide');
                    layui.$('#uploadView').removeClass('layui-hide').find('img').attr('src', res.data.file);
                    $('#uploadView').next().val(res.data.file);
                } else {
                    tipAction(2, res.msg);
                }
            }
            , error: function () {
                tipAction(2, '系统繁忙');
            }
        });

        //监听提交
        form.on('submit(add)', function (data) {
            //发异步，把数据提交给php
            $.ajax({
                url: '<?php echo url("admin/System/configSubmit"); ?>',
                type: 'post',
                data: data.field,
                dataType: 'json',
                success: function (res) {
                    if (res.status == '200') {
                        tipAction(1, res.msg);
                    } else {
                        tipAction(2, res.msg);
                    }
                },
                error: function () {
                    tipAction(2, '系统繁忙,请重试');
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
<script type="application/javascript">
    /**
     * 统一接口返回提示弹窗
     * type 1-成功 2-失败
     * info 提示信息
     * */
    function tipAction(type, info) {
        layer.msg(info, {icon: type, time: 1500})
    }

    //图片放大
    function showBig(obj) {
        let img_src = $(obj).attr('src');
        layer.open({
            type: 1,
            area: ['70%', 'auto'],
            shadeClose: true,
            title: false,
            closeBtn: false,
            content: `<div style=""><img src="${img_src}" alt="" width="100%"></div>`
        });
    }
</script>

