<%@ 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">
		
		<LINK href="../../css/style.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="../../js/My97DatePicker/WdatePicker.js" defer type="text/javascript"></script>
		<script language="JavaScript" src="../../js/common.js" type="text/javascript"></script>

	</HEAD>
	
	<body leftMargin="0" topMargin="0">
		<form id="Form1" method="post" runat="server">
			<TABLE id="Table1" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<TR>
					<TD vAlign="top">
						<TABLE class="sys_grid" id="Table4" cellSpacing="1" cellPadding="1" width="100%" border="1">
							<TR>
								<TD class="sys_grid_head_cell"><FONT face="宋体">查询条件</FONT></TD>
							</TR>
							<TR>
								<TD><FONT face="宋体"></FONT>
									<TABLE class="sys_grid" id="Table5" cellSpacing="1" cellPadding="1" width="100%" border="1">
										<TR>
											<TD width="10%" style="height: 26px"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label3" runat="server" ForeColor="Navy">员工部门</asp:label></TD>
											<TD width="30%" style="height: 26px"><asp:dropdownlist id="ddl_dept" runat="server" Width="115px">
													<asp:ListItem Value=" ">aa</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD width="10%" style="height: 26px"><FONT face="宋体">&nbsp;
													<asp:label id="Label2" runat="server" ForeColor="Navy">体检日期</asp:label></FONT></TD>
											<TD width="20%" style="height: 26px"><INPUT class="sys_editbox" id="tb_check_date" style="WIDTH: 115px" type="text" name="tb_check_date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													runat="server"></TD>
											<TD align="center" width="10%" style="height: 26px"><FONT face="宋体">至</FONT></TD>
											<TD width="20%" style="height: 26px"><INPUT class="sys_editbox" id="tb_check_date_to" style="WIDTH: 115px" type="text" name="tb_check_date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													runat="server"></TD>
										</TR>
										<TR>
											<TD style="HEIGHT: 20px" width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label11" runat="server" ForeColor="Navy">自定义字段</asp:label></TD>
											<TD style="HEIGHT: 20px" 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.factory_date">进厂日期</asp:ListItem>
													<asp:ListItem Value="U.BIRTH_DATE">出生日期</asp:ListItem>
													<asp:ListItem Value="u.branch">分部</asp:ListItem>
													<asp:ListItem Value="u.class">班组</asp:ListItem>
													<asp:ListItem Value="u.work_type">工作岗位</asp:ListItem>
													<asp:ListItem Value="u.health">健康状况</asp:ListItem>
												</asp:dropdownlist></TD>
											<TD style="HEIGHT: 20px" width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label12" runat="server" ForeColor="Navy">比较操作符</asp:label></TD>
											<TD style="HEIGHT: 20px" 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 style="HEIGHT: 20px" width="10%"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label13" runat="server" ForeColor="Navy">字段值</asp:label></TD>
											<TD style="HEIGHT: 20px" 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%" style="height: 32px"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label4" runat="server" ForeColor="Navy">体检种类</asp:label></TD>
											<TD width="30%" style="height: 32px"><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%" style="height: 32px"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label9" runat="server" ForeColor="Navy">比较操作符</asp:label></TD>
											<TD width="20%" style="height: 32px"><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%" style="height: 32px"><FONT face="宋体">&nbsp; </FONT>
												<asp:label id="Label10" runat="server" ForeColor="Navy">字段值</asp:label></TD>
											<TD width="20%" style="height: 32px"><asp:textbox id="tb_value" runat="server" Width="115px" CssClass="stringedit"></asp:textbox></TD>
										</TR>
									</TABLE>
								</TD>
							</TR>
							<TR>
								<TD class="sys_grid_head_cell"><FONT face="宋体">查询内容</FONT></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>
								<TD align="center"><FONT face="宋体"><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;&nbsp;
										<asp:button id="btnreset" tabIndex="4" runat="server" Width="60px" CssClass="sys_button" Text="重 置"
											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></FONT></TD>
							</TR>
							<TR>
								<TD><asp:datagrid id="grd" runat="server" Width="100%" CssClass="sys_grid" PageSize="5" AllowPaging="True">
										<ItemStyle Height="25px"></ItemStyle>
										<HeaderStyle HorizontalAlign="Center" Height="25px" CssClass="sys_grid_head_cell"></HeaderStyle>
										<PagerStyle Visible="False"></PagerStyle>
									</asp:datagrid></TD>
							</TR>
						</TABLE>
						<uc2:pager id="Pager1" runat="server"></uc2:pager>
						<INPUT id="hd" type="hidden" name="hd" runat="server"> <INPUT id="ck" type="hidden" name="ck" runat="server">
					</TD>
				</TR>
				<TR>
					<TD height="5%"><FONT face="宋体"><asp:label id="Label1" runat="server" ForeColor="Navy" Visible="False"></asp:label></FONT></TD>
				</TR>
			</TABLE>
			&nbsp;
		</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.factory_date")
							{
								sqlurl+=",convert(varchar(10),u.factory_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 OnClickCheck2(s1,s2)
            {
               window.showModalDialog('../showModal.aspx?url='+s1+'?ID='+s2,'','dialogWidth:700px;dialogHeight:550px;help:no;status:no;dialogHide:yes;scrollbars:no;center:yes');
	        }  
		</SCRIPT>
	</body>
</HTML>
