{layout:default} {class:Shop.Admin.product.Class}
<lbhead>
    <title><%=Tag("商品分类")%>-<%=site.title%></title>
</lbhead>
<lbfile>
    <script type="text/javascript" src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <style >
        .bottom{height: 0;overflow: hidden;display: none;}
    </style>
</lbfile>
<lbpath>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="add"><a href="javascript:void(0);" onclick="Edit(0,0);"><b></b><span><%=Tag("添加")%></span></a></li>
    <li class="add"><a href="javascript:void(0);" onclick="Class_MAdd();"><b></b><span><%=Tag("批量添加")%></span></a></li>
    <li class="unite"><a href="javascript:void(0);" onclick="Class_Unite();"><b></b><span><%=Tag("合并")%></span></a></li>
    <li class="del"><a href="javascript:void(0);" onclick="Del(0)"><b></b><span><%=Tag("删除")%></span></a></li>
    <%if (site.SiteCount > 1){ %><li class="reset"><a href="javascript:void(0);" onclick="Class_Site();"><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">
         <input type="text" id="key" class="input-query" value="<%=key %>" style="width: 150px;" 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=\'id\']').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: 300px">
                <%=Tag("属性")%>
            </th>
            <th style="width: 300px">
                <%=Tag("规格")%>
            </th>
            <th style="width: 80px">
                <%=Tag("商品数量")%>
            </th>
            <th style="width: 80px">
                <%=Tag("分类排序")%>
            </th>
            <th style="width: 80px">
                <%=Tag("是否显示")%>
            </th>
            <th style="width: 80px">
                <%=Tag("首页显示")%>
            </th>
            <th>
                <%=Tag("操作")%>
            </th>
        </tr>
        <div id="listinfo">
            <%=List%>
        </div>
    </table>
    <script type="text/javascript">
        function search_() {
            var key = $("#key").val();
            window.location = "?key=" + escape(key);
        }
        function Del(id) {
            if (confirm("<%=Tag("确认要删除吗？")%>")){
            var postData;
            if (id == 0)
                id = GetChkCheckedValues("id");
            postData = { "id": id };
            var url = "<%=site.AdminPath %>/ajax/ajax_product.aspx?__Action=Type_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "");if ((id + "a").indexOf(",") == -1){$("#tr" + id + "").remove();}else {var arr = id.split(',');for (var i in arr) {$("#tr" + arr[i] + "").remove();}}});}
        }
        function Edit(pid, id) {
            var title_ = "<%=Tag("编辑分类")%>";
            if (id == 0) title_ = "<%=Tag("添加分类")%>";
            var url_ = "class_edit_window.aspx?pid=" + pid + "&id=" + id;
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
            //tipsWindown("编辑导航", "url:get?" + url_ + "", width_, height_, "true", "", "true", ""); 
        }
        function Class_MAdd() {
            var title_ = "<%=Tag("批量添加分类")%>";
            var url_ = "class_madd_window.aspx";
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
            //tipsWindown("编辑导航", "url:get?" + url_ + "", width_, height_, "true", "", "true", ""); 
        }
        function Class_Unite() {
            var title_ = "<%=Tag("合并分类")%>";
            var url_ = "class_unite_window.aspx?";
            var width_ = 500;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Class_Site(){
            var ids = GetChkCheckedValues("id");
            var title_ = "<%=Tag("编辑站点")%>";
            var url_ = "class_site_edit_window.aspx?ids="+ids+"";
            var width_ = 500;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
    </script>
</lbbody>
<lbbottom>
    <div class="bottom" id="body_bottom">
    </div>
</lbbottom>