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

📄 pa_infoadd.jsp

📁 J2ee开发的 人事管理系统 使用oracle数据库 myeclips平台开发
💻 JSP
字号:
<%@ page language="java" pageEncoding="gb2312"%>
<%@ page import="java.util.*" %>
<%@ page import="com.galaxy.util.*"%>
<%@ page import="com.galaxy.vo.*" %>
<%@ page import="com.galaxy.dao.*" %>
<%@ page import="com.galaxy.base.*" %>
<html>
<script type="text/javascript" src="prototype.js" ></script>
<head>
<link rel="stylesheet"  type="text/css" href="css/css.css">
<link rel="stylesheet"  type="text/css" href="../../css/css.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>

function checkPersoncardID()
{	
	var idcardNum = document.form1.createidcard.value;
	var url= "../../PA_UserInfoServlet";
	var pars="opflag=creatidcardajax" +
			"&idcardNum=" + idcardNum;
			
	var myAjax = new Ajax.Request(
	url,
	{
	method:'POST',
  	parameters:pars,
  	onComplete:rspChkPersoncarNum
	}
	);	
		
}

function rspChkPersoncarNum(xRequest)
{
	var hasThisPerson = xRequest.responseText;
	if(hasThisPerson == 1)
	{
		alert("此身份证号码已经存在!");		
	}	
}

function Redirect(url)
{
	if(document.form1.createusername.value != "" && document.form1.createage.value != "" 
	   && document.form1.createpersonid.value != "")
	   {
	   	var regex=RegExp("^[0-9]\\d{0,}$");
			if(!document.form1.createage.value.match(regex) || !document.form1.createpersonid.value.match(regex))
			{
		 		alert("年龄和员工编号必须为数字!");
		 		return false;
		 	}
		 	
		 
		var ageNum = document.form1.createage.value;
		if(ageNum < 18 || ageNum > 72)
		{
			alert("年龄大小不符,请重新填写!");
			document.form1.createage.focus();
			return false;
		}
		var gsnum=/^\d{17}(\d|x)+$/;
  		if(!gsnum.test(document.form1.createidcard.value))  
  		{
     		alert("输入的不是身份证格式不对!");
     		document.form1.createidcard.focus();
     		return false;
  		}
  		var ageNum = document.form1.createage.value;
		if(ageNum < 18 || ageNum > 72)
		{
			alert("年龄大小不符,请重新填写!");
			document.form1.createage.focus();
			return false;
		}
  		var emid=/^\d{8}$/;
  		if(!emid.test(document.form1.createpersonid.value))  
  		{
     		alert("员工编号必须位8位数字");     		
     		return false;
  		}
		document.form1.action=url;
		document.form1.submit();
	   }
	else
	{
		alert("请确定你填写了必要内容!");
		document.form1.reset();
		return false;
	}
}

function CreatePhoto()
{
	var photo = document.form1.createphoto.value;
	document.form1.userphoto.src=photo;
}

function checkPersonID()
{	
	var personID = document.form1.createpersonid.value;
	var url= "../../PA_UserInfoServlet";
	var pars="opflag=creatpersonajax" +
			"&personID=" + personID;
			
	var myAjax = new Ajax.Request(
	url,
	{
	method:'POST',
  	parameters:pars,
  	onComplete:rspPersonID
	}
	);	
		
}

function rspPersonID(xRequest)
{
	var hasThisPerson = xRequest.responseText;
	if(hasThisPerson == 1)
	{
		alert("此员工ID已经存在!");		
	}	
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<%
List deps = new ArrayList();
List roles = new ArrayList();
String cond = "";
DaoInterface depdao = new DeptInfoDAO();
deps = depdao.queryByCondition("and di_state='可用'"+cond);
DaoInterface roledao = new RoleInfoDAO();
roles = roledao.queryByCondition(cond);
RoleInfoVO rolevo = new RoleInfoVO();      
%>
<body>
<form name="form1" method="post" action="" enctype="multipart/form-data">
  <p>&nbsp;</p>
  <h1 align="center">新增员工</h1>
  <table width="600" border="1" align="center" cellspacing="0" bordercolor="#000000" class="toBeSetBgColor">
    <tr>
      <td width="128" height="25" align="left" valign="middle" scope="row">
        <div align="left"><strong>姓名:</strong></div></td>
      <td width="522"><input type="text" name="createusername">
        <span class="style1">*</span></td>
      <td width="132" rowspan="13" align="left" valign="top">                            
      <p><img name="userphoto" src="" width="132" height="140" alt=""> </p>           </td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row"><div align="left">年龄:</div></th>
      <td><input type="text" name="createage">
        <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row"><div align="left">性别:</div></th>
      <td>男
        <input name="createsex" type="radio" value="男" checked>
<input type="radio" name="createsex" value="女"></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row"><div align="left">所属部门:</div></th>
      <td><select name="createdepartment">
        <%
			if(deps!= null){
			for(int i=0; i<deps.size(); i++){
			DeptInfoVO depvo = (DeptInfoVO)deps.get(i);							
		  %>
        <option value="<%=depvo.getDiId() %>"><%=depvo.getDiName() %></option>
        <%}}%>
      </select>
        <span class="style1">*</span></td>
    </tr>
     <tr>
    <th height="26" align="left" valign="middle" scope="row"> 职称: </th>
    <td><select name="createduty">
      <option value="初级工程师" selected>初级工程师</option>
      <option value="中级工程师" >中级工程师</option>
      <option value="高级工程师" >高级工程师</option>
      <option value="体系架构师" >体系架构师</option>
      <option value="网络工程师" >网络工程师</option>
      <option value="数据库工程师">数据库工程师</option>
    </select>
      <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="29" align="left" valign="middle" scope="row">
      <div align="left">职务: </div></th>
      <td><select name="createzhiwu">
        <option value="总裁">总裁</option>
        <option value="总经理">总经理</option>
        <option value="经理助理">经理助理</option>
        <option value="部门经理">部门经理</option>
        <option value="项目组长">项目组长</option>
        <option value="普通员工" selected>普通员工</option>
      </select>
        <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row"><div align="left">选择角色:</div></th>
      <td><select name="createrole">
        <%
			if(roles!= null){
			for(int i=0; i<roles.size(); i++){
			rolevo = (RoleInfoVO)roles.get(i);								
		  %>
        <option value="<%=rolevo.getRiId() %>"><%=rolevo.getRiName() %></option>
        <%}}%>
      </select>
        <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row">身份证号:</th>
      <td><input type="text" name="createidcard" onBlur="checkPersoncardID()"> 
        <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row">员工编号:</th>
      <td><input type="text" name="createpersonid" onBlur="checkPersonID()">
        <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row"><div align="left">学历:</div></th>
      <td><select name="createxueli">
        <option value="专科">专科</option>
        <option value="本科" selected>本科</option>
        <option value="硕士">硕士</option>
        <option value="博士">博士</option>
        <option value="其他">其他</option>
      </select>
      <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row">状态:</th>
      <td><select name="createstate">
        <option selected>优</option>
        <option>良</option>
        <option>中</option>
        <option>差</option>
      </select>
      <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="25" align="left" valign="middle" scope="row">学位:</th>
      <td><select name="createdegree">
        <option value="学士" selected>学士</option>
        <option value="硕士">硕士</option>
        <option value="博士">博士</option>
        <option value="博士后">博士后</option>
        <option value="其他">其他</option>
      </select>
      <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="21" align="left" valign="middle" scope="row">个人照片</th>
      <td><input type="file" name="createphoto" onChange="CreatePhoto()">
      <span class="style1">*</span></td>
    </tr>
    <tr>
      <th height="66" align="left" valign="middle" scope="row"><div align="left">兴趣爱好:</div></th>
      <td height="66" colspan="2"><textarea name="createextend" rows="3" cols="41"></textarea></td><br><br>
    </tr>
  </table>
  
  
    <table width="421" border="0" cellspacing="0" height="29" align="right">
      <tr>
        <td width="126">
          
            <input name="提交" type="button" id="提交" value="  提   交 " onClick="return Redirect('../../PA_UserInfoServlet?opflag=addnew')">
        </td> 
        <td width="446"> 
        </td>
      </tr>
    </table>
  </div>
  <div align="left">    </div>
  <p>&nbsp; </p>
</form>
</body>
</html>

⌨️ 快捷键说明

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