<%@ Page language="c#" Codebehind="admin_deptMark.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.admin_deptMark" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<TITLE></TITLE>
		<LINK href="images/Site_Css.css" type="text/css" rel="stylesheet">
			<META http-equiv="Content-Type" content="text/html; charset=gb2312">
			<LINK href="images/Css.css" type="text/css" rel="stylesheet">
				<META content="MSHTML 6.00.6000.16544" name="GENERATOR">
				<script src="../js/calendar.js" type="text/javascript"></script>
				<script type="text/javascript" language="javascript" src="../js/function.js"></script>
	</HEAD>
	<BODY bgColor="#ffffff" topMargin="5" marginwidth="0" marginheight="0">
		<form name="Form1" method="post" id="Form1" runat="server">
			<DIV></DIV>
			<DIV>
				<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
					<TBODY>
						<TR>
							<TD class="menubar_title"><IMG hspace="3" src="images/default.gif" align="absMiddle" vspace="3" border="0">&nbsp;用户管理</TD>
							<TD class="menubar_readme_text" vAlign="bottom">&nbsp;</TD>
						</TR>
						<TR>
							<TD class="menubar_function_text" height="1">&nbsp;</TD>
							<TD class="menubar_menu_td" align="right">&nbsp;</TD>
						</TR>
						<TR>
							<TD colSpan="2" height="5"></TD>
						</TR>
					</TBODY></TABLE>
				<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
					<TBODY>
						<TR>
							<TD background="images/tab_top_bg.gif" height="22">
								<TABLE cellSpacing="0" cellPadding="0" border="0">
									<TBODY>
										<TR> <!--按钮　Start-->
											<TD>
												<TABLE height="22" cellSpacing="0" cellPadding="0" border="0">
													<TBODY>
														<TR>
															<TD width="3"><IMG id="tabImgLeft__0" height="22" src="images/tab_unactive_left.gif" width="3"></TD>
															<TD class="tab" id="tabLabel__0" onClick="javascript:tabClick(0,1)" background="images/tab_active_bg.gif"
																UNSELECTABLE="on">用户部门审核</TD>
															<TD width="3"><IMG id="tabImgRight__0" height="22" src="images/Menu/tab_active_right.gif" width="3"></TD>
														</TR>
													</TBODY></TABLE>
											</TD>
										</TR>
									</TBODY></TABLE>
							</TD>
						</TR>
						<TR>
							<TD bgColor="#ffffff">
								<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
									<TBODY>
										<TR>
											<TD width="1" background="images/tab_bg.gif"><IMG height="1" src="images/tab_bg.gif" width="1"></TD>
											<TD class="borderstyle" vAlign="top">
												<DIV id="tabContent__0">
													<asp:datagrid id="DataGrid" runat="server" CssClass="GridBody" AutoGenerateColumns="False" Width="100%"
														PageSize="20" AllowSorting="True">
														<AlternatingItemStyle CssClass="GridLine"></AlternatingItemStyle>
														<ItemStyle CssClass="GridItem"></ItemStyle>
														<HeaderStyle CssClass="GridHead"></HeaderStyle>
														<Columns>
															<asp:TemplateColumn HeaderText="选择">
																<HeaderStyle HorizontalAlign="Center" Width="3%"></HeaderStyle>
																<ItemStyle HorizontalAlign="Center"></ItemStyle>
																<HeaderTemplate>
																	<input type="checkbox" name="chkSelect" id="chkSelect" onClick='checkAll();' />
																</HeaderTemplate>
																<ItemTemplate>
																	<INPUT id=chkSelect onclick=AddRemoveValues(this) type=checkbox value='<%#DataBinder.Eval(Container.DataItem,"uusername")%>' name=checkbox>
																</ItemTemplate>
															</asp:TemplateColumn>
															<asp:HyperLinkColumn Text="用户名" DataNavigateUrlField="uusername" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}"
																DataTextField="uusername" SortExpression="uusername" HeaderText="用户名">
																<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
																<ItemStyle HorizontalAlign="Center"></ItemStyle>
															</asp:HyperLinkColumn>
															<asp:BoundColumn DataField="realname" SortExpression="realname" HeaderText="真实姓名">
																<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
																<ItemStyle HorizontalAlign="Center"></ItemStyle>
															</asp:BoundColumn>
															<asp:BoundColumn DataField="sex" SortExpression="sex" HeaderText="性别">
																<HeaderStyle HorizontalAlign="Center" Width="7%"></HeaderStyle>
																<ItemStyle HorizontalAlign="Center"></ItemStyle>
															</asp:BoundColumn>
                                                            <asp:TemplateColumn SortExpression="dept" HeaderText="旧部门">
																<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
																<ItemTemplate>
																	<%# showdept(DataBinder.Eval(Container, "DataItem.dept").ToString(),DataBinder.Eval(Container, "DataItem.dept2").ToString(),DataBinder.Eval(Container, "DataItem.dept3").ToString(),DataBinder.Eval(Container, "DataItem.dept4").ToString(),DataBinder.Eval(Container, "DataItem.dept5").ToString()) %>
																</ItemTemplate>
															</asp:TemplateColumn>
															<asp:TemplateColumn SortExpression="tempDept" HeaderText="新部门">
																<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
																<ItemTemplate>
                                                                    <%# showdept(DataBinder.Eval(Container, "DataItem.tempDept").ToString(),DataBinder.Eval(Container, "DataItem.dept2").ToString(),DataBinder.Eval(Container, "DataItem.dept3").ToString(),DataBinder.Eval(Container, "DataItem.dept4").ToString(),DataBinder.Eval(Container, "DataItem.dept5").ToString()) %>
                                                                </ItemTemplate>
															</asp:TemplateColumn>
															<asp:TemplateColumn SortExpression="role" HeaderText="角色">
																<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
																<ItemStyle HorizontalAlign="Center"></ItemStyle>
																<ItemTemplate>
																	<%# showrole(DataBinder.Eval(Container, "DataItem.role").ToString()) %>
																</ItemTemplate>
															</asp:TemplateColumn>
                                                            </Columns>
														<PagerStyle PageButtonCount="20" Mode="NumericPages"></PagerStyle>
													</asp:datagrid><webdiyer:AspNetPager id="Pager" runat="server" PageSize="20" AlwaysShow="True" ShowCustomInfoSection="Left"
														NumericButtonCount="15" HorizontalAlign="Right" ShowBoxThreshold="21" FirstPageText="<font face=webdings>9</font>"
														PrevPageText="<font face=webdings>3</font>" NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>"
														Height="20px" CssClass="page" onpagechanged="Pager_PageChanged"></webdiyer:AspNetPager>
												</DIV>
												<br>
												<strong>
													<div align="center">
														<p>查找用户：
															<asp:textbox id="key" runat="server" CssClass="tableTdtext"></asp:textbox>
															&nbsp;&nbsp;
															<asp:button id="Button2" runat="server" Width="50px" class="formbutton" Text="查找" onclick="Button2_Click"></asp:button>
															（请输入用户名）
															<asp:CheckBox id="mo" runat="server" Text="模糊查找"></asp:CheckBox>
															<!--内容框End-->
														</p>
															<asp:Panel id="Panel2" runat="server"><br>
															    勾选记录：
															<asp:button id="btnmark" runat="server" Width="50px" class="formbutton" Text="审核" onclick="btnmark_Click"></asp:button>
															    &nbsp;&nbsp;&nbsp;&nbsp;
                                                                <p>
                                                                    <br><strong>
                                                                    <input ID="button" name="button" onClick="checkselect();" type="button" 
                                                                        value=" 批量操作 "> </input></strong></br>
                                                                </p>
                                                                <p>
                                                                    <asp:CheckBox ID="all" runat="server" Text="以上操作对列出的所有页用户都生效（不选此项则仅对勾选的用户生效）" />
                                                                </p>
                                                        </asp:Panel>
															<input id="HdnSelectedValues2" type="hidden" name="HdnSelectedValues2" runat="server">
															<INPUT id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
														</p>
													</div>
												</strong>
											</TD>
											<TD width="1" background="images/tab_bg.gif"><IMG height="1" src="images/tab_bg.gif" width="1"></TD>
										</TR>
									</TBODY></TABLE>
							</TD>
						</TR>
						<TR>
							<TD background="images/tab_bg.gif" bgColor="#ffffff"><IMG height="1" src="images/tab_bg.gif" width="1"></TD>
						</TR>
					</TBODY></TABLE> <!--选项卡 End--></DIV>
		</form>
		<SCRIPT language="javascript">
		    function checkselect() {
		        if (document.Form1.HdnSelectedValues.value == "") {
		            alert('请选择多个用户再进行批量操作！');
		            return;
		        }
		        else {
		            document.bacth.hdvalue.value = document.Form1.HdnSelectedValues.value;
		            document.bacth.sql.value = getUrlParam('sql');
		            document.bacth.submit();
		        }
		    }
		    function getUrlParam(paramName) {
		        var s = location.search;
		        if (s != null) {
		            var sarr = s.substr(1).split("&");
		            var tarr;
		            for (i = 0; i < sarr.length; i++) {
		                tarr = sarr[i].split("=");
		                if (tarr.length == 2 && tarr[0].toLowerCase() == paramName) {
		                    return tarr[1];
		                }
		            }
		            return "";
		        }
		    }
        function tabClick(idx,count) {
          for (i_tr = 0; i_tr < count; i_tr++) {
              var tabImgLeft = eval('document.all.tabImgLeft__' + idx);
              var tabImgRight = eval('document.all.tabImgRight__' + idx);
              var tabLabel = eval('document.all.tabLabel__' + idx);
              var tabContent = eval('document.all.tabContent__' + idx);

              tabImgLeft.src = 'images/tab_active_left.gif';
              tabImgRight.src = 'images/tab_active_right.gif';
              tabLabel.background = 'images/tab_active_bg.gif';
              tabContent.style.visibility = 'visible';
              tabContent.style.display = 'block';
          }
        }
        tabClick(0,1);
		</SCRIPT>
		<BR>
	</BODY>
</HTML>
