{layout:default} {class:Shop.Admin.storeConfig.ServicePanel}
<lbhead>
    <title><%=Tag("客服面板")%>-<%=site.title%></title>
</lbhead>
<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="Update();"><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="config"><a href="javascript:void(0);" onclick="Config();"><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 clear">
        <div class="searchbox-l">
        <ul class="tabmenus">
            <li class="current"><a href="ServicePanel.aspx"><span><%=Tag("客服管理")%></span></a></li>
            <li><a href="ServicePanel_Group.aspx"><span><%=Tag("部门管理")%></span></a></li>
            <li><a href="ServicePanel_Type.aspx"><span><%=Tag("软件管理")%></span></a></li>
        </ul>
        </div>
        <div class="searchbox-r">
        <input type="text" id="key" name="key" class="input-query" value="<%=key %>" /><input type="button" id="btnSou" class="btn-query" onclick="search_();" value="" />
        </div>
    </div>
    <table class="datalist">
        <tr class="title">
            <th style="width: 40px" class="selectAll">
                <a href="javascript:void(0);" onclick="$('input[name=\'sid\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
            </th>
            <th style="width: 150px">
                <%=Tag("客服名称")%>
            </th>
            <th style="width: 150px">
                <%=Tag("软件帐号")%>
            </th>
            <th style="width: 120px">
                <%=Tag("部门名称")%>
            </th>
            <th style="width: 120px">
                <%=Tag("软件名称")%>
            </th>
            <th style="width: 200px">
                <%=Tag("显示语言")%>
            </th>
            <th style="width: 80px">
                <%=Tag("排序")%>
            </th>
            <th>
                <%=Tag("操作")%>
            </th>
        </tr>
        <%foreach (DB.LebiShop.Lebi_ServicePanel model in models)
          {%>
        <tr class="list" ondblclick="Edit(<%=model.id %>)">
            <td style="text-align:center">
                <input type="checkbox" value="<%=model.id %>" name="sid" />
                <input type="hidden" name="Uid" shop="true" value="<%=model.id %>" />
            </td>
            <td>
                <input type="text" id="Name<%=model.id %>" name="Name<%=model.id %>" shop="true" class="input" style="width: 120px" value="<%=model.Name %>" />
            </td>
            <td>
                <input type="text" id="Account<%=model.id %>" name="Account<%=model.id %>" shop="true" class="input" style="width: 120px" value="<%=model.Account %>" />
            </td>
            <td>
                <%=GetGroup(model.ServicePanel_Group_id).Name%>
            </td>
            <td>
                <%=GetType(model.ServicePanel_Type_id).Name%>
            </td>
            <td>
                <%=LanguageName(model.Language_ids)%>
            </td>
            <td>
            <input type="text" id="Sort<%=model.id %>" name="Sort<%=model.id %>" shop="true" class="input" style="width: 70px" value="<%=model.Sort %>" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
            </td>
            <td>
                <a href="javascript:void(0)" onclick="Edit(<%=model.id %>)"><%=Tag("编辑")%></a>
            </td>
        </tr>
        <%} %>
    </table> 
    <script type="text/javascript">
        function search_() {
            var key = $("#key").val();
            window.location = "?key=" + escape(key);
        }
        function Config() {
            var title_ = "<%=Tag("客服面板配置")%>";
            var url_ = "servicepanel_config_window.aspx";
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Edit(id) {
            var title_ = "<%=Tag("添加客服")%>";
            if (id > 0) { title_ = "<%=Tag("编辑客服")%>"; }
            var url_ = "servicepanel_edit_window.aspx?id=" + id;
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Update() {
            var postData = GetFormJsonData("shop");
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=ServicePanel_Update";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function DEL() {
            if (!confirm("<%=Tag("确认要删除吗？")%>"))
                return false;
            var ids = GetChkCheckedValues("sid");
            var postData = { "ids": ids };
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=ServicePanel_Del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbbody>
<lbbottom>
<div class="bottom" id="body_bottom">
    <%=PageString%>
</div>
</lbbottom>