{layout:default} {class:Shop.Admin.cms.Images}
<lbhead>
    <title><%=Tag("图片管理") %>-<%=site.title%></title>
</lbhead>
<lbfile>
    <link href="<%=site.AdminAssetsPath %>/plugins/lightbox/css/lightbox.min.css" rel="stylesheet" />
</lbfile>
<lbpath>
    <h3 class="text-themecolor m-b-0 m-t-0"><%=Tag("图片管理")%></h3>
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a></li>
        <li class="breadcrumb-item active"><%=Tag("图片管理")%></li>
    </ol>
</lbpath>
<lbbody>
    <div class="col-md-2">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <ul class="list-style-none">
                            <li><a class="<%if (type==""){ %>selected<%} %>" href="?type=&status=<%=status %>"><%=Tag("全部")%></a></li>
                            <%=ImageType()%>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-10">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-12">
                        <%if (PageReturnMsg == ""){%>
                        <button class="btn btn-primary" onclick="$('input[name=\'ids\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><i class="ti-check-box"></i> <%=Tag("全选")%></button>
                        <button class="btn btn-danger" onclick="DeleteConfirm()"><i class="ti-trash"></i> <%=Tag("删除")%></button>
                        <%}%>
                    </div>
                </div>
                <ul class="nav nav-tabs customtab m-t-20" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link <%if (status== 2){ %>active<%} %>" href="?type=<%=type%>&status=2" role="tab"><%=Tag("全部")%></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link <%if (status== 1){ %>active<%} %>" href="?type=<%=type%>&status=1" role="tab"><%=Tag("使用中")%></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link <%if (status== 0){ %>active<%} %>" href="?type=<%=type%>&status=0" role="tab"><%=Tag("未使用")%></a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" role="tabpanel">
                        <div class="card-body">
                            <div class="row">
                                <%foreach (DB.LebiShop.Lebi_Image model in pages){%>
                                <div class="col-6 col-md-2">
                                    <div class="card text-center p-t-10 p-b-10">
                                        <a href="<%=Image(model.Image) %>" data-lightbox="image"><img src="<%=Image(model.Image,100,100) %>"></a>
                                        <div class="text-left m-l-5">
                                            <label class="custom-control custom-checkbox">
                                                <input type="checkbox" id="checkbox<%=model.id %>" name="ids" value="<%=model.id %>" class="custom-control-input" del="true">
                                                <span class="custom-control-label"></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <%} %>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</lbbody>
<lbscripts>
    <script src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <script src="<%=site.AdminAssetsPath %>/plugins/lightbox/lightbox.min.js"></script>
    <script>
        function DeleteConfirm() {
            $("#Modal-Confirm").modal("show");
            $("#Confirm-Content").html("<%=Tag("确认要删除吗？")%>");
            $("#Modal-Confirm .btn-success.btn-ok").attr("onclick", "DeleteObj();");
        }
        function DeleteObj() {
            $('#Modal-Confirm').modal('hide');
            var postData = GetFormJsonData("del");
            var url = "<%=site.AdminPath %>/ajax/ajax_node.aspx?__Action=Image_Del";
            RequestAjax(url, postData, function () { MsgBox(1, "<%=Tag("操作成功")%>", "?") });
        }
    </script>
</lbscripts>