?? rescreate.jsp.svn-base
字號:
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.nsi.components.util.LoginuserUtil" %>
<%@ page import="com.nsi.components.web.util.RsWebUtil" %>
<%@ page import="com.nsi.components.util.EmployeeTypeUtil" %>
<%@ page import="com.nsi.control.web.util.RsWebInfoUtil" %>
<%@ page import="com.nsi.components.resource.ResourceInfo" %>
<%@ page import="com.nsi.components.employeetype.EmployeeTypeInfo" %>
<%@ page import="com.nsi.util.ValHelper" %>
<%
ResourceInfo info = RsWebUtil.getInstance().getResourceinfo(request);
String searchtype = RsWebUtil.getInstance().getSearchtype(request);
String empltypeid = RsWebUtil.getInstance().getEmpltypeid(request);
String loginname = RsWebUtil.getInstance().getLoginname(request);
%>
<html>
<head>
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="pragma" content="no-cache">
<%
if ( LoginuserUtil.getInstance().isNotLogined(request) )
{
%><meta http-equiv="refresh" content="0; url=/entrance.jsp"><%
}
%>
<title>Achievo-RMS Resource Profile Creation</title>
<link href="../theme/master.css" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = y2k(today.getYear());
var monthname = new Array('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
var valid = 0;
var changeflag = 0;
var currentfield;
function restart()
{
currentfield.value = monthname[month] + "-" + padout(day) + "-" + y2k(year);
mywindow.close();
}
function setemptydate()
{
currentfield.value = '';
mywindow.close();
}
function convertdate(date)
{
var datemon;
for ( var i = 0; i < monthname.length; i++ )
{
if ( monthname[ i ] == date.substring( 0, 3 ) )
{
datemon = i;
}
}
if ( datemon < 10 )
{
datemon = "0" + datemon;
}
return date.substring( 7, 11 ).toString() + datemon.toString() + date.substring( 4, 6 ).toString();
}
function validdate(date1, date2)
{
if ( convertdate(date1) > convertdate(date2) )
{
return false;
}
return true;
}
function y2k(number)
{
number = parseInt(number);
return (number < 1000) ? number + 1900 : number;
}
function padout(number)
{
number = parseInt(number);
return (number < 10) ? '0' + number : number;
}
function changefocus(thefield)
{
currentfield = thefield;
currentfield.focus();
mywindow = window.open('/rms/resource/resourcecalender.html','Calendar', "resizeable = no,width=345,height=295" );
mywindow.location.href = '/rms/resource/resourcecalender.html';
}
function submitform( theform, action )
{
if ( validres(theform) )
{
alert('Please assign the new resource to the corresponding department through Resource Position.');
theform.action.value = action;
theform.submit();
}
else
{
return false;
}
}
function cancelform( theform )
{
theform.urlmapping.value = "/resources/resprofmenu" ;
theform.submit() ;
}
function validres(theform)
{
if(theform.startdate.value=='')
{
alert('Please enter Hiring Date.');
return false;
}
if(theform.enddate.value!=''&&!validdate(theform.startdate.value, theform.enddate.value))
{
alert('Hiring Date should be less than or equal to Terminate Date.');
return false;
}
if(theform.remarks.value.length>200)
{
alert('Please type less than 200 letters in the Remarks field.');
return false;
}
if(theform.empltypeid.value=='6')
{
if(theform.agencyid.value=='0')
{
alert('Please select an agency for the contractor.');
return false;
}
}
else
{
if(theform.agencyid.value!='0'&&(theform.empltypeid.value=='1'||theform.empltypeid.value=='2'))
{
alert('No agency for Full-time & Part-Time Staff, please select NA from the Agency List.');
return false;
}
}
if (!theform.employeenum.value==""&&!isnum(theform.employeenum.value) )
{
alert("Employee ID must be number. Please enter valid Employee ID.");
theform.employeenum.focus();
return false;
}
else if ( theform.lastname.value == "" )
{
alert("Please enter the Last Name.");
theform.lastname.focus();
return false;
}
else if ( theform.firstname.value == "" )
{
alert("Please enter the First Name.");
theform.firstname.focus();
return false;
}
else if ( theform.email.value == "" )
{
alert("Please enter the Email Address.");
theform.email.focus();
return false;
}
else if ( theform.loginname.value == "" && theform.isadduser.value == "T" )
{
alert("Please provide a Login Name for the User Profile Setup.");
theform.loginname.focus();
return false;
}
else
{
return true;
}
}
function isnum( inputvalue )
{
if ( ! inputvalue )
{
return false;
}
else
{
inputstr = inputvalue.toString();
for ( var i = 0; i < inputstr.length; i++ )
{
var onechar = inputstr.charAt(i);
if ( onechar < '0' || onechar > '9' )
{
return false;
}
}
}
return true;
}
//-->
</script>
</head>
<body onload="javascript:document.res_create_form.employeenum.focus();">
<form name="res_create_form" method="post" action="/rms/mainservlet">
<h1>Resource Profile Creation</h1>
<input type="hidden" name="urlmapping" value="/resources/resprofdisplay">
<input type="hidden" name="action" value="createResource">
<input type="hidden" name="searchtype" value="<%=searchtype%>">
<table width="837" border="0" cellpadding="0" cellspacing="0">
<%if(RsWebUtil.getInstance().isDisplayLoginnameexistmsg(request))
{
%>
<tr>
<td colspan="2" class="txt"><span class="txtRed"><%=RsWebUtil.getInstance().getLoginnameexistmsg(request)%></span></td>
</tr>
<%
}
%>
<tr>
<td colspan="2" class="txt"><span class="txtRed">*</span> denotes required field</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="200" class="txtHighlight">Employee Status</td>
<td width="637" class="cell" colspan="4"> </td>
</tr>
<tr>
<td class="txtHighlight">Hiring Date <span class="txtRed">*</span></td>
<td class="cell"><input type="text" class="cell" name="startdate" size="20" maxlength="20" value="<%=info.getStartdate()%>" onclick="javascript:changefocus(this);" readonly></td>
</tr>
<tr>
<td class="txtHighlight">Terminate Date</td>
<td class="cell"><input type="text" class="cell" name="enddate" size="20" maxlength="20" value="<%=info.getEnddate()%>" onclick="javascript:changefocus(this);" readonly></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Employee Type</td>
<td class="cell">
<%
List<EmployeeTypeInfo> empltypeinfolist = EmployeeTypeUtil.getInstance().getEmployeeTypeList();
%><select class="cell" name="empltypeid" size="1"><%
int empltypesize = empltypeinfolist.size();
for ( int i=0;i<empltypesize;i++ )
{
EmployeeTypeInfo empltypeinfo = empltypeinfolist.get(i);
if( empltypeinfo.getEmpltypeid().equals( empltypeid ) )
{
%><option class="cell" selected value="<%=empltypeinfo.getEmpltypeid()%>"><%=empltypeinfo.getEmpltypedescription()%></option><%
}
else
{
%><option class="cell" value="<%=empltypeinfo.getEmpltypeid()%>"><%=empltypeinfo.getEmpltypedescription()%></option><%
}
}
%>
</select>
</td>
</tr>
<tr>
<td class="txtHighlight">Agency</td>
<td class="cell">
<select class="cell" name="agencyid" size="1">
<%
if((info.getAgencyid()).equals("0"))
{
%><option class="cell" selected value="0">--NA--</option><%
}
else
{
%><option class="cell" value="0">--NA--</option><%
}
List<Map<String,String>> result = RsWebInfoUtil.getInstance().selectAgency();
int agentsize = result.size();
for(int i = 0; i < agentsize; i++)
{
Map<String,String> resultmap = result.get(i);
String agencyid = ValHelper.getInstance().getValue(resultmap, "agencyid");
String agency = ValHelper.getInstance().getValue(resultmap, "agency");
if((info.getAgencyid()).equals(agencyid))
{
%><option class="cell" selected value="<%=agencyid%>"><%=agency%></option><%
}
else
{
%><option class="cell" value="<%=agencyid%>"><%=agency%></option><%
}
}
%>
</select>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Employee ID</td>
<td class="cell"><input type="text" class="cell" name="employeenum" size="20" maxlength="20" value="<%=info.getEmployeenum()%>"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">First Name <span class="txtRed">*</span></td>
<td class="cell"><input type="text" class="cell" name="firstname" size="20" maxlength="20" value="<%=info.getFirstname()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Middle Name</td>
<td class="cell"><input type="text" class="cell" name="middlename" size="20" maxlength="20" value="<%=info.getMiddlename()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Last Name <span class="txtRed">*</span></td>
<td class="cell"><input type="text" class="cell" name="lastname" size="20" maxlength="20" value="<%=info.getLastname()%>"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Address</td>
<td class="cell"><input type="text" class="cell" name="address" size="40" maxlength="50" value="<%=info.getAddress()%>"></td>
</tr>
<tr>
<td class="txtHighlight">City</td>
<td class="cell"><input type="text" class="cell" name="city" size="20" maxlength="20" value="<%=info.getCity()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Province</td>
<td class="cell"><input type="text" class="cell" name="province" size="20" maxlength="20" value="<%=info.getProvince()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Postal Code</td>
<td class="cell"><input type="text" class="cell" name="postalcode" size="7" maxlength="7" value="<%=info.getPostalcode()%>"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td class="txtHighlight">Home Phone</td>
<td class="cell"><input type="text" class="cell" name="homephone" size="12" maxlength="12" value="<%=info.getHomephone()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Office Phone</td>
<td class="cell"><input type="text" class="cell" name="officephone" size="20" maxlength="20" value="<%=info.getOfficephone()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Mobile Phone</td>
<td class="cell"><input type="text" class="cell" name="mobilephone" size="12" maxlength="12" value="<%=info.getMobilephone()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Pager</td>
<td class="cell"><input type="text" class="cell" name="pager" size="12" maxlength="12" value="<%=info.getPager()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Fax</td>
<td class="cell"><input type="text" class="cell" name="fax" size="12" maxlength="12" value="<%=info.getFax()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Email Address<span class="txtRed">*</span></td>
<td class="cell"><input type="text" class="cell" name="email" size="65" maxlength="100" value="<%=info.getEmail()%>"></td>
</tr>
<tr>
<td class="txtHighlight">Remarks</td>
<td class="cell"><textarea rows="5" cols="65" class="cell" name="remarks" ><%=info.getRemarks()%></textarea></td>
</tr>
<tr>
<td class="txtHighlight">Add User Profile</td>
<td class="txtHighlight">
<select class="cell" name="isadduser" size="1">
<option class="cell" selected value="T">Yes</option>
<option class="cell" value="F">No</option>
</select> Login Name<input type="text" class="cell" name="loginname" size="20" maxlength="20" value=<%=loginname%>></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" class="cell">
<input type="button" class="cell" value="Create" onclick="submitform(this.form, 'createResource');">
<input type="reset" class="cell" value="Reset">
<input type="button" class="cell" value="Cancel" onclick="javascript:cancelform(this.form);">
</td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -