<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_AdminList, LebiMall" %>
 <%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>管理员列表</title>
        <link href="css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/checked.js"></script>
    <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script src="js/topHead.js" type="text/javascript"></script>
    <script type="text/javascript">
        var $=jQuery;
        function modify(_id,values){
            window.location.href="Grade.aspx?_id="+_id+"&values="+values; 
        }
        function deleteById(_id){
            tipsWindown('删除等级','iframe:ChildForm.aspx?del_id='+_id,'320','200','true','','true','text')
        }
        function edit(_id){
            window.location.href="UpdateGrade.aspx?_id="+_id;
        }
        
        function del(id){
             if (confirm("确认要删除此管理员吗？")) {
                 document.getElementById("hidState").value = id;
                 document.getElementById("btndel").click();
            } 
        }
        
        function dels(){
            var form =document.forms[0];
            var strid="";
            if (confirm("确认要删除？")) {
                for(i=0;i<form.elements.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(form.elements[i].checked==true){
                            strid+=form.elements[i].value+",";
                        }
                    }
                }
                window.location.href="Adminlm.aspx?strid="+strid+"&type=dels&page="+<%=page %>;
            }
        }
        
        function upstate(id,state){
            document.getElementById("hidState").value=id+","+state;
            document.getElementById("btnsave").click();
        }
        
        function rizhi(name){
            window.location.href="AdminLogList.aspx?name="+name;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <script>header(6,1,"images/");</script>
    <!--面包屑-->
    <div class="blank clearfix"></div>
    <!--功能区-->
    <div class="tabmenus mainwidth">
            <ul>
                <li class="current"><a href="AdminList.aspx"><span>管理员管理</span></a></li>
                <li><a href="Admin_Add.aspx"><span>管理员添加</span></a></li>
            </ul>
        </div>
    <div class="tab-mainbody">
        <div class="tab-mainbody2">
        <div class="functionHandleArea clearfix">
            <input type="image" name="Submit" title=" 删除 " onClick="dels();return false;" src="images/bt_delete.gif" align="absmiddle">
            <input type="image" border="0" title=" 添加 " onclick="location.href='Admin_add.aspx';return false;" src="images/bt_add.gif" align="absmiddle">
            <span id="msg_sub" class="title_r"></span>
            <script type="text/javascript">
            var $=jQuery;
                    var f="<%=Session["returnValue"] %>";
                    if(f=="true"){
                        tipsWindown('操作结果','text:操作成功！','250','60','true','2000','true','text');
                        <% Session["returnValue"]= null; %>
                    }
                    if(f=="false"){
                        tipsWindown('操作结果','text:操作失败！','250','60','true','2000','true','text');
                        <% Session["returnValue"]= null; %>
                    }
            </script>
        </div>
        <div id="datalist">
        <input type="hidden" id="hidState" runat="server" />
        <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list">
            <tr>
                <th style="width: 5%; cursor: pointer;" title="全选" onclick="AllChecked()">
                    选择</th>
                <th style="width: 12%">
                    管理员名称</th>
                <th style="width: 12%">
                    最后登陆IP
                </th>
                <th style="width: 17%">
                    注册时间
                </th>
                <th style="width: 18%">
                    最后登陆时间
                </th>
                <th style="width:8%">
                    登陆次数
                </th>
                <th style="width: 8%">
                    状态
                </th>
                <th style="width: 20%">
                    操作
                </th>
            </tr>
            <%for (int i = 0; i < ds.Tables[0].Rows.Count; i++){%>
            <tr>
                <td>
                    <input type="checkbox" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                    <input type="hidden" id="hidden_id<%=i %>" name="hidden_id<%=i %>" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                </td>
                <td>
                    <%=ds.Tables[0].Rows[i]["Admin_username"] %>
                </td>
                <td>
                    <%=ds.Tables[0].Rows[i]["Admin_ip"] %>
                </td>
                <td>
                        <%=ds.Tables[0].Rows[i]["Admin_registerTime"] %> </td>
                <td>
                    <%=ds.Tables[0].Rows[i]["Admin_loginTime"] %>
                </td>
                <td>
                    <%=ds.Tables[0].Rows[i]["Admin_loginCount"] %>
                </td>
                <td title="单击可更改属性">
                     <%if (ds.Tables[0].Rows[i]["admin_state"].ToString()=="0")
                       {
                        %>
                         <a href="javascript:upstate('<%=ds.Tables[0].Rows[i]["id"] %>',1) " style="color:Red;">已关闭</a>
                        <%
                         }
                         else { 
                        %><a href="javascript:upstate('<%=ds.Tables[0].Rows[i]["id"] %>',0)">已开启</a>
                        <% } %>
                </td>
                <td>
                <a href="AdminEdit.aspx?name=<%=ds.Tables[0].Rows[i]["Admin_username"] %>&state=<%=ds.Tables[0].Rows[i]["admin_state"] %>">编辑</a>&nbsp;|&nbsp;
                <a href="AdminPower.aspx?uid=<%=ds.Tables[0].Rows[i]["id"] %>">权限</a>&nbsp;|&nbsp;
                <a href="javascript:rizhi('<%=ds.Tables[0].Rows[i]["Admin_username"] %> ')">日志</a>&nbsp;|&nbsp;
                    <a href="javascript:del(<%=ds.Tables[0].Rows[i]["id"] %>)">删除</a>&nbsp;
                </td>
            </tr>
            <%} %>
            <tr>
                <td colspan="8" class="list-foot">
                    <div class="fy">
                        <webdiyer:AspNetPager CssClass="pages" CurrentPageButtonClass="cpb" ID="AspNetPager1"
                            runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                            PrevPageText="上一页" PageSize="20" UrlPaging="True" NumericButtonCount="5" CustomInfoHTML="">
                        </webdiyer:AspNetPager>
                    </div>
                </td>
            </tr>
            </table><script type="text/javascript">tdshowm("list");</script>
            <input type="button" id="btnsave" runat="server" style="display:none;" onserverclick="btnsave_ServerClick" />
            <input type="button" id="btndel" runat="server" style="display:none;" onserverclick="btndel_ServerClick" />
            </div></div>
            </div>
    </form>
</body>
</html>
