rs_print_gr.jsp

来自「JSP页面和oracle9i数据库的源代码」· JSP 代码 · 共 315 行 · 第 1/2 页

JSP
315
字号
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%@page import="java.util.Calendar"%>
<title>按姓名查询人事档案</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style5 {color: #FFFFFF; font-size: 12px; }
.style6 {font-size: 12px}
body {
	background-image: url(../img/allbg.gif);
}
-->
</style>
</head>
<body>
<div align="center">
<%
String page_type=(String)session.getAttribute("page_type");
String page_name=(String)session.getAttribute("page_name");
if(page_type==null){page_type="";}
if(session.isNew()){response.sendRedirect("../index.jsp");}
else
{	if(!(page_type.equals("rs")) && !page_type.equals("srs"))
	{response.sendRedirect("../index.jsp");}	
}
%>
</div>
<jsp:useBean id="conn" scope="page" class="beans.conn"/>

<div align="center">
<%
String bh=request.getParameter("bh");
if(bh==null){bh="";}
//if(bh=null){response.sendRedirect("../pring/rs_print_gr");}
String newcondition=null;
newcondition="select * from ZGXX where BH='"+bh+"'";
conn.setcondition(newcondition);
ResultSet rs=conn.getrs();
int all=0;
rs.last();
all=rs.getRow();
if(all==0){out.print("没有找到此编号用户");}
else
{	if(all>1){out.print("出现编号相同");}
	else {	rs.first();
%>
<%=rs.getString("XM")%>基本信息表
</div>
			<div align="center">
			</div>
		  <table border="1" align="center" cellspacing="1" bordercolor="#FF99CC">
                  <tr bgcolor="#FF99CC">
                    <td colspan="8" nowrap><div align="center" class="style6">基本信息表</div></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">编号:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("BH")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">姓名:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("XM")%></span></td>
                    <td width="91" nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">性别:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("XB")%></span></td>
                    <td width="91" nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">年龄:</span></div>
                    </div></td>
                    <td nowrap>
					  <span class="style6">
					  <%	Calendar birthday=Calendar.getInstance();	
						birthday.setTime(rs.getDate("CSNY"));
						Calendar day=Calendar.getInstance();
						int age=0;
						age=day.get(day.YEAR)-birthday.get(birthday.YEAR);
						if(day.get(day.MONTH)<birthday.get(birthday.MONTH)){age--;}
						if(day.get(day.MONTH)==birthday.get(birthday.MONTH))
						{if(day.get(day.DATE)<birthday.get(birthday.DATE)){age--;}}
					    out.print(age);
					%>
				    </span></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">所在部门:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("BM")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">现任职务:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("XRZW")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">出生年月:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getDate("CSNY")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">民族:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("MZ")%></span></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">籍贯:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("JG")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">政治面目:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("ZZMM")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">职称:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("ZC")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">文化程度:</span></div>
                    </div></td>
                    <td nowrap>
					  <span class="style6">
					  <%  int xl=rs.getInt("WHCD");
						String condition_xl="select * from XL where XLBH="+"'"+xl+"'";
						conn.setcondition(condition_xl);
						ResultSet rs_xl=conn.getrs();
						rs_xl.next();
					%>
					  <%=rs_xl.getString("XLMC")%></span></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">健康状况:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("JKZK")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">婚姻状况:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("HYZK")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">参加工作时间:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getDate("CJGZSJ")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">进本单位时间:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getDate("JBDWSJ")%></span></td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">基本工资:</span></div>
                    </div></td>
                    <td nowrap><span class="style6"><%=rs.getString("GZ")%></span></td>
                    <td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
                      <div align="right"><span class="style1">各种补贴:</span></div>
                    </div></td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?