<?php /*a:3:{s:63:"/home/affivpnx/app.peakwork.pro/app/admin/view/system/bank.html";i:1763742186;s:65:"/home/affivpnx/app.peakwork.pro/app/admin/view/public/header.html";i:1763742186;s:65:"/home/affivpnx/app.peakwork.pro/app/admin/view/public/footer.html";i:1763742186;}*/ ?>
<!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>

<body>
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="javascript:;">首页</a>
        <a><cite>银行列表</cite></a>
    </span>
    <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 layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn"
                            onclick="xadmin.open('添加','<?php echo url('admin/System/bankAdd'); ?>',600,350)">
                        <i class="layui-icon"></i>添加
                    </button>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>银行名称/Coin</th>
                            <th>户名/Network</th>
                            <th>卡号/Address</th>
                            <th>状态</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                        <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "" ;else: foreach($list as $key=>$vo): ?>
                        <tr>
                            <td><?php echo htmlentities($vo['id']); ?></td>
                            <td><?php echo htmlentities($vo['name']); ?></td>
                            <td><?php echo htmlentities($vo['account_name']); ?></td>
                             <td><?php echo htmlentities($vo['card_no']); ?></td>
                            <td class="td-status">
                                <?php if($vo['status'] == 1): ?>
                                已启用
                                <?php else: ?>
                                已禁用
                                <?php endif; ?>
                            </td>
                            <td class="td-manage">
                                <a onclick="manage_stop(this,'<?php echo htmlentities($vo['id']); ?>')" href="javascript:;" class="layui-btn layui-btn-danger layui-btn-mini">
                                    <?php echo htmlentities($vo['open_txt']); ?>
                                </a>
                                <a href="javascript:;" class="layui-btn layui-btn-mini"
                                   onclick="xadmin.open('编辑','<?php echo url('admin/System/bankAdd',['id'=>$vo['id']]); ?>',600,350)">
                                    编辑
                                </a>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body">
                    <div class="page">
                        <?php echo $list; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    /*用户-停用*/
    function manage_stop(obj, id) {
        layer.confirm('确认要进行操作吗', function (index) {
            $.ajax({
                url: '<?php echo url("admin/System/bankDisable"); ?>',
                type: 'post',
                data: {'id': id},
                dataType: 'json',
                success: function (res) {
                    if (res.status == '200') {
                        tipAction(1, res.msg);
                        if ($(obj).text() == '启用') {
                            //发异步把用户状态进行更改
                            $(obj).text('禁用');
                            $(obj).parents('tr').find(".td-status").text('已启用');
                        } else {
                            $(obj).text('启用');
                            $(obj).parents('tr').find(".td-status").text('已禁用');
                        }
                    } else {
                        tipAction(2, res.msg);
                    }
                },
                error: function () {
                    tipAction(2, '系统繁忙');
                }
            });
        });
    }
</script>
</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>

