<%@ page language="vb" autoeventwireup="false" inherits="WebExam.Web.ulist, App_Web_42kyxftl" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head runat="server">
    <title>选择用户</title>
   
    <link href="../../../style/main.css" type="text/css" rel="stylesheet" />


</head>
<body>
<script language="javascript" src="../../../jslib/requestUrl.js"></script>
		<script language="vbscript" src="../../../jslib/URLDecode.vbs"></script>
   

    <script language="javascript">
<!--

function checkselect() {
   
   var checklength=Form1.select.length
 
   if (checklength==undefined)
   {
     if (Form1.select.checked)
     {return true}
   }
  
  for(var i=0; i<checklength;i++)
   {
     if (Form1.select(i).checked)
      return true
   }
  
  return false;
  
}
function userInfo_onclick(userid) {
 //window.showModelessDialog('adduser.aspx'+window.location.search,'','scroll:yes;Status:no;help:no');
    var newwin=window.open('../userInfo.aspx?userid='+escape(userid),"msgWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=500,screenX=1,screenY=1,top=" + (screen.AvailHeight-500)/2 +",left=" +(screen.AvailWidth-540)/2);
    newwin.focus();
    
  //window.top.location ='userInfo.aspx?userid='+userid
}
function btnadd_onclick() {
  
  if (!checkselect())
   {
  alert("请先选择用户！")
  return false}
  
  var checklength=Form1.select.length
  var selectUsers=new Array(); 
  if (checklength==undefined)
   {
     if (Form1.select.checked)
     {selectUsers[selectUsers.length]=Form1.select.value;}
   }
   else {
   
   for(var i=0; i<checklength;i++)
      if(Form1.select(i).checked)selectUsers[selectUsers.length]=Form1.select(i).value;
      
   }
   
   var returnDate=new Array();
   returnDate[returnDate.length]=selectUsers;
  
  
      parent.rightIframe.add(returnDate);
parent.$.modal.close()
 

  
}


function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name == 'select')
       e.checked = form.chkall.checked;
    }
   
  }
function disabledCheckAll(form,ck)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
       e.disabled = ck.checked;
    }
    form.selectAll.disabled = ck.checked;
  }
 
//-->
    </script>
    <form id="Form1" method="post" runat="server">
    <table border="0">
        <tr>
            <td>
                <asp:GridView ID="GV_userlist" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    ForeColor="#333333" GridLines="None">
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemStyle Width="30px"></ItemStyle>
                            <ItemTemplate>
                                <input type="checkbox" value='<%# DataBinder.Eval(Container.DataItem, "id") %>' name="select"
                                 />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="id" HeaderText="用户名" ReadOnly="True" />
                        <asp:BoundField DataField="userName" HeaderText="姓名" />
                        <asp:CheckBoxField DataField="isMan" HeaderText="男" />
                        <asp:BoundField DataField="birthday" HeaderText="出生年月" />
                        <asp:BoundField DataField="Email" HeaderText="电子信箱" />
                       
                    </Columns>
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </asp:GridView>
                
            </td>
        </tr>
     
        <tr>
            <td>
               <pagers:PageNumbersPager ID="PageNumbersPager1" runat="server" />
            </td>
        </tr>
           
        <tr>
            <td><input id="selectAll" name="chkall" onclick="CheckAll(this.form)" type="checkbox" value="on" /><label for="selectAll"><strong>选中所有目前显示的用户</strong></label>
                
            </td>
        </tr>
     
        
        <tr>
            <td align="center">
                <input language="javascript" id="btnadd" onclick="return btnadd_onclick();" type="button"
                    value="确定" name="btnadd">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
