<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="UserList.aspx.vb" Inherits="Dingtai.Website.UserList" %>
<%@ Register src="../../App_Data/Controls/PageControl.ascx" tagname="PageControl" tagprefix="uc1" %>
<!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>鼎太播客 &gt; 后台管理 &gt; 用户管理列表</title>
</head>
<body onload="setTableBg();">
    <form id="form1" runat="server">
    <div id="body">
        <div id="title">                
            <h5>您现在的位置：<a href="#" target="_self">后台管理</a> &gt; 用户管理列表</h5>
            <p><a href ="UserList.aspx">用户列表</a> <a href="UserList.aspx?IsLock=0">未锁定</a> <a href="UserList.aspx?IsLock=1">已锁定</a> </p>
        </div>
         <div id="box">
            <div id="an_box">
                <ul>
                    <li><a href ="UserAdd.aspx"><div class="add" alt="新增" onclick="window.location.href='UserAdd.aspx';"  /></a> </li>                 
                    <li><a href ="#" ><div class="qx" alt="全选"  onclick="SelectAll();" /></a> </li>
                    <li><a href ="#" ><div class="fx" alt="反选" onclick="Inverse();"  /></a> </li>
                    <li><a href ="#" ><div class="dels" alt="批量删除" onclick="delMedias();"  /></a> </li>
                </ul>
                 <div class="search_box">                    
                    用户名：<asp:TextBox ID="txtUserName"  CssClass ="wbk" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="imgSumbit" runat="server" ImageUrl ="/Skins/default/images/yl_an.gif" /> 
                </div>             
            </div>         
            <div class="body_box" id="body_box">
                <asp:Repeater ID="Repeater1" runat="server">
                   <HeaderTemplate >
                        <table id="t" class="table_bg" onclick="clickto()" onmousemove="fmove()" onmouseout="fout()" >
                            <tr  class="table_border">
                            <th>选择</th>
                            <th>用户类型</th>
                            <th>用户名称</th>
                            <th>昵  称</th>
                            <th>注册时间</th>
                            <th>注册邮箱</th>
                            <th>操作</th>
                            </tr>
                   </HeaderTemplate>
                   <ItemTemplate>                                  
                            <tr  class="table_border2">
                            <td align ="center" ><input type="checkbox" name="checkboxid" id="checkboxid" value="<%#Eval("ID") %>" /></td>
                            <td align ="center" ><b style="color:Green"><%#getUploadType(Eval("RegisterType"))%></b></td> 
                            <td align ="center" ><%#Eval("UserName")%></td>          
                            <td align ="center" ><%#Eval("Nick")%></td>
                            <td align ="center" ><%#Eval("CreationDate")%></td>
                            <td align ="center" ><%#Eval("Email")%></td>                        
                            <td align ="center" >
                                 <a href="UserUpdate.aspx?ID=<%#Eval("ID") %>" ><img alt="编辑" src="/Skins/default/images/box_an9.gif"/></a>
                                 <a href="#" onclick="delUser('<%#Eval("ID") %>');" ><img alt="删除" src="/Skins/default/images/box_an6.gif"/></a>
                                <asp:HyperLink ID="hlLock" NavigateUrl="#" runat="server"></asp:HyperLink>
                                <asp:HyperLink ID="hlAuthent" NavigateUrl="#" runat="server"></asp:HyperLink>    
                            </td>
                            </tr>
                   </ItemTemplate>
                   <FooterTemplate>                        
                       </table>
                   </FooterTemplate>               
               </asp:Repeater>
               <uc1:PageControl ID="Page2" runat="server" ShowFirstLast="true" ShowPrevNext="true" 
                FirstPageText="首 页" LastPageText="末 页" PrevPageText="上一页" NextPageText="下一页" AlwaysShow="true"             ShowCustomInfoSec="left" NumericButtonCount="5" PagingButtonSpacing="20px" 
                CustomInfoHTML="当前 %CurrentPageIndex% 页 共 %PageCount% 页" CustomInfoClass="pageCount" InputBoxHeight="16" SubmitButtonClass="GoClass" />
            </div>
        </div>
    </div>   
    </form>
</body>

<script type = "text/javascript" language = "javascript">
    function delUser(id){
//        M("aaa","body_box");
//        return;
        if (id == "") {
            M1("无参数传递!");
            return;
        }
        
        if (C("确认删除此用户?") == false)
        {
            return;
        }
        var ret = UserList.DelUser(id).value;
        if (ret == true)
        {
            M1("Success!");
            refreshPage(0);  
        }
    }
    function delUsers(){
        var ids = "";
        for (var i=0;i<document.form1.checkboxid.length;i++) {
            var e=document.form1.checkboxid[i];
            if ( e.checked) {
                ids = ids + e.value + ","
            }
        }        
        if (ids == ""){
            M1("请选择需要删除的用户!");
            return;
        }
        if (C("确认删除这些用户?") == false)
        {
            return;
        }
        if (ids != "" && ids.lastIndexOf(",") == ids.length -1 ){
            ids = ids.substring(0,ids.length - 1)
        }
        
        ids = ids.split(",");
//        alert(ids);
        var ret = UserList.DelUsers(ids).value;
        if (ret == true)
        {
            M1("Success!");            
            refreshPage(0);  
        }
        else{
            M1("Faild!");            
        }        
    }
    function lockUser(id,lock){
         if (id == "") {
            M1("无参数传递!");
            return;
        }
        var ret = UserList.LockUser(id,lock).value;
        if (ret == true)
        {
            M1("Success!");
            refreshPage(0);  
        }
    } 
    function authentUser(id,authent){
         if (id == "") {
            M1("无参数传递!");
            return;
        }
        var ret = UserList.AuthentUser(id,authent).value;
        if (ret == true)
        {
            M1("Success!");
            refreshPage(0);  
        }
    } 
</script>
</html>
