{layout:default} {class:Shop.Admin.product.Property_Value}
<lbhead>
    <title><%=Shop.Bussiness.Language.Content(pmodel.Name,CurrentLanguage.Code) %>-<%=Tag("属性规格")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <h3 class="text-themecolor m-b-0 m-t-0"><%=Shop.Bussiness.Language.Content(pmodel.Name,CurrentLanguage.Code) %></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"><a href="<%=site.AdminPath %>/product/Property.aspx?tid=<%=tmodel.id %>"><%=Tag(tmodel.Name)%></a></li>
        <li class="breadcrumb-item active"><%=Shop.Bussiness.Language.Content(pmodel.Name,CurrentLanguage.Code) %></li>
    </ol>
</lbpath>
<lbbody>
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6 m-b-10">
                        <%if (PageReturnMsg == ""){%>
                        <button class="btn btn-info" onclick="EditProPerty(0)"><i class="ti-plus"></i> <%=Tag("添加")%></button>
                        <%}%>
                    </div>
                    <div class="col-md-6 m-b-10">
                        <div class="input-group">
                            <input type="text" id="key" name="key" value="<%=key %>" class="form-control" onkeydown="if(event.keyCode==13){search_();}">
                            <div class="input-group-append">
                                <button type="button" class="btn btn-primary" onclick="search_();"><i class="ti-search"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-hover no-wrap">
                        <thead>
                            <tr>
                                <th>
                                    <%=Tag("ID")%>
                                </th>
                                <th>
                                    <%=Tag("代码")%>
                                </th>
                                <th>
                                    <%=Tag("属性名称")%>
                                </th>
                                <th>
                                    <%=Tag("图标")%>
                                </th>
                                <th>
                                    <%=Tag("排序")%>
                                </th>
                                <th>
                                    <%=Tag("操作")%>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <%foreach (DB.LebiShop.Lebi_ProPerty model in models){ %>
                            <tr ondblclick="EditProPerty(<%=model.id %>)">
                                <td>
                                    <%=model.id%>
                                </td>
                                <td>
                                    <%=model.Code%>
                                </td>
                                <td>
                                    <%=Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code)%>
                                </td>
                                <td>
                                    <%if (model.ImageUrl != ""){ %>
                                    <img src="<%=site.WebPath + model.ImageUrl%>" height="23" />
                                    <%} %>
                                </td>
                                <td>
                                    <%=model.Sort%>
                                </td>
                                <td>
                                    <a href="javascript:void(0);" onclick="EditProPerty(<%=model.id%>);"><%=Tag("编辑")%></a> | <a href="javascript:" onclick="DeleteConfirm(<%=model.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 EditProPerty(id) {
            var title_ = "<%=Tag("编辑子项")%>";
            if (id == 0) title_ = "<%=Tag("添加子项")%>";
            $("#EditModal").modal("show");
            $.ajax({
                url: "property_value_edit_window.aspx",
                type: "GET",
                cache: false,
                data: {id:id,pid:'<%=pmodel.id %>',title:title_},
            }).done(function(result){
                $("#EditModal .modal-content").html(result);
            });
        }
        function DeleteConfirm(id) {
            $("#Modal-Confirm").modal("show");
            $("#Confirm-Content").html("<%=Tag("确认要删除吗？")%>");
            $("#Modal-Confirm .btn-success.btn-ok").attr("onclick", "DelProPerty(" + id + ");");
        }
        function DelProPerty(id) {
            $("#Modal-Confirm").modal("hide");
            var postData;
            if (id == 0)
                postData = GetFormJsonData("del");
            else
                postData = { "id": id };
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Property_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function search_() {
            var key = $("#key").val();
            window.location = "?pid=<%=pid %>&key=" + escape(key);
        }
    </script>
</lbscripts>