⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addchang.jsp

📁 用jsp和Oracle写的人事管理系统
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312"%> 
<%@ include file="JSP/OPENDB.jsp"%>
<%! 
String replacenull(String a){ 
	if(a==null){
return "&nbsp;"; 
	}else{
return a; 
	}
} 
%> 
<%
String oabusyname = (String) session.getValue("oabusyname"); 
String oabusyusername = (String) session.getValue("oabusyusername"); 
String oabusyuserdept = (String) session.getValue("oabusyuserdept"); 
String oabusyuserlevel = (String) session.getValue("oabusyuserlevel"); 
if((oabusyusername==null)|(oabusyusername=="")){
response.sendRedirect("login.jsp"); 
}%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
<script language="javascript1.2" src="js/openwin.js"></script>
<title>人事管理系统</title>
</head>
<body bgcolor="#eeeeee" topmargin="5" leftmargin="5">
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td height=68>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="68">
          <tr>
            
<%String name;
//打开数据库读出用户名
String sql1="select name from scott.userinf where username='"+request.getParameter("username")+"'"; 
ResultSet rs=stmt.executeQuery(sql1); 
if(rs.next()){
name=rs.getString("name");
}else{
name="";
}
%>
<center>
<table>
<tr>
<td>
<b>增加<%=name%>的职位变动信息</b>&nbsp;&nbsp;
</td>
<%request.setCharacterEncoding("GB2312");%>
<form method="post" action="chang.jsp" name="form2"><td>
<input type="hidden" name="userdept" value="<%=request.getParameter("userdept")%>">
<input type="hidden" name="username" value="<%=request.getParameter("username")%>">
<input type="submit" value="返回">
</td>
</form>
</tr>
</table>
</center>
</td>
            
          </tr>
        </table>
      </td>
    </tr>
   <tr>
      <td valign=top>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td background="images/j4.gif" width=18 height=280></td>
            <td valign=top height=280>
<% String submit1="增加";
if(submit1.equals(request.getParameter("submit")))
 {String username,oldjob,changjob,changdate,changfile,changsort,changtype,changreason,recusername,updateusername;
username=request.getParameter("username");
oldjob=request.getParameter("oldjob");
changjob=request.getParameter("changjob");
changdate=request.getParameter("changdate");
changfile=request.getParameter("changfile");
changsort=request.getParameter("changsort");
changtype=request.getParameter("changtype");
changreason=request.getParameter("changreason");
recusername=oabusyname;
updateusername=oabusyname;

stmt.executeUpdate("INSERT INTO scott.changjob(username,oldjob,changjob,changdate,changfile,changsort,changtype,changreason,recusername,updateusername) VALUES(system.changjobid.nextval,'"+username+"', '"+oldjob+"','"+changjob+"','"+changdate+"','"+changfile+"','"+changsort+"','"+changtype+"','"+changreason+"','"+recusername+"','"+updateusername+"')");
%>
<br><br>
<center><font color=red size=3>成功增加职务变动信息!</font></center>
<%
 }else{

%>




<script Language="JavaScript">

 function form_check(){
   var l1=document.form1.oldjob.value;
   if(l1==""){window.alert("原职务必须填写!");document.form1.oldjob.focus();return (false);}

   var l2=document.form1.changjob.value;
   if(l2==""){window.alert("变动职务必须填写!");document.form1.changjob.focus();return (false);}

   var l3=document.form1.changdate.value;
   if(l3==""){window.alert("变动时间必须填写!");document.form1.changdate.focus();return (false);}
                    }



</script>




<br>
<center>
<form method="post" action="addchang.jsp" name="form1" onsubmit="return form_check();">
  <table border="0" cellpadding="0" cellspacing="0" width="95%">
    <tr>
      <td height="25" width="15%" style="border-left: 2 solid #000000; border-top: 2 solid #000000; border-bottom: 1 solid #000000" align="center"><b>姓名</b></td>
      <td colspan="3" width="85%" style="border-left: 1 solid #000000; border-right: 2 solid #000000; border-top: 2 solid #000000; border-bottom: 1 solid #000000"><%=name%>
      </td>
    </tr>
    <tr>
      <td width="15%" style="border-left: 2 solid #000000; border-bottom: 1 solid #000000" align="center"><b>原&nbsp;职&nbsp;务</b></td>
      <td width="35%" style="border-left: 1 solid #000000; border-bottom: 1 solid #000000"><input type="text" name="oldjob" size=10><font color=red>*</font> 
      </td>
      <td width="15%" style="border-left: 1 solid #000000; border-bottom: 1 solid #000000" align="center"><b>变动职务</b></td>
      <td width="35%" style="border-left: 1 solid #000000; border-right: 2 solid #000000; border-bottom: 1 solid #000000"><input type="text" name="changjob" size=10><font color=red>*</font>  
      </td>
    </tr>
    <tr>
      <td style="border-left: 2 solid #000000; border-bottom: 1 solid #000000" width="15%" align="center"><b>变动时间</b></td>
      <td style="border-left: 1 solid #000000; border-bottom: 1 solid #000000"><input type="text" name="changdate" size=10><font color=red>*</font> 
      </td>
      <td style="border-left: 1 solid #000000; border-bottom: 1 solid #000000" width="15%" align="center"><b>变动类型</b></td>
      <td style="border-left: 1 solid #000000; border-right: 2 solid #000000; border-bottom: 1 solid #000000"><input type="text" name="changfile" size=10> 
      </td>
    </tr>
    
    <tr>
      <td width="15%" style="border-left: 2 solid #000000; border-bottom: 2 solid #000000" align="center"><b>变动原因<br>
        备注</b></td>
      <td colspan="3" width="85%" style="border-left: 1 solid #000000; border-right: 2 solid #000000; border-bottom: 2 solid #000000"><textarea rows="3" name="changreason" cols="46"></textarea>
      </td>
    </tr>
  </table>
<br>

<input type="hidden" name="userdept" value="<%=request.getParameter("userdept")%>">
<input type="hidden" name="username" value="<%=request.getParameter("username")%>">
<font color=red>*</font>必须填写&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="增加">

</form>
</center>
<%
}
%>


  </td>
          </tr>
        </table>
    </tr>
    <tr>
      <td height=19>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="19">
          <tr>
            
          </tr>
        </table>
      </td>
    </tr>
  </table>
</body>
</html>










⌨️ 快捷键说明

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