<%@ Page language="c#" Codebehind="jkcx.aspx.cs" AutoEventWireup="True" Inherits="health.aspx.jkcx" %>
<%@ Register TagPrefix="uc2" TagName="Pager" Src="../../modules/Pager.ascx" %>

<HTML>
	<HEAD>
		<title>lxxx</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script language="javascript" src="../../js/My97DatePicker/WdatePicker.js" defer type="text/javascript"></script>
		<LINK href="../../css/style.css" type="text/css" rel="stylesheet">		
		<script language="JavaScript" src="../../js/common.js" type="text/javascript"></script>

	</HEAD>
	
	<body >
		<form id="Form1"  runat="server">
		<br>
			<TABLE id="Table1"  align="center" border="0" cellpadding="0" cellspacing="0" width="95%">
				<TR>
					<TD vAlign="top">
						<TABLE class="sys_grid" id="Table4" cellSpacing="0" cellPadding="0" width="100%" border="1">
							<TR>
								<TD class="sys_head_cell">&nbsp;<IMG src="../../Image/search.gif" align="absMiddle"><asp:Label ID="Label6" runat="server" Text="查询条件" Font-Bold="True"></asp:Label></TD>
							</TR>
							<TR>
								<TD><FONT face="宋体"></FONT>
									<TABLE class="sys_grid" id="Table5" cellSpacing="0" cellPadding="0" width="100%" border="1">
										<TR>
											<TD width="10%" ><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label3" runat="server" ForeColor="Navy">员工部门</asp:label></TD>
											<TD width="30%" ><asp:dropdownlist id="ddl_dept" runat="server" Width="115px">
													<asp:ListItem Value=" ">aa</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD width="10%" ><FONT face="宋体">&nbsp;
													<asp:label id="Label2" runat="server" ForeColor="Navy">体检日期</asp:label></FONT></TD>
													
													
											<TD width="20%" ><INPUT  class="Wdate" id="tb_check_date" style="WIDTH: 115px" type="text" name="tb_check_date" onfocus="var tb_check_date_to=$dp.$('tb_check_date_to');WdatePicker({onpicked:function(){tb_check_date_to.focus();},maxDate:'#F{$dp.$D(\'tb_check_date_to\')}'})"  runat="server"></TD>
											<TD width="10%" >&nbsp;<asp:Label ID="Label5" runat="server" ForeColor="Navy">至</asp:Label></TD>
											<TD width="20%" ><INPUT class="Wdate" id="tb_check_date_to" style="WIDTH: 115px" type="text" name="tb_check_date_to" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'tb_check_date\')}'})"  
													runat="server"></TD>
										</TR>
										<TR>
											<TD  width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label11" runat="server" ForeColor="Navy">自定义字段</asp:label></TD>
											<TD  width="30%"><asp:dropdownlist id="ddl_field1" runat="server" Width="115px" AutoPostBack="True" onselectedindexchanged="ddl_field1_SelectedIndexChanged">
													<asp:ListItem></asp:ListItem>
													<asp:ListItem Value="u.user_id">员工工号</asp:ListItem>
													<asp:ListItem Value="u.user_name">员工姓名</asp:ListItem>
													<asp:ListItem Value="u.sex">性别</asp:ListItem>
													<asp:ListItem Value="P.CHECK_DATE">体检日期</asp:ListItem>
													<asp:ListItem Value="u.job_date">工作时间</asp:ListItem>
													<asp:ListItem Value="u.work_type">工作岗位</asp:ListItem>
													<asp:ListItem Value="u.health">健康状况</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD  width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label12" runat="server" ForeColor="Navy">操作符</asp:label></TD>
											<TD  width="20%"><asp:dropdownlist id="ddl_tj1" runat="server" Width="115px">
													<asp:ListItem Value="like">好像</asp:ListItem>
													<asp:ListItem Value="&gt;">大于</asp:ListItem>
													<asp:ListItem Value="&gt;=">大于等于</asp:ListItem>
													<asp:ListItem Value="&lt;">小于</asp:ListItem>
													<asp:ListItem Value="&lt;=">小于等于</asp:ListItem>
													<asp:ListItem Value="&lt;&gt;">不等于</asp:ListItem>
													<asp:ListItem Value="=">等于</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD  width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label13" runat="server" ForeColor="Navy">字段值</asp:label></TD>
											<TD  width="20%"><asp:textbox id="tb_value1" runat="server" Width="115px" CssClass="stringedit" ontextchanged="tb_value1_TextChanged"></asp:textbox></TD>
										</TR>
										<TR>
											<TD width="10%" ><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label4" runat="server" ForeColor="Navy">体检种类</asp:label></TD>
											<TD width="30%" ><asp:dropdownlist id="ddl_pro_property" runat="server" Width="115px" AutoPostBack="True" onselectedindexchanged="ddl_pro_property_SelectedIndexChanged">
													<asp:ListItem></asp:ListItem>
												</asp:dropdownlist><asp:dropdownlist id="ddl_pro_property_old" runat="server" Width="115px" onselectedindexchanged="ddl_pro_property_old_SelectedIndexChanged">
													<asp:ListItem></asp:ListItem>
												</asp:dropdownlist></TD>
											<TD width="10%" ><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label9" runat="server" ForeColor="Navy">操作符</asp:label></TD>
											<TD width="20%" ><asp:dropdownlist id="ddl_tj" runat="server" Width="115px">
													<asp:ListItem Value="like">好像</asp:ListItem>
													<asp:ListItem Value="&gt;">大于</asp:ListItem>
													<asp:ListItem Value="&gt;=">大于等于</asp:ListItem>
													<asp:ListItem Value="&lt;">小于</asp:ListItem>
													<asp:ListItem Value="&lt;=">小于等于</asp:ListItem>
													<asp:ListItem Value="&lt;&gt;">不等于</asp:ListItem>
													<asp:ListItem Value="=">等于</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD width="10%" ><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label10" runat="server" ForeColor="Navy">字段值</asp:label></TD>
											<TD width="20%" ><asp:textbox id="tb_value" runat="server" Width="115px" CssClass="stringedit"></asp:textbox></TD>
										</TR>
									</TABLE>
								</TD>
							</TR>
							<TR>
								<TD class="sys_head_cell">&nbsp;<IMG src="../../Image/search.gif" align="absMiddle"><asp:Label ID="Label7" runat="server" Text="查询内容" Font-Bold="True"></asp:Label></TD>
							</TR>
							<TR>
								<TD><FONT face="宋体"><asp:panel id="Panel1" runat="server" Width="100%">
											<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="100%" border="0">
												<%=rows2%>
												<%=rows%>
											</TABLE>
										</asp:panel></FONT></TD>
							</TR>
							<TR style="height:30px">
								<TD align="center"><INPUT class="sys_button" id="btnsearch" style="WIDTH: 60px" onclick="getvalue();" tabIndex="1"
											type="button" value="查 询" name="Button1" runat="server" onserverclick="btnsearch_ServerClick">&nbsp;&nbsp;
											<INPUT class="sys_button" id="btn_all" style="WIDTH: 60px" onclick="selectall();" type="button" value="全 选" name="btn_all" runat="server" >&nbsp;
										<asp:button id="btnreset" tabIndex="4" runat="server" Width="60px" CssClass="sys_button" Text="重 置" OnClientClick="unselectall();"
											Height="22px" onclick="btnreset_Click"></asp:button>&nbsp;&nbsp;
										<asp:button id="btnout" tabIndex="2" runat="server" Width="60px" CssClass="sys_button" Text="导 出"
											Height="22px" Enabled="False" onclick="btnout_Click"></asp:button></TD>
							</TR>
							<TR>
								<TD><asp:GridView ID="gdv" runat="server" AllowPaging="True"
                        CssClass="sys_grid" OnRowDataBound="gdv_RowDataBound"   Width="100%" OnSorting="gdv_Sorting">
                        <HeaderStyle CssClass="sys_grid_head_cell" />
                        <PagerSettings Visible="False" />
                        <RowStyle HorizontalAlign="Center" Height="25px" />
                    </asp:GridView>									
									</TD>
							</TR>
						</TABLE>
						<uc2:pager id="Pager1" runat="server"></uc2:pager>
						<INPUT id="hd_ck" type="hidden" name="hd_ck" runat="server"> <INPUT id="ck" type="hidden" name="ck" runat="server">
					</TD>
				</TR>
			</TABLE>
			&nbsp; &nbsp;&nbsp; &nbsp;
            <asp:label id="Label1" runat="server" ForeColor="Navy" Visible="False"></asp:label></form>
		<SCRIPT language="javascript">
	       <%=msg%>; 
	      
	       var s='<%=url%>';
           if (s!='')
	         {
	          window.showModalDialog('<%=url%>','','dialogWidth:700px;dialogHeight:550px;help:no;status:no;dialogHide:yes;scrollbars:no;center:yes');
              s='';
             }
          
            function getvalue()
           {	 
				var a=document.getElementsByTagName("input");
                 var sqlurl="";
                 var chec="";
				 for(var i=0;i<a.length;i++)
				{
					if(a[i].type=="checkbox")
					{
						if(a[i].checked==true)
						{
							
							if(a[i].id=="u.dept_id")
							{
								sqlurl+=",(select dept_name from t_system_department b where b.id=u.dept_id) as 部门";
							}
							else if(a[i].id=="u.birth_date")
							{
								sqlurl+=",convert(varchar(10),u.birth_date,121) as 出生日期";
							}
							else if(a[i].id=="u.job_date")
							{
								sqlurl+=",convert(varchar(10),u.job_date,121) as 进厂日期";
							}
							 else if(a[i].id=="p.check_date")
							{
								sqlurl+=",convert(varchar(10),p.check_date,121) as 体检日期";
							}
							 else if(a[i].id=="p.report_date")
							{
								sqlurl+=",convert(varchar(10),p.report_date,121) as 报告日期";
							}
							else
							{
								sqlurl+=","+a[i].id+" as ["+a[i].name+"]";
							}
						
							chec+=","+a[i].id;
						}
					}
			   }	
		
			   document.forms(0).hd_ck.value=sqlurl;
			   document.forms(0).ck.value=chec;
				 
           }
          
          function selectall()
           {	 
				var a=document.getElementsByTagName("input");
                var sqlurl="";
                var chec="";
				for(var i=0;i<a.length;i++)
				{
					if(a[i].type=="checkbox")
					{							
						a[i].checked = true;
						if(a[i].id=="u.dept_id")
						{
							sqlurl+=",(select dept_name from t_system_department b where b.id=u.dept_id) as 部门";
						}
						else if(a[i].id=="u.birth_date")
						{
							sqlurl+=",convert(varchar(10),u.birth_date,121) as 出生日期";
						}
						else if(a[i].id=="u.job_date")
						{
							sqlurl+=",convert(varchar(10),u.job_date,121) as 进厂日期";
						}
						 else if(a[i].id=="p.check_date")
						{
							sqlurl+=",convert(varchar(10),p.check_date,121) as 体检日期";
						}
						 else if(a[i].id=="p.report_date")
						{
							sqlurl+=",convert(varchar(10),p.report_date,121) as 报告日期";
						}
						else
						{
							sqlurl+=","+a[i].id+" as ["+a[i].name+"]";
						}
					
						chec+=","+a[i].id;		

								
					}
			   }		
			   document.forms(0).hd.value=sqlurl;
			   document.forms(0).ck.value=chec;				 
           }
           
           function unselectall()
           {	 
				var a=document.getElementsByTagName("input");
                var sqlurl="";
                var chec="";
				for(var i=0;i<a.length;i++)
				{
					if(a[i].type=="checkbox")
					{							
						a[i].checked = false;
					}
			   }
			   document.forms(0).hd.value="";
			   document.forms(0).ck.value="";				 
           }
           
            function OnRowClickRefresh(s1,s2)
            {
               window.showModalDialog('../showModal.aspx?url='+s1+'?id='+s2,'','dialogWidth:620px;dialogHeight:620px;help:no;status:no;dialogHide:yes;scrollbars:no;center:yes');
            }
            
		</SCRIPT>
	</body>
</HTML>
