X
xiaotianwangzi
Unregistered / Unconfirmed
GUEST, unregistred user!
我看了,好象没有问题,不知道为什么
<HEAD><font size=6 align="center"><h1 align="center">职工工资设定</h1></font>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=GB2312">
</head>
<body bgcolor="#ccccff" width="40%">
<%!
public String getStr(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("GBK");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
public String getStr1(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("ISO8859-1");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%
int i;
String bmbh=new String();
bmbh=(String)session.getValue("bmbh3");
String bmmc=new String();
bmmc=(String)session.getValue("bmmc3");
String xh=new String();
xh=(String)session.getValue("xh3");
String zgbh=new String();
String zgxm=new String();
zgxm=(String)session.getValue("zgxm3");
String zbsj=new String();
String zbnf=new String();
String zbyf=new String();
String gwlb=new String();
String zgjt=new String();
String zgyb=new String();
String sbjj=new String();
String yljj=new String();
String yhjb=new String();
String sfje=new String();
String yfje=new String();
String sql=new String();
java.text.SimpleDateFormat SDateFormater = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.util.Date d = new java.util.Date();
DateFormat defaultFormat = DateFormat.getDateTimeInstance();
DateFormat shortFormat = DateFormat.getDateTimeInstance (DateFormat.SHORT,DateFormat.SHORT);
DateFormat mediumFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);
DateFormat longFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
DateFormat fullFormat = DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
String defaultDate = defaultFormat.format(d);
String shortDate = shortFormat.format(d);
String mediumDate = mediumFormat.format(d);
String longDate = longFormat.format(d);
String fullDate = fullFormat.format(d);
zgbh=(String)session.getValue("zgbh3");
zbsj=defaultDate;
zbnf=""+calendar.getYear();
zbyf=calendar.getMonthnum();
gwlb=(String)session.getValue("gwlb3");
zgjt=request.getParameter("zgjt");
zgyb=request.getParameter("zgyb");
sbjj=request.getParameter("sbjj");
yljj=request.getParameter("yljj");
yhjb=request.getParameter("yhjb");
sfje=request.getParameter("sfje");
String zgxm1=getStr(zgxm);
//将职工姓名和部门名称进行编码,以便插入数据库。
String bmmc1=getStr(bmmc);
String yhjb1=getStr1(yhjb);
i=zgjt.length()*zgyb.length()*sbjj.length()*yljj.length()*yhjb.length()*sfje.length();
String sql2=new String();
if(i==0){
%>
<div align="center">
<br>
<font face="宋体" size=4>对不起,您有未填的项,请您检查</font></br>
<br>
<br>
<a href="yggz.html">返回</a>
</div>
<%
} else
{
do
uble zgjt1 =do
uble.parseDouble(zgjt);
do
uble zgyb1 =do
uble.parseDouble(zgyb);
do
uble sbjj1 =do
uble.parseDouble(sbjj);
do
uble yljj1 =do
uble.parseDouble(yljj);
do
uble sfje1 =do
uble.parseDouble(sfje);
do
uble yfje1 = (zgjt1+zgyb1+sbjj1+yljj1);
/*****************************************************************
//String ss=new String();
//ss="select * from rs_ygzls where zbyf='"+zbyf+"'";
// ResultSet rs=hyg.executeQuery(ss);
// int flag=1;
// if(rs.next()){
// flag=0;
// }
// rs.close();
// if(flag==1){
// %>
// <%
*******************************************************************************也就是上面的一段在程序中没有其到控制作用。
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
sql="insert into rs_ygzxx(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
}catch(Exception e){
System.out.println("对不起,出错了");
}
stmt.executeUpdate(sql2);
stmt.executeUpdate(sql);
stmt.close();
conn.close();
%>
<h3><font ><%=zgxm1%>你好,工资设置成功</font></h3>
<h3><%=flag%></h3>
<br>
<br>
<div align="center">
<table width="80%" border="1" align="center" cellspacing="0" cellpadding="0">
<tr><td>部门编号:</td><td><%=bmbh%>
<td>部门名称:</td><td><%=bmmc1%></tr>
<tr><td>序号:</td><td><%=xh%>
<td>职工姓名:</td><td><%=zgxm1%></tr>
<tr><td>用户级别:</td><td><%=yhjb1%>
<td>岗位类别:</td><td><%=gwlb%></tr>
<tr><td>职工津贴:</td><td><%=zgjt1%>
<td>职工月补:</td><td><%=zgyb1%></tr>
<tr><td>社保基金:</td><td><%=sbjj1%>
<td>医疗基金:</td><td><%=yljj%></tr>
<tr><td>应发金额:</td><td><%=yfje1%>
<td>实发金额:</td><td><%=sfje1%></tr>
</table>
<p>
如果设置完成,请<a href="jxglxt.html">返回首页</a>
<br><a href="yggz.html">继续设置</a>
</div>
<%
}
else
{
*******************************************************************
因为没有控制,所以下面的也没有执行,
String sqlupdate=new String();
String sqlindex=new String();
sqlindex="update rs_ygzls set ryjt='"+zgjt1+"',zgyb='"+zgyb1+"',sbjj='"+sbjj1+"',zbsj='"+zbsj+"',zbnf='"+zbnf+"',zbyf='"+zbyf+"',yljj='"+yljj1+"',jb='"+yhjb1+"',sfje='"+sfje1+"',yfje='"+yfje1+"'where xh='"+xh+"'";
sqlupdate="update rs_ygzxx set ryjt='"+zgjt1+"',zgyb='"+zgyb1+"',sbjj='"+sbjj1+"',zbsj='"+zbsj+"',zbnf='"+zbnf+"',zbyf='"+zbyf+"',yljj='"+yljj1+"',jb='"+yhjb1+"',sfje='"+sfje1+"',yfje='"+yfje1+"'where xh='"+xh+"'";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn1=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt1=conn1.createStatement();
stmt1.executeUpdate(sqlupdate);
stmt1.executeUpdate(sqlindex);
stmt1.close();
conn1.close();
%>
<div align="center">
<p><p><p><p><hr>
<br>用户已经设置完成,您已经对他的工资进行了修改</br>
<p><p><p><p>
<font align="center"><a href="yggz.html">返回</a></font>
</div>
<%
}
}
%>
</body>
</html>
<HEAD><font size=6 align="center"><h1 align="center">职工工资设定</h1></font>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=GB2312">
</head>
<body bgcolor="#ccccff" width="40%">
<%!
public String getStr(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("GBK");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
public String getStr1(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("ISO8859-1");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%
int i;
String bmbh=new String();
bmbh=(String)session.getValue("bmbh3");
String bmmc=new String();
bmmc=(String)session.getValue("bmmc3");
String xh=new String();
xh=(String)session.getValue("xh3");
String zgbh=new String();
String zgxm=new String();
zgxm=(String)session.getValue("zgxm3");
String zbsj=new String();
String zbnf=new String();
String zbyf=new String();
String gwlb=new String();
String zgjt=new String();
String zgyb=new String();
String sbjj=new String();
String yljj=new String();
String yhjb=new String();
String sfje=new String();
String yfje=new String();
String sql=new String();
java.text.SimpleDateFormat SDateFormater = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.util.Date d = new java.util.Date();
DateFormat defaultFormat = DateFormat.getDateTimeInstance();
DateFormat shortFormat = DateFormat.getDateTimeInstance (DateFormat.SHORT,DateFormat.SHORT);
DateFormat mediumFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);
DateFormat longFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
DateFormat fullFormat = DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
String defaultDate = defaultFormat.format(d);
String shortDate = shortFormat.format(d);
String mediumDate = mediumFormat.format(d);
String longDate = longFormat.format(d);
String fullDate = fullFormat.format(d);
zgbh=(String)session.getValue("zgbh3");
zbsj=defaultDate;
zbnf=""+calendar.getYear();
zbyf=calendar.getMonthnum();
gwlb=(String)session.getValue("gwlb3");
zgjt=request.getParameter("zgjt");
zgyb=request.getParameter("zgyb");
sbjj=request.getParameter("sbjj");
yljj=request.getParameter("yljj");
yhjb=request.getParameter("yhjb");
sfje=request.getParameter("sfje");
String zgxm1=getStr(zgxm);
//将职工姓名和部门名称进行编码,以便插入数据库。
String bmmc1=getStr(bmmc);
String yhjb1=getStr1(yhjb);
i=zgjt.length()*zgyb.length()*sbjj.length()*yljj.length()*yhjb.length()*sfje.length();
String sql2=new String();
if(i==0){
%>
<div align="center">
<br>
<font face="宋体" size=4>对不起,您有未填的项,请您检查</font></br>
<br>
<br>
<a href="yggz.html">返回</a>
</div>
<%
} else
{
do
uble zgjt1 =do
uble.parseDouble(zgjt);
do
uble zgyb1 =do
uble.parseDouble(zgyb);
do
uble sbjj1 =do
uble.parseDouble(sbjj);
do
uble yljj1 =do
uble.parseDouble(yljj);
do
uble sfje1 =do
uble.parseDouble(sfje);
do
uble yfje1 = (zgjt1+zgyb1+sbjj1+yljj1);
/*****************************************************************
//String ss=new String();
//ss="select * from rs_ygzls where zbyf='"+zbyf+"'";
// ResultSet rs=hyg.executeQuery(ss);
// int flag=1;
// if(rs.next()){
// flag=0;
// }
// rs.close();
// if(flag==1){
// %>
// <%
*******************************************************************************也就是上面的一段在程序中没有其到控制作用。
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
sql="insert into rs_ygzxx(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
}catch(Exception e){
System.out.println("对不起,出错了");
}
stmt.executeUpdate(sql2);
stmt.executeUpdate(sql);
stmt.close();
conn.close();
%>
<h3><font ><%=zgxm1%>你好,工资设置成功</font></h3>
<h3><%=flag%></h3>
<br>
<br>
<div align="center">
<table width="80%" border="1" align="center" cellspacing="0" cellpadding="0">
<tr><td>部门编号:</td><td><%=bmbh%>
<td>部门名称:</td><td><%=bmmc1%></tr>
<tr><td>序号:</td><td><%=xh%>
<td>职工姓名:</td><td><%=zgxm1%></tr>
<tr><td>用户级别:</td><td><%=yhjb1%>
<td>岗位类别:</td><td><%=gwlb%></tr>
<tr><td>职工津贴:</td><td><%=zgjt1%>
<td>职工月补:</td><td><%=zgyb1%></tr>
<tr><td>社保基金:</td><td><%=sbjj1%>
<td>医疗基金:</td><td><%=yljj%></tr>
<tr><td>应发金额:</td><td><%=yfje1%>
<td>实发金额:</td><td><%=sfje1%></tr>
</table>
<p>
如果设置完成,请<a href="jxglxt.html">返回首页</a>
<br><a href="yggz.html">继续设置</a>
</div>
<%
}
else
{
*******************************************************************
因为没有控制,所以下面的也没有执行,
String sqlupdate=new String();
String sqlindex=new String();
sqlindex="update rs_ygzls set ryjt='"+zgjt1+"',zgyb='"+zgyb1+"',sbjj='"+sbjj1+"',zbsj='"+zbsj+"',zbnf='"+zbnf+"',zbyf='"+zbyf+"',yljj='"+yljj1+"',jb='"+yhjb1+"',sfje='"+sfje1+"',yfje='"+yfje1+"'where xh='"+xh+"'";
sqlupdate="update rs_ygzxx set ryjt='"+zgjt1+"',zgyb='"+zgyb1+"',sbjj='"+sbjj1+"',zbsj='"+zbsj+"',zbnf='"+zbnf+"',zbyf='"+zbyf+"',yljj='"+yljj1+"',jb='"+yhjb1+"',sfje='"+sfje1+"',yfje='"+yfje1+"'where xh='"+xh+"'";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn1=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt1=conn1.createStatement();
stmt1.executeUpdate(sqlupdate);
stmt1.executeUpdate(sqlindex);
stmt1.close();
conn1.close();
%>
<div align="center">
<p><p><p><p><hr>
<br>用户已经设置完成,您已经对他的工资进行了修改</br>
<p><p><p><p>
<font align="center"><a href="yggz.html">返回</a></font>
</div>
<%
}
}
%>
</body>
</html>