{layout:default} {class:Shop.supplier.product.Brand}
<lbhead>
    <title><%=Tag("品牌管理")%>-<%=site.title%></title>
</lbhead>
<lbfile>
    <script type="text/javascript" src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <script type="text/javascript" src="<%=site.WebPath %>/Editor/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="<%=site.WebPath %>/Editor/ckfinder/ckfinder.js"></script>
    <script type="text/javascript" src="<%=site.AdminJsPath %>/multiselect/js/jquery.multiselect2side.js"></script>
    <link rel="stylesheet" href="<%=site.AdminJsPath %>/multiselect/css/jquery.multiselect2side.css" type="text/css" media="screen" />
</lbfile>
<lbpath>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="add"><a href="javascript:void(0);" onclick="Edit(0);"><b></b><span><%=Tag("添加")%></span></a></li>
    <li class="submit"><a href="javascript:void(0);" onclick="Edits();"><b></b><span><%=Tag("保存")%></span></a></li>
    <li class="del"><a href="javascript:void(0);" onclick="Del();"><b></b><span><%=Tag("删除")%></span></a></li>
    <%}%>
    <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <%=Tag("品牌管理")%></span></li>
    </ul>
    </div>
</lbpath>
<lbbody>
    <div class="searchbox">
        <select name="type" id="type">
            <option value="">┌<%=Tag("全部分类")%></option>
            <%=Shop.Bussiness.EX_Product.TypeOption(0, type, 0, CurrentLanguage.Code)%>
        </select>
        <input type="text" id="key" name="key" class="input-query" value="<%=key %>" onkeydown="if(event.keyCode==13){search_();}" /><input type="button" id="btnSou" class="btn-query" onclick="search_();" />
    </div>
    <table class="datalist">
        <tr class="title">
            <th style="width: 40px" class="selectAll">
                <a href="javascript:void(0);" onclick="$('input[name=\'Delid\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
            </th>
            <th style="width: 40px">
                <%=Tag("ID")%>
            </th>
            <th style="width: 200px">
                <%=Tag("品牌名称")%>
            </th>
            <th style="width: 150px">
                <%=Tag("图片")%>
            </th>
            <th style="width: 80px">
                <%=Tag("首字母")%>
            </th>
            <th style="width: 80px">
                <%=Tag("商品数量")%>
            </th>
            <th style="width: 80px">
                <%=Tag("状态")%>
            </th>
            <th>
                <%=Tag("操作")%>
            </th>
        </tr>
        <%foreach (Shop.Model.Lebi_Brand model in models)
          {%>
        <tr class="list" ondblclick="Edit(<%=model.id %>);" >
            <td style="text-align:center">
                <input type="checkbox" name="Delid" del="true" value="<%=model.id %>" />
                <input type="hidden" name="IDS" shop="true" value="<%=model.id %>" />
            </td>
            <td>
                <%=model.id%>
            </td>
            <td>
                <%=Lang(model.Name)%>&nbsp;<a href="<%=Shop.Bussiness.ThemeUrl.GetURL("P_Brand", model.id.ToString(), "", CurrentLanguage.Code)%>" target="_blank"><img src="<%=PageImage("icon/newWindow.png")%>" /></a>
                
            </td>
            <td>
                <% if (model.ImageUrl == "")
                   { %>
                &nbsp;
                <%}
                   else
                   { %>
                <img src="<%=site.WebPath + model.ImageUrl %>" style="height: 25px;vertical-align:middle" name="ImageUrl" />
                <%} %>
            </td>
            <td>
                <input type="text" name="FirstLetter<%=model.id %>" shop="true" value="<%=model.FirstLetter %>" class="input" style="width: 70px;" />
            </td>
            <td>
                <a href="default.aspx?Brand_id=<%=model.id %>&Type_id_ProductType=320,321,322,323"><%=Shop.Bussiness.EX_Product.BrandProductCount("Brand_id=" + model.id + " and Supplier_id = " + CurrentSupplier.id +"")%></a>
                
            </td>
            <td><%=Shop.Bussiness.EX_Type.TypeName(model.Type_id_BrandStatus)%></td>
            <td>
                <a href="javascript:void(0)" onclick="Edit(<%=model.id %>);"><%=Tag("编辑")%></a>
            </td>
        </tr>
        <%} %>
    </table>
    <script type="text/javascript">
        function search_() {
            var type = $("#type").val();
            var key = $("#key").val();
            window.location = "?key=" + escape(key) + "&type=" + type;
        }
        function Edit(id) {
            var title_ = "<%=Tag("编辑品牌")%>";
            if (id == 0) title_ = "<%=Tag("添加品牌")%>";
            var url_ = "brand_edit_window.aspx?id=" + id;
            var width_ = 750;
            var height_ = 500;
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Del() {
            if (!confirm("<%=Tag("确认要删除吗？")%>"))
                return false;
            var postData = GetFormJsonData("del");
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Brand_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function Edits() {
            var postData = GetFormJsonData("shop");
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Brands_Edit";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbbody>
<lbbottom>
<div class="bottom" id="body_bottom">
    <%=PageString%>
</div>
</lbbottom>