gz_cx_bh.jsp
来自「JSP页面和oracle9i数据库的源代码」· JSP 代码 · 共 255 行
JSP
255 行
<%@ 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">
<title>按姓名查询职工工资信息</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {
font-size: 24px;
color: #FFFFFF;
}
.style4 {font-size: 14px}
.style5 {color: #FFFFFF; font-size: 14px; }
.style6 {font-size: 12px}
body {
background-image: url(../img/BK991.GIF);
}
-->
</style>
<script Language="javaScript">
function validate()
{
if (document.form1.bh.value=="")
{
alert("请输入要查询员工工资的姓名!");
document.form1.bh.focus();
return false ;
}
}
</script>
</head>
<body>
<jsp:useBean id="conn" scope="page" class="beans1.conn"/>
<div align="center">按编号查询职工工资信息页面
<%try{
String page_type=(String)session.getAttribute("page_type");
String page_name=(String)session.getAttribute("page_name");
ResultSet rs=null;
String condition=null;
if(page_type==null){page_type="";}
if(session.isNew()){response.sendRedirect("../index.jsp");}
else
{ if(!page_type.equals("sgz")&&(!page_type.equals("super")))
{response.sendRedirect("../index.jsp");}
}
%>
<%String meb=response.encodeURL("gz_cx_bh.jsp");%>
</div>
<form name="form1" method="post" action="<%=meb%>" onsubmit="return validate()">
<div align="center">请输入职工编号:
<input name="bh" type="text" id="bh" size="20" maxlength="8">
<input type="submit" name="Submit" value="查询">
<a <%String meb2=response.encodeURL("../index/gz_index.jsp");%>href="<%=meb2%>">返回主菜单</a></div>
</form>
<div align="center">
<%String bh=conn.toChinese(request.getParameter("bh"));
if(bh==null){bh="";}
String pageNO=request.getParameter("pageNO");
if(pageNO==null){pageNO="1";}
int pageNO_c=Integer.parseInt(pageNO);
int all=0;//记录总数
int pagecount=1;//规定每页显示记录的个数
int pageall=0;//逻辑总页数
int i=0;
if(bh.equals("")){}
else
{ condition="select BZGZ.BH,BZGZ.BM,ZGXX.XM,BZGZ.GZ,BZGZ.RGZ,BZGZ.GT,BZGZ.CS,BZGZ.CJ,BZGZ.CZ,BZGZ.JT,BZGZ.JZ,BZGZ.FZ,BZGZ.SYY,BZGZ.ST,BZGZ.BT,BZGZ.KQQ,BZGZ.KBJ,BZGZ.LFDG,BZGZ.LT,BZGZ.FT,BZGZ.ZFT,BZGZ.DWT,BZGZ.GL,BZGZ.ZYB,BZGZ.GWX,BZGZ.BJ,BZGZ.YW,BZGZ.FANGTIE,BZGZ.JIAOTONG,BZGZ.SB,BZGZ.MT,BZGZ.WS,BZGZ.YB,BZGZ.YL,BZGZ.KFZ,BZGZ.KHF,BZGZ.KGJJ,BZGZ.WJ,BZGZ.YE,BZGZ.SL,BZGZ.QT,BZGZ.BX,BZGZ.LQ,BZGZ.JCNY from BZGZ,ZGXX where ZGXX.BH='"+bh+"' and BZGZ.BH=ZGXX.BH";
//condition="select * from BZGZ where BM="+"'"+bm+"'";
rs=conn.executeQuery(condition);
while(rs.next())
{all++;}
if(all>0)
{ out.print("找到工号为"+'"');out.print(bh);out.print('"'+"的职工及其信息共");out.print(all);out.print("条");
if(all<=pagecount){pageall=1;}
else
{ int lastcount=0;//余数
lastcount=all%pagecount;
if(lastcount==0){pageall=all/pagecount;}//如果记录总数除以每页的显示个数,余数等于0,那么逻辑页数应为所得的商
else{pageall=all/pagecount+1;}//否则,逻辑页数应为商+1
}
%>
</div>
<hr align="center" width="1000">
<div align="center">第<%=pageNO_c%>页
<%if(pageNO_c>1){String page_send=Integer.toString(1);%>
<a href="<%=meb%>?pageNO=<%=page_send%>&bh=<%=bh%>">第一页</a>
<%}%>
<%if(pageNO_c>1){String page_send=Integer.toString(pageNO_c-1);%>
<a href="<%=meb%>?pageNO=<%=page_send%>&bh=<%=bh%>">上一页</a>
<%}%>
<%if(pageNO_c<pageall){String page_send=Integer.toString(pageNO_c+1);%>
<a href="<%=meb%>?pageNO=<%=page_send%>&bh=<%=bh%>">下一页</a>
<%}%>
<%if(pageNO_c<pageall){String page_send=Integer.toString(pageall);%>
<a href="<%=meb%>?pageNO=<%=page_send%>&bh=<%=bh%>">最末页</a>
<%}%>
共<%=pageall%>页
<%
//condition="select BZGZ.BH,BZGZ.BM,ZGXX.XM,BZGZ.JBBZGZ,BZGZ.RBZGZ,BZGZ.GT,BZGZ.CS,BZGZ.CJ,BZGZ.CZ,BZGZ.JT,BZGZ.JZ,BZGZ.FZ,BZGZ.SYY,BZGZ.ST,BZGZ.BT,BZGZ.KQQ,BZGZ.KBJ,BZGZ.LFDG,BZGZ.LT,BZGZ.FUT,BZGZ.DC,BZGZ.DWT,BZGZ.GL,BZGZ.ZYB,BZGZ.GW,BZGZ.BJ,BZGZ.YW,BZGZ.FANGT,BZGZ.JTONG,BZGZ.SB,BZGZ.MT,BZGZ.WS,BZGZ.YB,BZGZ.YL,BZGZ.KFZ,BZGZ.KHF,BZGZ.JK,BZGZ.WJ,BZGZ.YE,BZGZ.SL,BZGZ.QT,BZGZ.BX,BZGZ.LQ,BZGZ.JCNY from BZGZ,ZGXX where BZGZ.BM='"+bm+"' and BZGZ.BH=ZGXX.BH";
//out.print(condition);
rs=conn.executeQuery(condition);
for(i=0;i<(pageNO_c-1)*pagecount;i++){rs.next();}//规定RS记录指针的位置
for(i=0;i<pagecount;i++)//循环显示
{ if(!rs.next()){break;}
%>
<table width="941" border="1" align="center" cellspacing="1" bordercolor="#D2A3FF">
<tr bgcolor="#D2A3FF">
<td height="30" colspan="10"><div align="center" class="style2">职工工资信息表</div></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">编号:</span></div></td>
<td width="74" height="20"><%=rs.getString("BH")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">姓名:</span></div></td>
<td width="76" height="20"><%=rs.getString("XM")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">扣病假:</span></div></td>
<td width="122" height="20"><%=rs.getFloat("KBJ")%></td>
<td width="55" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 保健:</span></div></td>
<td width="77" height="20"><%=rs.getFloat("BJ")%></td>
<td width="101" bgcolor="#D2A3FF" class="style5"> <div align="left">应领:</div></td>
<td width="80"><%=rs.getFloat("YL")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">所在部门:</span></div></td>
<td width="74" height="20"><%=rs.getString("BM")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style5">基本工资:</div></td>
<td width="76" height="20"><%=rs.getFloat("GZ")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 粮副地工:</span></div></td>
<td width="122" height="20"><%=rs.getFloat("LFDG")%></td>
<td width="55" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 业务:</span></div></td>
<td width="77" height="20"><%=rs.getFloat("YW")%></td>
<td width="101" height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">扣房租:</div></td>
<td width="80" height="20"><%=rs.getFloat("KFZ")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">超时:</span></div></td>
<td width="74" height="20"><%=rs.getFloat("CS")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">工天:</span></div></td>
<td width="76" height="20"><%=rs.getFloat("GT")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 粮贴:</span></div></td>
<td width="122" height="20"><%=rs.getFloat("LT")%></td>
<td width="55" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 房贴:</span></div></td>
<td width="77" height="20"><%=rs.getFloat("FANGTIE")%></td>
<td width="101" height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">扣会费:</div></td>
<td width="80" height="20"><%=rs.getFloat("KHF")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">超价:</span></div></td>
<td width="74" height="20"><%=rs.getFloat("CJ")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">日工资:</span></div></td>
<td width="76" height="20"><%=rs.getFloat("RGZ")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 副贴:</span></div></td>
<td width="122" height="20"><%=rs.getFloat("FT")%></td>
<td width="55" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 交通:</span></div></td>
<td width="77" height="20"><%=rs.getFloat("JIAOTONG")%></td>
<td width="101" height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">扣公积金:</div></td>
<td width="80" height="20"><%=rs.getFloat("KGJJ")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">超资:</span></div></td>
<td width="74" height="20"><%=rs.getFloat("CZ")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">上月余:</span></div></td>
<td width="76" height="20"><%=rs.getFloat("SYY")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 地差:</span></div></td>
<td width="122" height="20"><%=rs.getFloat("ZFT")%></td>
<td width="55" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 书报:</span></div></td>
<td width="77" height="20"><%=rs.getFloat("SB")%></td>
<td width="101" height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">违纪:</div></td>
<td width="80" height="20"><%=rs.getFloat("WJ")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">加天:</span></div></td>
<td width="74" height="20"><%=rs.getFloat("JT")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">事天:</span></div></td>
<td width="76" height="20"><%=rs.getFloat("ST")%></td>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1"> 工龄:</span></div></td>
<td height="20"><%=rs.getFloat("GL")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">煤贴:</div></td>
<td height="20"><%=rs.getFloat("MT")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">余额:</div></td>
<td height="20"><%=rs.getFloat("YE")%></td>
</tr>
<tr>
<td width="101" height="20" bgcolor="#D2A3FF"><div align="left" class="style4"><span class="style1">加资:</span></div></td>
<td height="20"><%=rs.getFloat("JZ")%></td>
<td height="20" bgcolor="#D2A3FF"><div align="left"><span class="style5">病天:</span></div></td>
<td height="20"><%=rs.getFloat("BT")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">中夜班:</div></td>
<td height="20"><%=rs.getFloat("ZYB")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">卫生:</div></td>
<td height="20"><%=rs.getFloat("WS")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">实领:</div></td>
<td height="20"><%=rs.getFloat("SL")%></td>
</tr>
<tr bgcolor="#FF99CC">
<td height="20" bgcolor="#D2A3FF"><div align="center" class="style5">
<div align="left">浮资:</div>
</div></td>
<td height="20" bgcolor="#FFFFFF"><%=rs.getFloat("FZ")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"><div align="left">扣缺勤:</div></td>
<td height="20" bgcolor="#FFFFFF"><%=rs.getFloat("KQQ")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">岗位:</div></td>
<td height="20" bgcolor="#FFFFFF"><%=rs.getFloat("GWX")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">药补:</div></td>
<td height="20" bgcolor="#FFFFFF"><%=rs.getFloat("YB")%></td>
<td height="20" bgcolor="#D2A3FF" class="style5"> <div align="left">其它:</div></td>
<td height="20" bgcolor="#FFFFFF"><%=rs.getFloat("QT")%></td>
</tr>
<tr>
<td bgcolor="#D2A3FF" class="style5"> <div align="left">保险: </div></td>
<td><%=rs.getFloat("BX")%></td>
<td bgcolor="#D2A3FF" class="style5"><div align="left">领签:</div></td>
<td><%=rs.getString("LQ")%></td>
<td bgcolor="#D2A3FF" class="style5"> <div align="left">进厂年月:</div></td>
<td><%=rs.getDate("JCNY")%></td>
<td bgcolor="#D2A3FF"> </td>
<td> </td>
<td bgcolor="#D2A3FF"> </td>
<td> </td>
</tr>
</table>
</div>
<div align="center"></div>
<div align="center">
<hr align="center" width="1000">
<%
}
}
else
{ if(all==0){out.print("没有找到工号为"+'"');out.print(bh);out.print('"'+"的职工及其信息");}
if(all<0){out.print("系统错误!请关闭网页重新登入!如有疑问请与软件开发商联系!");}
}
}
}catch(Exception e) {out.print(e.getMessage());}
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?