📄 employeeadd.jsp
字号:
<%--
模块名称:行政管理
模块功能:人员增加
版 本:V1.0
著 作 人:蔡静
著作日期:2001-10-25
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:= = = = = = = = = = = = = = = = = = = = = = = = = =
修改日期:
修 改 人:
修改理由:
修改出处:
= = = = = = = = = = = = = = = = = = = = = = = = = =
--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
Security auth = new Security();
String employeeid = (String)session.getAttribute("employee_id");
if(employeeid == null || employeeid.equals(""))
{
response.sendRedirect(response.encodeRedirectURL("../index.htm"));
}
String modelid = "Off032";
int authflag = auth.popedom(employeeid, modelid);
if(authflag == 0 || authflag == 2 || authflag == -1)
{
%>
<jsp:forward page="../inc/noauth.jsp" >
</jsp:forward>
<%
}
%>
<%
GetID gid = new GetID();
ExtendString es = new ExtendString();
String eid = "YG" + es.digitToString(gid.getIDNumber("employee_id")+1,3);
String str = request.getParameter("save");
if (str!=null) {
String employee_id, employee_name, sex, birth, dept_id, title, duty;
String education, expert, career_time, join_time, resume, achievement;
String remark, speciality, case_range, passwd,
tel = "", //联系方式
diploma = ""; //毕业学校 add by SIMM
employee_id = request.getParameter("employee_id");
employee_name = es.getStr(request.getParameter("employee_name"));
sex = request.getParameter("sex");
birth = request.getParameter("birth");
dept_id = request.getParameter("dept_id");
title = request.getParameter("title");
duty = request.getParameter("duty");
education = request.getParameter("education");
expert = request.getParameter("expert");
career_time = request.getParameter("career_time");
join_time = request.getParameter("join_time");
resume = request.getParameter("resume");
achievement = request.getParameter("achievement");
remark = request.getParameter("remark");
speciality = request.getParameter("speciality");
case_range = request.getParameter("case_range");
tel = request.getParameter("tel"); //
diploma = request.getParameter("diploma"); //
passwd = es.encrypt("123456");
String sql = "insert into t_employee(employee_id, employee_name, sex, dept_id, education";
if ((birth != null) && (!birth.equals("")))
sql = sql + ",birth";
if ((title != null) && (!title.equals("")))
sql = sql + ",title";
if ((duty != null) && (!duty.equals("")))
sql = sql + ",duty";
if ((expert != null) && (!expert.equals("")))
sql = sql + ",expert";
if ((career_time != null) && (!career_time.equals("")))
sql = sql + ",career_time";
if ((join_time != null) && (!join_time.equals("")))
sql = sql + ",join_time";
if ((resume != null) && (!resume.equals("")))
sql = sql + ",resume";
if ((achievement != null) && (!achievement.equals("")))
sql = sql + ",achievement";
if ((remark != null) && (!remark.equals("")))
sql = sql + ",remark";
if ((speciality != null) && (!speciality.equals("")))
sql = sql + ",speciality";
if ((case_range != null) && (!case_range.equals("")))
sql = sql + ",case_range";
if ((tel != null) && (!tel.equals("")))
sql = sql + ",tel";
if ((diploma != null) && (!diploma.equals("")))
sql = sql + ",diploma";
sql = sql + ",passwd,active) values ('" + employee_id + "','";
sql = sql + employee_name + "'," + sex + ",'" + dept_id + "','" + education + "'";
if ((birth != null) && (!birth.equals("")))
sql = sql + ",'" + birth + "'";
if ((title != null) && (!title.equals("")))
sql = sql + ",'" + es.getStr(title) + "'";
if ((duty != null) && (!duty.equals("")))
sql = sql + ",'" + es.getStr(duty) + "'";
if ((expert != null) && (!expert.equals("")))
sql = sql + ",'" + es.getStr(expert) + "'";
if ((career_time != null) && (!career_time.equals("")))
sql = sql + ",'" + career_time + "'";
if ((join_time != null) && (!join_time.equals("")))
sql = sql + ",'" + join_time + "'";
if ((resume != null) && (!resume.equals("")))
sql = sql + ",'" + es.getStr(resume) + "'";
if ((achievement != null) && (!achievement.equals("")))
sql = sql + ",'" + es.getStr(achievement) + "'";
if ((remark != null) && (!remark.equals("")))
sql = sql + ",'" + es.getStr(remark) + "'";
if ((speciality != null) && (!speciality.equals("")))
sql = sql + ",'" + es.getStr(speciality) + "'";
if ((case_range != null) && (!case_range.equals("")))
sql = sql + ",'" + es.getStr(case_range) + "'";
if ((tel != null) && (!tel.equals("")))
sql = sql + ",'" + es.getStr(tel) + "'";
if ((diploma != null) && (!diploma.equals("")))
sql = sql + ",'" + es.getStr(diploma) + "'";
sql = sql + ",'" + passwd + "',1)";
int num = db.executeUpdate(sql);
if (num > 0) {
gid.setIDNumber("employee_id", gid.getIDNumber("employee_id")+1);
eid = "YG" + es.digitToString(gid.getIDNumber("employee_id")+1,3);
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>人员增加</title>
<%@ include file="../inc/config.jsp" %>
</head>
<body class=page>
<script language="javascript">
function checkForm() {
if (document.form1.employee_id.value=="") {
alert("请输入员工编号!");
document.form1.employee_id.focus();
return false;
}
if (document.form1.employee_name.value=="") {
alert("请输入员工姓名!");
document.form1.employee_name.focus();
return false;
}
return true;
}
</script>
<!--显示工具条-->
<table width="98%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<a href="Employee.jsp"><img src="../images/all.gif" height="22" border="0" alt="显示所有内容"></a>
<a href="EmployeeAdd.jsp"><img src="../images/add.gif" alt="增加内容" width="79" height="22" border="0" style="cursor:hand" ></a>
<img src="../images/delete.gif" alt="删除选中的内容" style="cursor:hand" width="79" height="22"></td>
<td width="108" height="30" align="center"> <img src="../images/back.gif" width="50" height="22" onClick="window.history.back()" style="cursor:hand" alt="返回"></td>
</tr>
</table>
<table width="98%" background="../images/line.gif" border="0" cellspacing="0" cellpadding="0" height="12" align="center">
<tr>
<td> </td>
</tr>
</table>
<!--显示工具条结束-->
<form name="form1" method="post" action="EmployeeAdd.jsp">
<table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="table_bg">
<tr>
<td height="24" width="19%" align="right" class="title_bg"> 员工编号:</td>
<td height="24" width="32%" class="tr_bg1">
<input name="employee_id" size="12" class="input" value=<%=eid%> readOnly>
<font color="#FF0000">*</font>
</td>
<td height="24" width="17%" align="right" class="title_bg"> 姓名:</td>
<td height="24" width="32%" class="tr_bg1">
<input name="employee_name" size="12" class="input">
<font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td align="right" height="28" width="19%" class="title_bg"> 性别:</td>
<td height="28" width="32%" class="tr_bg1">
<select class="select" name="sex" size=1>
<option selected value=1>男</option>
<option value=0>女</option>
</select>
</td>
<td align="right" height="28" width="17%" class="title_bg"> 出生年月:</td>
<td height=28 width=32% class="tr_bg1">
<input type="text" name="birth" maxlength="10" size="10" value="" class="input" readOnly>
<img src="../images/datetime.gif" border="0" align="absmiddle"
alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(birth);return false" width="16" height="16">
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 联系方式:</td>
<td height=28 width=32% class="tr_bg1">
<input name="tel" size=12 class="input">
</td>
<td align="right" height="28" width="17%" class="title_bg"> 所属部门:</td>
<td height=28 width=32% class="tr_bg1">
<select class="select" name="dept_id" size=1>
<%
String dept_id1, dept_name1;
ResultSet rs1 = db.executeQuery("select dept_id, dept_name from t_dept where dept_id <> 'root' order by dept_id");
while (rs1.next()) {
dept_id1 = rs1.getString("dept_id");
dept_name1 = rs1.getString("dept_name");
%>
<option value=<%=dept_id1%>><%=dept_name1%></option>
<%}%>
</select>
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 职称:</td>
<td height=28 width=32% class="tr_bg1">
<input name="title" size="12" class="input">
</td>
<td align=right height=28 width=17% class="title_bg"> 职务:</td>
<td height=28 width=32% class="tr_bg1" >
<input name="duty" size="12" class="input" >
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 学历:</td>
<td height=28 width=32% class="tr_bg1">
<select class="select" name="education" size=1>
<option value=1>小学</option>
<option value=2>初中</option>
<option value=3>高中</option>
<option value=4>中专</option>
<option value=5>大专</option>
<option selected value=6>本科</option>
<option value=7>硕士</option>
<option value=8>博士</option>
</select>
</td>
<td align=right height=28 width=17% class="title_bg"> 专业方向:</td>
<td height=28 width=32% class="tr_bg1" >
<input name="expert" size="12" class="input" >
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 毕业学校:</td>
<td colspan=3 height=28 class="tr_bg1">
<input name="diploma" size="55" class="input">
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 从业时间:</td>
<td height=28 width=32% class="tr_bg1">
<input type="text" name="career_time" maxlength="10" size="10" value="" class="input" readOnly>
<img src="../images/datetime.gif" border="0" align="absmiddle"
alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(career_time);return false" width="16" height="16">
</td>
<td align=right height=28 width=17% class="title_bg"> 入所时间:
</td>
<td height=28 width=32% class="tr_bg1" >
<input type="text" name="join_time" maxlength="10" size="10" class="input" readOnly value="" >
<img src="../images/datetime.gif" border="0" align="absmiddle"
alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(join_time);return false" width="16" height="16">
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg">个人简历:</td>
<td colspan=4 height=28 class="tr_bg1">
<input name="resume" size="33" class="input">
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 主要业绩:</td>
<td colspan=4 height=28 class="tr_bg1">
<input name="achievement" size="33" class="input">
</td>
</tr>
<tr>
<td align=right height=56 class="title_bg" width="19%"> 备注:</td>
<td colspan=4 height=56 class="tr_bg1">
<textarea rows="5" name="remark" cols="55" class="input"></textarea>
</td>
</tr>
<tr>
<td align=left height=28 class="title_bg" colspan="5"> 律师员工资料
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 律师专长:</td>
<td colspan=4 height=28 class="tr_bg1">
<input name="speciality" size=57 class="input">
</td>
</tr>
<tr>
<td align=right height=28 width=19% class="title_bg"> 办案范围:</td>
<td colspan=4 height=28 class="tr_bg1">
<input name="case_range" size=57 class="input">
</td>
</tr>
</table>
<br>
<div align="center">
<input type="submit" value="保存新增" name="save" class="button" onclick="return checkForm();">
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -