{layout:default} {class:Shop.Admin.storeConfig.OnLinePay}
<lbhead>
    <title><%=Tag("在线支付")%>-<%=site.title%></title>
</lbhead>
<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-12">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-12 m-b-10">
                        <%if (PageReturnMsg == ""){%>
                        <button class="btn btn-info" onclick="EditObj(0);"><i class="ti-plus"></i> <%=Tag("添加")%></button>
                        <button class="btn btn-danger" onclick="DeleteConfirm()"><i class="ti-trash"></i> <%=Tag("删除")%></button>
                        <%}%>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-hover no-wrap">
                        <thead>
                            <tr>
                                <th class="selectAll" style="width:40px">
                                    <a href="javascript:void(0);" onclick="$('input[name=\'Delid\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
                                </th>
                                <th>
                                    <%=Tag("名称")%>
                                </th>
                                <th>
                                    <%=Tag("接口类型")%>
                                </th>
                                <th>
                                    <%=Tag("接口代码")%>
                                </th>
                                <th>
                                    <%=Tag("货币")%>
                                </th>
                                <th>
                                    <%=Tag("手续费")%>
                                </th>
                                <th>
                                    <%=Tag("启用")%>
                                </th>
                                <th>
                                    <%=Tag("启用类型")%>
                                </th>
                                <th>
                                    <%=Tag("供应商")%>
                                </th>
                                <th>
                                    <%=Tag("显示语言")%>
                                </th>
                                <th>
                                    <%=Tag("排序")%>
                                </th>
                                <th>
                                    <%=Tag("操作")%>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <%foreach (DB.LebiShop.Lebi_OnlinePay model in models){
                            DB.LebiShop.Lebi_Supplier supplier = DB.LebiShop.B_Lebi_Supplier.GetModel(model.Supplier_id);
                            if (supplier == null)
                            supplier = new DB.LebiShop.Lebi_Supplier();
                            %>
                            <tr ondblclick="EditObj(<%=model.id %>);">
                                <td>
                                    <label class="custom-control custom-checkbox">
                                        <input type="checkbox" id="checkbox<%=model.id %>" name="Delid" value="<%=model.id %>" class="custom-control-input" del="true">
                                        <span class="custom-control-label"></span>
                                    </label>
                                    <input type="hidden" name="IDS" shop="true" value="<%=model.id %>">
                                </td>
                                <td>
                                    <b><%=Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code)%></b>
                                </td>
                                <td><%=model.TypeName %></td>
                                <td><%=model.Code %></td>
                                <td><%=model.Currency_Name%></td>
                                <td>
                                    <%=model.FeeRate %> %
                                </td>
                                <td>
                                    <%=model.IsUsed == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>"%>
                                </td>
                                <td>
                                    <%=model.showtype %>
                                </td>
                                <td>
                                    <%=supplier.SubName %>
                                </td>
                                <td>
                                    <%=LanguageName(model.Language_ids)%>
                                </td>
                                <td>
                                    <%=model.Sort %>
                                </td>
                                <td>
                                    <a href="javascript:void(0)" onclick="EditObj(<%=model.id %>);"><%=Tag("编辑")%></a> | <a href="javascript:void(0)" onclick="CopyObj(<%=model.id %>);"><%=Tag("复制")%></a>
                                </td>
                            </tr>
                            <%foreach (DB.LebiShop.Lebi_OnlinePay son in GetPays(model.id))
                            {
                            supplier = DB.LebiShop.B_Lebi_Supplier.GetModel(son.Supplier_id);
                            if (supplier == null)
                            supplier = new DB.LebiShop.Lebi_Supplier();

                            %>
                            <tr ondblclick="EditObj(<%=son.id %>);">
                                <td>
                                    <label class="custom-control custom-checkbox">
                                        <input type="checkbox" id="checkbox<%=son.id %>" name="Delid" value="<%=son.id %>" class="custom-control-input" del="true">
                                        <span class="custom-control-label"></span>
                                    </label>
                                    <input type="hidden" name="IDS" shop="true" value="<%=son.id %>" />
                                </td>
                                <td>
                                    &nbsp;&nbsp;|-- <%=Shop.Bussiness.Language.Content(son.Name, CurrentLanguage.Code)%>
                                </td>
                                <td><%=son.TypeName %></td>
                                <td><%=son.Code %></td>
                                <td><%=son.Currency_Name%></td>
                                <td>
                                    <%=son.FeeRate %> %
                                </td>
                                <td>
                                    <%=son.IsUsed == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>"%>
                                </td>
                                <td>
                                    <%=son.showtype %>
                                </td>
                                <td>
                                    <%=supplier.SubName %>
                                </td>
                                <td>
                                    <%=LanguageName(son.Language_ids)%>
                                </td>
                                <td>
                                    <%=son.Sort %>
                                </td>
                                <td>
                                    <a href="javascript:void(0)" onclick="EditObj(<%=son.id %>);"><%=Tag("编辑")%></a> | <a href="javascript:void(0)" onclick=" CopyObj(<%=son.id %>);"><%=Tag("复制")%></a>
                                </td>
                            </tr>
                            <%} %>
                            <%} %>
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-12">
                        <nav aria-label="Page navigation ">
                            <%=PageString%>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>
</lbbody>
<lbscripts>
    <script src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <script>
        function EditObj(id) {
            var title_ = "<%=Tag("编辑在线支付")%>";
            if (id == 0)
                var title_ = "<%=Tag("添加在线支付")%>";
            $("#EditModal").modal("show");
            $.ajax({
                url: "onlinepay_edit_window.aspx",
                type: "GET",
                cache: false,
                data: {id: id,title: title_},
            }).done(function(result){
                $("#EditModal .modal-content").html(result);
            });
        }
        function CopyObj(id) {
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=OnlinePay_Copy&id=" + id;
            RequestAjax(url,"",function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        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_site.aspx?__Action=OnlinePay_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbscripts>