rs_print_card.jsp
来自「JSP页面和oracle9i数据库的源代码」· JSP 代码 · 共 203 行
JSP
203 行
<%@ 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">
<%
int all=0;
String newcondition=null;
newcondition="select * from ZGXX";
conn.setcondition(newcondition);
ResultSet rs=conn.getrs();
while(rs.next())
{all++;}
if(all==0){out.print("职工信息库中无记录!");}
rs.beforeFirst();
while(!rs.isAfterLast())
{
%>
</div>
<table width="100%" height="1000" cellpadding="5">
<tr>
<td valign="top">
<%for(int i=0;i<5;i++){%>
<table border="1" align="center" cellspacing="1" bordercolor="#FF99CC">
<%if(!rs.next()){break;}%>
<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>
<td nowrap><span class="style6"><%=rs.getString("GZBT")%></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("GRCF")%></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("JTDH")%></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("SJHM")%></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("JTCS")%></span></td>
<td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
<div align="right"><span class="style1">电子邮件地址:</span></div>
</div></td>
<td colspan="3" nowrap><div align="center" class="style6"><%=rs.getString("DZYJ")%></div></td>
</tr>
<tr>
<td nowrap bgcolor="#FF99CC"><div align="left" class="style6">
<div align="right"><span class="style1">家庭住址:</span></div>
</div></td>
<td colspan="7" nowrap><span class="style6"><%=rs.getString("JTZZ")%></span></td>
</tr>
<tr bgcolor="#FF99CC">
<td colspan="8" nowrap><div align="center" class="style5 style6">备注:</div></td>
</tr>
<tr>
<td height="22" colspan="8"><span class="style6"><%=rs.getString("BZ")%></span></td>
</tr>
<%}%>
</table>
</td>
</tr>
</table>
<%}%>
<script language="javascript">
window.focus();window.print();
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?