<?php /*a:4:{s:75:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\index\dashboard.html";i:1715617489;s:74:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\default.html";i:1715617489;s:71:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\meta.html";i:1715617489;s:73:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\script.html";i:1715617489;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="csrf-token" content="<?php echo token(); ?>">

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="never">
<meta name="renderer" content="webkit">
<title><?php echo $site['title']; ?> - <?php echo lang("Backstage panel"); ?></title>

<link rel="Shortcut Icon" href="<?php echo $site['favicon']; ?>?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>" type="image/x-icon" />

<!-- Font Awesome 5.13.0 字体图标库 -->
<link rel="stylesheet" href="/static/libs/fontawesome-free/css/all.min.css">
<!-- AdminLTE v3.2.0 | Bootstrap v4.6.0 CSS框架 -->
<link rel="stylesheet" href="/static/module/admin/adminlte/css/adminlte.css?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>">
<link rel="stylesheet" href="/static/module/admin/adminlte/css/common.css?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>">

<script type="text/javascript">
    window.Config = <?php echo json_encode($site); ?>;
    window.Lang = <?php echo json_encode($tempLang); ?>;
    window.Tpl = <?php echo json_encode($Tpl); ?>;
</script>

    <style>
        html,body,.wrapper {
            height: 100% !important;
        }
        .content {
            min-height: 100%;
            height: auto;
            padding-bottom: 20px;
            background-color: #f2f3f5;
        }
        .operatePage .card-footer {
            width: 100%;
            position: fixed;
            bottom: 0;
            z-index: 99;
        }
    </style>

    {__STYLE__}

</head>
<body class="sidebar-mini layout-top-nav overlayScrollbars" >

    <?php if(empty($popup)): ?>
    <!-- 子页 -->
    <div class="wrapper">
        <div class="content">
            <div class="container-fluid" style="padding-top: 16px">
                {block:style}
<style>
    .table {
        font-size: 13px;
    }
    .table th{
        text-align: right;
        font-weight: normal;
    }
    .table tr td,.table tr th {
        border: 1px solid #e5e6eb
    }
    .hkcmsiframe {
        width: 100%;
        height: 100%;
        min-height: 320px;
    }

    /*快捷导航样式*/
    .quick { text-align: center;margin-bottom: 8px}
    .quick a {color: #4e5969;}
    .quick .icon { display: block;font-size: 16px;width: 32px;height: 32px;background-color: #f7f8fa;border-radius: 4px;line-height: 32px;margin: 0 auto;margin-bottom: 4px; }
    .quick .text {font-size: 12px}
    .quick a:hover {color: #007bff}
</style>
{/block:style}

<!--快速导航-->
<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-bars"></i> <?php echo __('Quick navigation'); ?></span>
    </div>
    <div class="card-body">
        <div class="row">
            <?php if(is_array($nav_list) || $nav_list instanceof \think\Collection || $nav_list instanceof \think\Paginator): $i = 0; $__LIST__ = $nav_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$n): $mod = ($i % 2 );++$i;?>
            <div class="col-4 col-md-2 col-lg-1 col-xl-1">
                <div class="quick">
                    <a href="<?php echo url('/'.(!empty($n['route'])?$n['route']:$n['name'])); ?>" class="btn-newMenu" data-is_nav="true" data-id="<?php echo $n['auth_rule_id']; ?>" id="nav-item-<?php echo $n['auth_rule_id']; ?>" data-title="<?php echo __($n['title']); ?>">
                        <span class="icon"><i class="<?php echo $n['icon']; ?>"></i></span>
                        <span class="text"><?php echo __($n['title']); ?></span>
                    </a>
                </div>
            </div>
            <?php endforeach; endif; else: echo "" ;endif; ?>
            <div class="col-4 col-md-2 col-lg-1 col-xl-1">
                <div class="quick" style="height: 100%">
                    <a href="#!" class="add-admin-panel">
                        <span class="icon"><i class="fas fa-plus"></i></span>
                        <span class="text"><?php echo __('Add'); ?></span>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-cog"></i> <?php echo __('System information'); ?></span>
    </div>
    <div class="card-body">
        <table class="table table-bordered">
            <colgroup>
                <col width="150">
                <col width="40%">
                <col width="150">
                <col>
            </colgroup>
            <tr>
                <th><?php echo __('Site name'); ?></th>
                <td><?php echo $site['title']; ?></td>
                <th><?php echo __('Current version'); ?></th>
                <td>v<?php echo config('ver.cms_version'); ?>.<?php echo config('ver.cms_build'); ?></td>
            </tr>
            <tr>
                <th><?php echo __('System update'); ?></th>
                <td>
                    <a href="#" target="_blank" class="upgrade_url text-primary" style="display: none"></a>
                    <span class="upgrade"></span>
                </td>
                <th><?php echo __('Business license'); ?></th>
                <td>
                    <a href="//www.hkcms.cn/index/index/authorize" target="_blank"><span class="authorize">免授权，永久商用</span></a>
                </td>
            </tr>
        </table>
    </div>
</div>

<!--系统信息-->
<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-server"></i> <?php echo __('Server information'); ?></span>
    </div>
    <div class="card-body">
        <table class="table table-bordered">
            <colgroup>
                <col width="150">
                <col width="40%">
                <col width="150">
                <col>
            </colgroup>
            <tr>
                <th><?php echo __('Server system'); ?></th>
                <td><?php echo $system_info['OS']; ?></td>
                <th><?php echo __('Server domain name'); ?></th>
                <td><?php echo $system_info['domain']; ?></td>
            </tr>
            <tr>
                <th><?php echo __('Server environment'); ?></th>
                <td><?php echo $system_info['running_system']; ?></td>
                <th><?php echo __('PHP version'); ?></th>
                <td><?php echo $system_info['phpv']; ?></td>
            </tr>
            <tr>
                <th><?php echo __('Database version'); ?></th>
                <td><?php echo $system_info['mysqlv']; ?></td>
                <th><?php echo __('GD version'); ?></th>
                <td><?php echo $system_info['gdv']; ?></td>
            </tr>
        </table>
    </div>
</div>

<div class="card card-primary">
    <div class="card-body iframe-con" style="padding: 0.5rem">
    </div>
</div>

{block:script}
<script>
    // 更新检测
    function upgrade() {
        $.ajax({
            url:'<?php echo url("/index/upgrade"); ?>',
            success:function (result){
                if (result.data.upgrade==1) {
                    $('.upgrade').hide();
                    $('.upgrade_url').attr('href', result.data.url);
                    $('.upgrade_url').attr('data-v', result.data.v);
                    $('.upgrade_url').html(lang('New version v%s detected',[result.data.v]));
                    $('.upgrade_url').show();
                } else if (result.data.upgrade==-1) {
                    if (result.data.p) {
                        $('.upgrade').hide();
                        $('.upgrade_url').show();
                        $('.upgrade_url').attr('href', result.data.url);
                        $('.upgrade_url').attr('data-p', result.data.p);
                        $('.upgrade_url').attr('data-v', result.data.v);
                        $('.upgrade_url').html(lang('There are new patches [%s]',[result.data.p]));
                    } else {
                        $('.upgrade').show();
                        $('.upgrade_url').hide();
                        $('.upgrade').html("<?php echo __('Your HkCms is already up-to-date.'); ?>");
                    }
                } else {
                    $('.upgrade').html(result.msg);
                }
            }
        });
    }

    require(['admin'], function () {
        $(function () {

            // 插入官方动态、问答
            $('.iframe-con').html('<iframe class="hkcmsiframe" src="//www.hkcms.cn/index/index/notice" frameborder="no"></iframe>');

            $('.add-admin-panel').click(function () {
                hkcms.api.open('<?php echo url("/auth.AdminPanel/add"); ?>','<?php echo __("Add"); ?>',{ type: 2});
            })


            upgrade();

            // 更新
            var indx = 0;
            $('.upgrade_url').click(function (e) {
                var area = Tpl.popup==1 ? [$(window).width() > 800 ? '800px' : '90%', $(window).height() > 600 ? '600px' : '90%'] : ['100%', '100%'];

                var url = $(this).attr('href');
                layer.open({
                    content:url,
                    type:2,
                    area: area,
                    title:lang('Upgrade'),
                    btn: [lang('Upgrade'),lang('Local Upload and Upgrade'),lang('Help'),lang('Cancel')],
                    btnAlign: 'c',
                    yes: function(index, layero){
                        //询问框
                        layer.confirm(lang('Confirm')+'?', {
                            btn: [lang('Confirm'),lang('Cancel')] //按钮
                        }, function(){
                            var idx = layer.msg('<?php echo __("Updating, please do not close the page."); ?>', {
                                icon: 16
                                ,shade: 0.3
                                ,time: false
                            });
                            $.ajax({
                                type: 'post',
                                url:'<?php echo url("/index/upgrade"); ?>',
                                data:{p: $('.upgrade_url').data('p'), v: $('.upgrade_url').data('v')},
                                success:function (result){
                                    layer.close(idx)
                                    if (result.code==200) {
                                        layer.msg(result.msg, {time: 1000}, function (e) {
                                            parent.window.location.reload();
                                        });
                                    } else {
                                        layer.alert(result.msg);
                                    }
                                }
                            })
                        });
                    },
                    btn2: function (index, layero) {
                        $(layero).after('<input type="file" class="input-file-up" style="display: none" name="files[]" accept="application/zip,application/x-zip,application/x-zip-compressed">');
                        $(layero).next().click();
                        var chunkSize = 0; // 每次上次的分块字节
                        var error = 0; // 1-错误，0-继续上传分块
                        var count = 1;
                        require(['jquery-fileupload'], function (undefined) {
                            var idx = 0;
                            $('.input-file-up').fileupload({
                                mimetype:'application/zip',
                                url:Config.upload_url,
                                type: 'POST',
                                dataType: 'json',
                                autoUpload: true,
                                size: Config.file_size || (2*1024*1024),
                                singleFileUploads: false,
                                fileNum: 10,
                                filesguid: Util.guid(),
                                maxChunkSize: Config && Config.chunk && Config.chunk==1 ? Config.chunk_size:0,  // 2MB
                                add: function (e, data) { // 文件添加验证
                                    idx = layer.msg('<?php echo __("Updating, please do not close the page."); ?>', {
                                        icon: 16
                                        ,shade: 0.3
                                        ,time: false
                                    });
                                    count = 1;
                                    chunkSize = 0;
                                    data.submit();
                                },
                                done: function (e, data) { // 成功回调
                                    if (data.result.code==200) {
                                        $.post('<?php echo url("/index/upgrade"); ?>',{path:data.result.data[0].path,p: $('.upgrade_url').data('p'), v: $('.upgrade_url').data('v')},function (result) {
                                            layer.close(idx)
                                            if (result.code==200) {
                                                layer.msg(result.msg, {time: 1000}, function (e) {
                                                    parent.window.location.reload();
                                                });
                                            } else {
                                                layer.alert(result.msg);
                                            }
                                        });
                                    } else {
                                        layer.alert(data.result.msg);
                                    }
                                },
                                chunksend: function (e, data) { // 分块上传前的回调，返回false，结束上传
                                    if (error) {
                                        return false;
                                    }
                                    data.data.append('chunksize', chunkSize += data.chunkSize);
                                    data.data.append('filesize', data.files[0].size);
                                    data.data.append('fileid', data.filesguid);
                                    data.data.append('fileindex', count);

                                    count++;
                                },
                                chunkdone: function (e, data) { // 每个分块上传完成的回调
                                    if (data.result.code!=200) {
                                        layer.alert(data.result.msg);
                                        error = 1;
                                        return false;
                                    }
                                },
                                fail: function (e, data) {
                                    if (data.maxChunkSize>0) {
                                        // 切片上传处理
                                        var url = Util.setUrlParams({ url:data.url, query:{action:'clear',fileid:data.filesguid}})
                                        $.get({ url: url});
                                    }
                                    count = 1;

                                    layer.alert(data._response.jqXHR.responseJSON.message);
                                }
                            });
                        })

                        return false;
                    },
                    btn3: function () {
                        window.open("//www.hkcms.cn/help/azbs/167.html");
                    }
                })
                e.preventDefault()
            });
        })
    })
</script>
{/block:script}
            </div>
        </div>
    </div>

    <?php else: ?>
    <div class="operatePage">
        {block:style}
<style>
    .table {
        font-size: 13px;
    }
    .table th{
        text-align: right;
        font-weight: normal;
    }
    .table tr td,.table tr th {
        border: 1px solid #e5e6eb
    }
    .hkcmsiframe {
        width: 100%;
        height: 100%;
        min-height: 320px;
    }

    /*快捷导航样式*/
    .quick { text-align: center;margin-bottom: 8px}
    .quick a {color: #4e5969;}
    .quick .icon { display: block;font-size: 16px;width: 32px;height: 32px;background-color: #f7f8fa;border-radius: 4px;line-height: 32px;margin: 0 auto;margin-bottom: 4px; }
    .quick .text {font-size: 12px}
    .quick a:hover {color: #007bff}
</style>
{/block:style}

<!--快速导航-->
<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-bars"></i> <?php echo __('Quick navigation'); ?></span>
    </div>
    <div class="card-body">
        <div class="row">
            <?php if(is_array($nav_list) || $nav_list instanceof \think\Collection || $nav_list instanceof \think\Paginator): $i = 0; $__LIST__ = $nav_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$n): $mod = ($i % 2 );++$i;?>
            <div class="col-4 col-md-2 col-lg-1 col-xl-1">
                <div class="quick">
                    <a href="<?php echo url('/'.(!empty($n['route'])?$n['route']:$n['name'])); ?>" class="btn-newMenu" data-is_nav="true" data-id="<?php echo $n['auth_rule_id']; ?>" id="nav-item-<?php echo $n['auth_rule_id']; ?>" data-title="<?php echo __($n['title']); ?>">
                        <span class="icon"><i class="<?php echo $n['icon']; ?>"></i></span>
                        <span class="text"><?php echo __($n['title']); ?></span>
                    </a>
                </div>
            </div>
            <?php endforeach; endif; else: echo "" ;endif; ?>
            <div class="col-4 col-md-2 col-lg-1 col-xl-1">
                <div class="quick" style="height: 100%">
                    <a href="#!" class="add-admin-panel">
                        <span class="icon"><i class="fas fa-plus"></i></span>
                        <span class="text"><?php echo __('Add'); ?></span>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-cog"></i> <?php echo __('System information'); ?></span>
    </div>
    <div class="card-body">
        <table class="table table-bordered">
            <colgroup>
                <col width="150">
                <col width="40%">
                <col width="150">
                <col>
            </colgroup>
            <tr>
                <th><?php echo __('Site name'); ?></th>
                <td><?php echo $site['title']; ?></td>
                <th><?php echo __('Current version'); ?></th>
                <td>v<?php echo config('ver.cms_version'); ?>.<?php echo config('ver.cms_build'); ?></td>
            </tr>
            <tr>
                <th><?php echo __('System update'); ?></th>
                <td>
                    <a href="#" target="_blank" class="upgrade_url text-primary" style="display: none"></a>
                    <span class="upgrade"></span>
                </td>
                <th><?php echo __('Business license'); ?></th>
                <td>
                    <a href="//www.hkcms.cn/index/index/authorize" target="_blank"><span class="authorize">免授权，永久商用</span></a>
                </td>
            </tr>
        </table>
    </div>
</div>

<!--系统信息-->
<div class="card card-panel">
    <div class="card-header">
        <span><i class="fas fa-server"></i> <?php echo __('Server information'); ?></span>
    </div>
    <div class="card-body">
        <table class="table table-bordered">
            <colgroup>
                <col width="150">
                <col width="40%">
                <col width="150">
                <col>
            </colgroup>
            <tr>
                <th><?php echo __('Server system'); ?></th>
                <td><?php echo $system_info['OS']; ?></td>
                <th><?php echo __('Server domain name'); ?></th>
                <td><?php echo $system_info['domain']; ?></td>
            </tr>
            <tr>
                <th><?php echo __('Server environment'); ?></th>
                <td><?php echo $system_info['running_system']; ?></td>
                <th><?php echo __('PHP version'); ?></th>
                <td><?php echo $system_info['phpv']; ?></td>
            </tr>
            <tr>
                <th><?php echo __('Database version'); ?></th>
                <td><?php echo $system_info['mysqlv']; ?></td>
                <th><?php echo __('GD version'); ?></th>
                <td><?php echo $system_info['gdv']; ?></td>
            </tr>
        </table>
    </div>
</div>

<div class="card card-primary">
    <div class="card-body iframe-con" style="padding: 0.5rem">
    </div>
</div>

{block:script}
<script>
    // 更新检测
    function upgrade() {
        $.ajax({
            url:'<?php echo url("/index/upgrade"); ?>',
            success:function (result){
                if (result.data.upgrade==1) {
                    $('.upgrade').hide();
                    $('.upgrade_url').attr('href', result.data.url);
                    $('.upgrade_url').attr('data-v', result.data.v);
                    $('.upgrade_url').html(lang('New version v%s detected',[result.data.v]));
                    $('.upgrade_url').show();
                } else if (result.data.upgrade==-1) {
                    if (result.data.p) {
                        $('.upgrade').hide();
                        $('.upgrade_url').show();
                        $('.upgrade_url').attr('href', result.data.url);
                        $('.upgrade_url').attr('data-p', result.data.p);
                        $('.upgrade_url').attr('data-v', result.data.v);
                        $('.upgrade_url').html(lang('There are new patches [%s]',[result.data.p]));
                    } else {
                        $('.upgrade').show();
                        $('.upgrade_url').hide();
                        $('.upgrade').html("<?php echo __('Your HkCms is already up-to-date.'); ?>");
                    }
                } else {
                    $('.upgrade').html(result.msg);
                }
            }
        });
    }

    require(['admin'], function () {
        $(function () {

            // 插入官方动态、问答
            $('.iframe-con').html('<iframe class="hkcmsiframe" src="//www.hkcms.cn/index/index/notice" frameborder="no"></iframe>');

            $('.add-admin-panel').click(function () {
                hkcms.api.open('<?php echo url("/auth.AdminPanel/add"); ?>','<?php echo __("Add"); ?>',{ type: 2});
            })


            upgrade();

            // 更新
            var indx = 0;
            $('.upgrade_url').click(function (e) {
                var area = Tpl.popup==1 ? [$(window).width() > 800 ? '800px' : '90%', $(window).height() > 600 ? '600px' : '90%'] : ['100%', '100%'];

                var url = $(this).attr('href');
                layer.open({
                    content:url,
                    type:2,
                    area: area,
                    title:lang('Upgrade'),
                    btn: [lang('Upgrade'),lang('Local Upload and Upgrade'),lang('Help'),lang('Cancel')],
                    btnAlign: 'c',
                    yes: function(index, layero){
                        //询问框
                        layer.confirm(lang('Confirm')+'?', {
                            btn: [lang('Confirm'),lang('Cancel')] //按钮
                        }, function(){
                            var idx = layer.msg('<?php echo __("Updating, please do not close the page."); ?>', {
                                icon: 16
                                ,shade: 0.3
                                ,time: false
                            });
                            $.ajax({
                                type: 'post',
                                url:'<?php echo url("/index/upgrade"); ?>',
                                data:{p: $('.upgrade_url').data('p'), v: $('.upgrade_url').data('v')},
                                success:function (result){
                                    layer.close(idx)
                                    if (result.code==200) {
                                        layer.msg(result.msg, {time: 1000}, function (e) {
                                            parent.window.location.reload();
                                        });
                                    } else {
                                        layer.alert(result.msg);
                                    }
                                }
                            })
                        });
                    },
                    btn2: function (index, layero) {
                        $(layero).after('<input type="file" class="input-file-up" style="display: none" name="files[]" accept="application/zip,application/x-zip,application/x-zip-compressed">');
                        $(layero).next().click();
                        var chunkSize = 0; // 每次上次的分块字节
                        var error = 0; // 1-错误，0-继续上传分块
                        var count = 1;
                        require(['jquery-fileupload'], function (undefined) {
                            var idx = 0;
                            $('.input-file-up').fileupload({
                                mimetype:'application/zip',
                                url:Config.upload_url,
                                type: 'POST',
                                dataType: 'json',
                                autoUpload: true,
                                size: Config.file_size || (2*1024*1024),
                                singleFileUploads: false,
                                fileNum: 10,
                                filesguid: Util.guid(),
                                maxChunkSize: Config && Config.chunk && Config.chunk==1 ? Config.chunk_size:0,  // 2MB
                                add: function (e, data) { // 文件添加验证
                                    idx = layer.msg('<?php echo __("Updating, please do not close the page."); ?>', {
                                        icon: 16
                                        ,shade: 0.3
                                        ,time: false
                                    });
                                    count = 1;
                                    chunkSize = 0;
                                    data.submit();
                                },
                                done: function (e, data) { // 成功回调
                                    if (data.result.code==200) {
                                        $.post('<?php echo url("/index/upgrade"); ?>',{path:data.result.data[0].path,p: $('.upgrade_url').data('p'), v: $('.upgrade_url').data('v')},function (result) {
                                            layer.close(idx)
                                            if (result.code==200) {
                                                layer.msg(result.msg, {time: 1000}, function (e) {
                                                    parent.window.location.reload();
                                                });
                                            } else {
                                                layer.alert(result.msg);
                                            }
                                        });
                                    } else {
                                        layer.alert(data.result.msg);
                                    }
                                },
                                chunksend: function (e, data) { // 分块上传前的回调，返回false，结束上传
                                    if (error) {
                                        return false;
                                    }
                                    data.data.append('chunksize', chunkSize += data.chunkSize);
                                    data.data.append('filesize', data.files[0].size);
                                    data.data.append('fileid', data.filesguid);
                                    data.data.append('fileindex', count);

                                    count++;
                                },
                                chunkdone: function (e, data) { // 每个分块上传完成的回调
                                    if (data.result.code!=200) {
                                        layer.alert(data.result.msg);
                                        error = 1;
                                        return false;
                                    }
                                },
                                fail: function (e, data) {
                                    if (data.maxChunkSize>0) {
                                        // 切片上传处理
                                        var url = Util.setUrlParams({ url:data.url, query:{action:'clear',fileid:data.filesguid}})
                                        $.get({ url: url});
                                    }
                                    count = 1;

                                    layer.alert(data._response.jqXHR.responseJSON.message);
                                }
                            });
                        })

                        return false;
                    },
                    btn3: function () {
                        window.open("//www.hkcms.cn/help/azbs/167.html");
                    }
                })
                e.preventDefault()
            });
        })
    })
</script>
{/block:script}
    </div>
    <?php endif; ?>

    <script src="/static/libs/require/require.js"></script>
<script src="/static/module/admin/adminlte/js/main.js?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>"></script>

<!-- // 加载插件JS-->
<?php echo load_js(); ?>



    {__SCRIPT__}
    
</body>
</html>