<?php /*a:4:{s:79:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\cms\recommend\index.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">
                <div class="card card-primary">
    <div class="card-body">
        <div id="toolbar" class="toolbar">
            <?php if((has_rule('add'))): ?>
            <button type="button" class="btn btn-primary btn-add " data-url="<?php echo url('/cms.recommend/add'); ?>" data-popup="false"><i class="fas fa-plus"></i>
                <?php echo lang('Add'); ?></button>
            <?php endif; ?>


            <div class="dropdown ml-1 btn-toggle" data-toggle="tooltip" data-placement="right" data-title="点击表格行进行批量操作">
                <a class="btn btn-secondary dropdown-toggle btn-disabled disabled" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-cog"></i> <?php echo lang('More'); ?>
                </a>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                    <?php if((has_rule('del'))): ?>
                    <a class="dropdown-item btn-del" href="#" data-url="<?php echo url('/cms.recommend/del'); ?>"><i class="fas fa-trash-alt"></i> <?php echo lang('Batch delete'); ?></a>
                    <?php endif; if((has_rule('batches'))): ?>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item status" href="#" data-params="status=normal"><i class="fas fa-check-circle"></i> <?php echo lang('Set to enable'); ?></a>
                    <a class="dropdown-item status" href="#" data-params="status=hidden"><i class="fas fa-ban"></i> <?php echo lang('Set to disabled'); ?></a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <table id="table"
               data-del="<?php if(has_rule('del')): ?><?php echo url('/cms.Recommend/del'); ?><?php endif; ?>"
               data-batches="<?php if(has_rule('batches')): ?><?php echo url('/cms.Recommend/batches'); ?><?php endif; ?>"
        ></table>
    </div>
</div>

{block:script}
<script>
    require(['admin','table'], function (admin, Table) {
        $(function () {
            Table.init({
                url: "<?php echo url('/cms.Recommend/index'); ?>",
                showToggle: false,
                search: false,
                pagination: true,
                escape: false,
                contentLangSw: true,
                columns: [{
                    field: 'state',
                    checkbox: true,
                },{
                    field: 'weigh',
                    title: '<?php echo lang("Weigh"); ?>',
                    formatter:Table.formatter.txtEditBtn,
                    events:Table.events.txtEditBtn
                },{
                    field: 'SN',
                    title: '<?php echo lang("Serial number"); ?>',
                    formatter: Table.formatter.SN,
                    visible: false
                },{
                    field: 'id',
                    title: '<?php echo lang("ID"); ?>',
                },{
                    field: 'name',
                    title: '<?php echo lang("Mark"); ?>',
                    align: 'left',
                },{
                    field: 'remark',
                    title: '<?php echo lang("Title"); ?>',
                    align: 'left',
                },{
                    field: 'type',
                    title: '<?php echo lang("Type"); ?>',
                    formatter: function(value, row, index) {
                        if (value==1) {
                            return '<?php echo lang("Banner"); ?>';
                        } else if (value==2) {
                            return '<?php echo lang("Video"); ?>';
                        } else if (value==3) {
                            return '<?php echo lang("HTML Content"); ?>';
                        } else if (value==4) {
                            return '<?php echo lang("Content data"); ?>';
                        } else if (value==5) {
                            return '<?php echo lang("Links"); ?>';
                        }
                    }
                },{
                    field: 'status',
                    title: '<?php echo lang("Status"); ?>',
                    formatter: Table.formatter.switchBtn,
                    events: Table.events.switchBtn
                },{
                    field: 'operate',
                    title: '<?php echo lang("Operate"); ?>',
                    formatter: function (value, row, index) {
                        let edit_url = Util.setUrlParams({ url:'<?php echo url("/cms.Recommend/edit"); ?>', query:{popup:0,id:row['id'],rec_type:row['type']} });
                        let html = '';

                        /* <?php if(has_rule('edit')): ?> */
                        html += '<a href="'+edit_url+'" class="btn btn-primary btn-xs text-white mr-1" data-toggle="tooltip" data-placement="top" data-trigger="hover" title="'+lang('Edit')+'"><i class="fas fa-pen"></i></a>';
                        /* <?php endif; ?> */

                        return html+Table.formatter.operate.call(this, value, row, index)
                    },
                    events: Table.events.operate
                }]
            });
        })
    })
</script>
{/block:script}
            </div>
        </div>
    </div>

    <?php else: ?>
    <div class="operatePage">
        <div class="card card-primary">
    <div class="card-body">
        <div id="toolbar" class="toolbar">
            <?php if((has_rule('add'))): ?>
            <button type="button" class="btn btn-primary btn-add " data-url="<?php echo url('/cms.recommend/add'); ?>" data-popup="false"><i class="fas fa-plus"></i>
                <?php echo lang('Add'); ?></button>
            <?php endif; ?>


            <div class="dropdown ml-1 btn-toggle" data-toggle="tooltip" data-placement="right" data-title="点击表格行进行批量操作">
                <a class="btn btn-secondary dropdown-toggle btn-disabled disabled" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-cog"></i> <?php echo lang('More'); ?>
                </a>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                    <?php if((has_rule('del'))): ?>
                    <a class="dropdown-item btn-del" href="#" data-url="<?php echo url('/cms.recommend/del'); ?>"><i class="fas fa-trash-alt"></i> <?php echo lang('Batch delete'); ?></a>
                    <?php endif; if((has_rule('batches'))): ?>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item status" href="#" data-params="status=normal"><i class="fas fa-check-circle"></i> <?php echo lang('Set to enable'); ?></a>
                    <a class="dropdown-item status" href="#" data-params="status=hidden"><i class="fas fa-ban"></i> <?php echo lang('Set to disabled'); ?></a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <table id="table"
               data-del="<?php if(has_rule('del')): ?><?php echo url('/cms.Recommend/del'); ?><?php endif; ?>"
               data-batches="<?php if(has_rule('batches')): ?><?php echo url('/cms.Recommend/batches'); ?><?php endif; ?>"
        ></table>
    </div>
</div>

{block:script}
<script>
    require(['admin','table'], function (admin, Table) {
        $(function () {
            Table.init({
                url: "<?php echo url('/cms.Recommend/index'); ?>",
                showToggle: false,
                search: false,
                pagination: true,
                escape: false,
                contentLangSw: true,
                columns: [{
                    field: 'state',
                    checkbox: true,
                },{
                    field: 'weigh',
                    title: '<?php echo lang("Weigh"); ?>',
                    formatter:Table.formatter.txtEditBtn,
                    events:Table.events.txtEditBtn
                },{
                    field: 'SN',
                    title: '<?php echo lang("Serial number"); ?>',
                    formatter: Table.formatter.SN,
                    visible: false
                },{
                    field: 'id',
                    title: '<?php echo lang("ID"); ?>',
                },{
                    field: 'name',
                    title: '<?php echo lang("Mark"); ?>',
                    align: 'left',
                },{
                    field: 'remark',
                    title: '<?php echo lang("Title"); ?>',
                    align: 'left',
                },{
                    field: 'type',
                    title: '<?php echo lang("Type"); ?>',
                    formatter: function(value, row, index) {
                        if (value==1) {
                            return '<?php echo lang("Banner"); ?>';
                        } else if (value==2) {
                            return '<?php echo lang("Video"); ?>';
                        } else if (value==3) {
                            return '<?php echo lang("HTML Content"); ?>';
                        } else if (value==4) {
                            return '<?php echo lang("Content data"); ?>';
                        } else if (value==5) {
                            return '<?php echo lang("Links"); ?>';
                        }
                    }
                },{
                    field: 'status',
                    title: '<?php echo lang("Status"); ?>',
                    formatter: Table.formatter.switchBtn,
                    events: Table.events.switchBtn
                },{
                    field: 'operate',
                    title: '<?php echo lang("Operate"); ?>',
                    formatter: function (value, row, index) {
                        let edit_url = Util.setUrlParams({ url:'<?php echo url("/cms.Recommend/edit"); ?>', query:{popup:0,id:row['id'],rec_type:row['type']} });
                        let html = '';

                        /* <?php if(has_rule('edit')): ?> */
                        html += '<a href="'+edit_url+'" class="btn btn-primary btn-xs text-white mr-1" data-toggle="tooltip" data-placement="top" data-trigger="hover" title="'+lang('Edit')+'"><i class="fas fa-pen"></i></a>';
                        /* <?php endif; ?> */

                        return html+Table.formatter.operate.call(this, value, row, index)
                    },
                    events: Table.events.operate
                }]
            });
        })
    })
</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>