<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/enrgise-html.tld" prefix="enrgise" %>
<html:html>
<HEAD>
    <html:base />
    <TITLE><bean:message key="hrm.title" /></TITLE>
	  <jsp:include page="GenIncludes.jsp" flush="true" />
</HEAD>

<BODY  onkeydown="hotKeys(event);"; scroll=auto>

<html:form name="HrmAprslForm" action="HrmEmpAprslTrngReqBaseAction" type="wenrgise.hrms.webtier.form.HrmAprslForm">
<bean:define id="ParentForm" name="HrmAprslForm" toScope="request" />
<jsp:include page="GenIconMenu.jsp" flush="true" />


<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader ><bean:message  key="hrm.EmpAprsl.heading" /></TD>
    </TR>
</TABLE>
<!--//  Display Errors -->
<enrgise:errors/>
<logic:messagesPresent message="true">
<Table>
    <html:messages id="message" message="true">
    <TR><TD>
      <bean:write name="message"/>
    </TD></TR>
    </html:messages>      
</Table>
</logic:messagesPresent>
<!--//  Display Errors -->
<TABLE cellSpacing=0 cellPadding=0 border=0 >
    <TR>
        <TD>
        
        <TABLE cellSpacing=0 cellPadding=0 >
        <!--Master Information Starts -->
        
         <TR>
            <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
         </TR>
         <tr>
            <td class=labelText><bean:message key="hrm.EmpAprsl.empCode" /></td>
            <td><html:text  property="empNo"  maxlength="15" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();" /></td>
         
            <td class=labelText><bean:message key="hrm.EmpAprsl.empName" /></td>
            <td><html:text  property="empName"  maxlength="15" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();" /></td>
            <td class=labelText><bean:message key="hrm.EmpAprsl.stOrderNo" /></td>
            <td ><html:text  property="stOrderNo" altKey="hrm.EmpAprsl.stOrderNo" maxlength="25" size="23" styleClass="locked" readonly="true" onchange="doChangeHeader();" /><enrgise:img height="16" name="HrmAprslForm" align="center"  src="../includes/images/lov.jpg" property="butStOrder" onclick="return ShowStartOrder();"   /></td>
           
           </tr>

          <tr>
          
          
            <td class=labelText><bean:message key="hrm.EmpAprsl.fromDate" /></td>
            <td ><html:text property="fromDate" name="HrmAprslForm" titleKey="hrm.EmpAprsl.fromDate" alt="D" maxlength="15" size="26" styleClass="locked" readonly="true"  onchange="doChangeHeader();"  /></td>
            
          <td class=labelText><bean:message key="hrm.EmpAprsl.toDate" /></td>
            <td ><html:text  property="toDate" name="HrmAprslForm" titleKey="hrm.EmpAprsl.toDate" alt="D" maxlength="15" size="26" styleClass="locked" readonly="true"  onchange="doChangeHeader();"  /></td>
            <td class=labelText><bean:message key="hrm.EmpAprsl.aprslPeriod" /></td>
            <td><html:text  property="aprslPeriod"  maxlength="15" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();" /></td>
            
          </tr>
          
          <tr>
            <td class=labelText><bean:message key="hrm.EmpAprsl.aprslLevel" /></td>
            <td><html:text  property="aprslLevel" altKey="hrm.EmpAprsl.aprslLevel" maxlength="25" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();" /></td>
            
               <logic:notEqual property="approvalFlag" name="HrmAprslForm" value="A" >
               <td class="labelText"><bean:message key="hrm.EmpAprsl.jrLvlRating" /></td>
               <td ><enrgise:text  property="finalRating" altKey="hrm.EmpAprsl.jrLvlRating" maxlength="25" size="26" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();" /></td>
                </logic:notEqual>
               <logic:equal property="approvalFlag" name="HrmAprslForm" value="A" >
               <td class="labelText"><bean:message key="hrm.EmpAprsl.finalRating" /></td>
               <td ><enrgise:text  property="finalRating" altKey="hrm.EmpAprsl.finalRating" maxlength="25" size="26" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();" /></td>
               </logic:equal>

             <td class="labelText"><bean:message key="hrm.EmpAprsl.approvalflag" /></td>
              <td><html:select disabled="true"  property="approvalFlag" alt="approvalFlag"  styleClass="locked" name="HrmAprslForm" onchange="doChangeHeader();" >
              <html:option value="" ><bean:message   key="hrm.pleaseSelect" /></html:option>      
              <html:option value="N" > <bean:message key="hrm.HrmLvAppln.new" /></html:option>
              <html:option value="P" > <bean:message key="hrm.HrmLvAppln.pending" /></html:option>
              <html:option value="A" > <bean:message key="hrm.HrmLvAppln.approved" /></html:option>
              <html:option value="R" > <bean:message key="hrm.HrmLvAppln.rejected" /></html:option>
              <html:option value="V" > <bean:message key="hrm.HrmLvAppln.revised" /></html:option>
             </html:select></td> 
          
          </tr>
          
          
          <tr height=10>
            <td colspan=6></td>
          </tr>
          </table>  
          <table cellspacing=0 cellpadding=0 border=0>
          <!-- Detail Information Row starts -->
          <TR>
            <TD colspan=6>
            <TABLE cellSpacing=0 cellPadding=0>
              <tr>
              <tr>
                   <enrgise:tab name="HrmAprslForm" property="butKPATab" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif"  onclick="doGetTab('HrmAprslKPA','HrmEmpApslTrngReqGetTabAction.do');"  ><bean:message key="hrm.EmpAprsl.kpa" /></enrgise:tab>
                   <enrgise:tab name="HrmAprslForm" property="butGoalsTab" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" onclick="doGetTab('HrmAprslGoals','HrmEmpApslTrngReqGetTabAction.do');" ><bean:message key="hrm.EmpAprsl.goals" /></enrgise:tab>
                   <enrgise:tab name="HrmAprslForm" property="butTrngReqTab" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_r.gif" ><bean:message key="hrm.EmpAprsl.TrngReq" /></enrgise:tab>
                   <enrgise:tab name="HrmAprslForm" property="butPersDtls" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" onclick="doGetTab('HrmAprslEmpDtls','HrmEmpApslTrngReqGetTabAction.do');" ><bean:message key="hrm.EmpAprsl.EmpDtls" /></enrgise:tab>
                   <td width="54%"></td>
            </tr> 
           </tr> 
              <!-- Detail table Container starts -->
              <TD colSpan=131>
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                 <TR>
                  <TD >
                  <DIV id=divDtlTable style="height:300px;width:1020px">
                    <TABLE  border="0" cellSpacing=0 cellPadding=0 id="Appraisal">
                     <TBODY>
                         <tr height="20">
                 <TD class=tableHeader width="1%"><html:checkbox property="selectAll" onclick="toggleCheckBox('checked')" /></TD>
                                      <TD class=tableHeader width="7%"><bean:message key="hrm.EmpAprsl.dateSub" /></td>
                          <TD class=tableHeader width="7%" ><bean:message key="hrm.EmpAprsl.crsName" /></td>
                         <TD class=tableHeader width="6%" ><bean:message key="hrm.EmpAprsl.trnCal" /></td>
                         <TD class=tableHeader width="7%" ><bean:message key="hrm.EmpAprsl.instName" /></td>
                         <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.stDate" /></td>
                         <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.endDate" /></td>
                         <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.nature" /></td>
                        <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.purpose" /></td>
                        <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.recommend" /></td>
                        <TD class=tableHeader width="8%" ><bean:message key="hrm.EmpAprsl.appStatus" /></td>
                        <TD class=tableHeader width="9%" ><bean:message key="hrm.EmpAprsl.remarks" /></td>
                        
                        </tr> 
                        
                       <logic:iterate id="empAprslT" name="HrmAprslForm" property="arylstEmpAprsTrngReq" type="wenrgise.hrms.bean.HrmAprslTrngReqDtlBean" indexId="idx">
                                
                            <logic:notEqual name="empAprslT" property="status" value="D" >                                                        
                                <tr>
                                  <td align="center" ><html:checkbox property="checked" name="HrmAprslForm"  alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);"/></td>                                  
                                 
                                  <td ><html:text property="txtDateSubmitted" name="empAprslT"   styleClass="locked" readonly="true"  size="15"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' />
                                  <td><html:text property="txtCourseName" name="empAprslT"  styleClass="required" readonly="true"  size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /><enrgise:img src="../includes/images/lov.jpg" name="empAprslT"   styleClass="icon" height="15" align="center" property="butCourseLOV"  alt="<%=idx.toString()%>" onclick=" return ShowCourse(this.alt);" /> </td>
                                 <td><html:text property="txtTrngCal" name="empAprslT"  styleClass="optional" readonly="true"  size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /><enrgise:img src="../includes/images/lov.jpg" name="empAprslT"   styleClass="icon" height="15" align="center" property="butTrngCalLOV"  alt="<%=idx.toString()%>" onclick=" return ShowTrngCal(this.alt);" /> </td>
                                 <td><html:text property="txtInstName" name="empAprslT"  styleClass="locked"  readonly="true"  size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /></td>
                                 <td><html:text property="txtStartDate" name="empAprslT"  styleClass="locked"  readonly="true" size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /></td>
                                 <td><html:text property="txtEndDate" name="empAprslT"  styleClass="locked" readonly="true"   size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /></td>
                                  <TD><html:select property="txtNature" name="empAprslT" styleClass="optional"  titleKey="hrm.EmpAprsl.nature"   onchange='<%="doChangeDetail("+idx.toString()+")"%>' >
                                  <html:option value="" ><bean:message   key="hrm.pleaseSelect" /></html:option>      
                                  <html:option value="U" > <bean:message key="hrm.EmpAprsl.urgent" /></html:option>
                                  <html:option value="E" > <bean:message key="hrm.EmpAprsl.emergency" /></html:option>
                                  <html:option value="N" > <bean:message key="hrm.EmpAprsl.normal" /></html:option>
                                  </html:select></td>
                                 <td><enrgise:textarea property="txtPurpose" name="empAprslT"  styleClass="optional" disabledClass="locked"  rows="1" cols="28"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /> </td>
                                 <td><html:text property="txtRecommender" name="empAprslT"  styleClass="optional"  readonly="true" size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /><enrgise:img src="../includes/images/lov.jpg" name="empAprslT"   styleClass="icon" height="15" align="center" property="butRecLOV"  alt="<%=idx.toString()%>" onclick=" return ShowRecName(this.alt);" /> </td>
                                 <td><html:text property="txtAppStatus" name="empAprslT"  styleClass="locked"  readonly="true" size="15"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  /> </td>
                                 <td><enrgise:textarea property="txtRemarks" name="empAprslT"  styleClass="optional" disabledClass="locked"  rows="1" cols="28"  onchange='<%="doChangeDetail("+idx.toString()+");"%>'  />  </td>

                                <html:hidden property="txtCrsId" name="empAprslT"  />
                                <html:hidden property="txtCalId" name="empAprslT"  />
                                <html:hidden property="txtRecId" name="empAprslT"  />
                                <html:hidden property="itemChecked" name="empAprslT" />
                                <html:hidden property="status" name="empAprslT" />
                                <html:hidden property="detailId" name="empAprslT" />
                                <html:hidden property="txtLevel" name="empAprslT"  />
                                <html:hidden property="txtEmpId" name="empAprslT"  />
                                <html:hidden property="txtCourseCode" name="empAprslT"  />
                                <html:hidden property="txtRecNo" name="empAprslT"  />
                                
                               </tr>
                        </logic:notEqual>
                       
                    </logic:iterate>              
                                       

                                       

                      </TBODY>
                      </TABLE>
                      </DIV>
                      </TD>
                    </TR>
               <tr>
                <td>	
                <jsp:include page="GenDetailMenu.jsp" flush="true" />
		            </TD>
		            <td> </td>
               </tr>
        </TABLE>
      </td>
     </tr>
      <TR>
        <TD background="../includes/images/line_r.gif"><IMG src="../includes/images/pixel.gif" border=0></TD>
      </TR>
      
  </TABLE>
</td>
</tr>
              <!-- Tab Table Ends -->

      <!-- Bottom Blue Bar -->
       <TR>
            <td>
              <TABLE  cellspacing="0" cellpadding="0" border=0>
                     <tr>
                        <td width=40% align=center bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></td>              
                       <td bgColor=#4682b4></td>
                        <td align=right bgColor=#4682b4><img src="../includes/images/man.jpg"></td>
                   </TR>
                </table>
            </td>
          </tr>
	
<!-- Container Table Ending Columns Starts-->
    
</TBODY>
</TABLE>

<!-- Container Table Ends -->
<html:hidden name="HrmAprslForm" property="screenName" value="HrmAprslTrngReq" />
<html:hidden name="HrmAprslForm" property="forwardedPage" />
<html:hidden name="HrmAprslForm" property="positionRequested"  />
<html:hidden name="HrmAprslForm" property="screenMode" />
<html:hidden name="HrmAprslForm" property="headerPrimaryKey"/> 


<html:hidden property="lovKey" name="HrmAprslForm"  />
<html:hidden property="txtSearchFields" name="HrmAprslForm"  />
<html:hidden property="txtDisplayFields" name="HrmAprslForm"  />
<html:hidden property="txtIndex" name="HrmAprslForm"  />

<html:hidden property="detailDataChanged" name="HrmAprslForm"  />
<html:hidden property="headerDataChanged" name="HrmAprslForm"  />

<html:hidden property="userPageRequested" name="HrmAprslForm" />
<html:hidden property="userPositionRequested" name="HrmAprslForm" />
<html:hidden property="pageRequested" name="HrmAprslForm" />
<html:hidden property="empId" name="HrmAprslForm" />
<html:hidden property="tmplHdrId" name="HrmAprslForm" />
<html:hidden property="spcTmplId" name="HrmAprslForm" />
<html:hidden property="startOrderId" name="HrmAprslForm" />
<html:hidden property="rating0" name="HrmAprslForm" />
<html:hidden property="rating1" name="HrmAprslForm" />
<html:hidden property="rating2" name="HrmAprslForm" />
<html:hidden property="rating3" name="HrmAprslForm" />
<html:hidden property="rating4" name="HrmAprslForm" />
<html:hidden property="rating5" name="HrmAprslForm" />

<html:hidden property="buttonName" name="HrmAprslForm" />
<html:hidden property="calFlag" name="HrmAprslForm" />
<html:hidden property="appFlag" name="HrmAprslForm" />
<html:hidden property="doneFlag" name="HrmAprslForm" />
<html:hidden property="hidDoneFlag" name="HrmAprslForm" />

<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >


</html:form>
</body>
</html:html>
      
<script language="javascript">

function doQueryMode()
{
  return "HrmEmpApslTrngReqQueryModeAction.do";
}


function doInsertMode()
{
  return "HrmEmpApslTrngReqNewModeAction.do";
}


function doExecute()
{
  return "HrmEmpApslTrngReqGetHeaderAction.do";
}
function doExit()
{
  return "HrmEmpApslTrngReqExitAction.do";
}

function GetLvEmp()
{
    var oTable = document.getElementById(doGetDetailTableName());
    if(oTable == null)
    {
      return;
    }
    var iTr2 = parseInt(oTable.rows.length)-1;
for(i=0; i<iTr2; i++)
{

     document.getElementsByName("txtLevel")[i].value=document.forms[0].aprslLevel.value;
 
      document.getElementsByName("txtEmpId")[i].value=document.forms[0].empId.value;
  }
 
  
}

function doSave()
{
  
  GetLvEmp();
  return "HrmEmpApslTrngReqSaveAction.do";
  
  
}

function doDelete()
{
  return "HrmEmpApslTrngReqDeleteAction.do";
  
}

function doRefresh()
{
  return "HrmEmpApslTrngReqRefreshAction.do";
  
}

function doPrevHeader()
{
  return "HrmEmpApslTrngReqGetNextHeaderAction.do"; 
}

function doNextHeader()
{
  return "HrmEmpApslTrngReqGetNextHeaderAction.do"; 
}

function doJumpHeader()
{
  return "HrmEmpApslTrngReqFirstGetNextHeaderAction.do"; 
}

function doGetDetail()
{

  return "HrmEmpApslTrngReqGetDetailAction.do";
}

function doAddRow()
{
  return "HrmEmpApslTrngReqAddRowAction.do"; 
}

function doDelRow()
{
 return "HrmEmpApslTrngReqDeleteRowAction.do";  
}


function doPrevDetail()
{

  return "HrmEmpApslTrngReqGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmEmpApslTrngReqGetDetailPageAction.do";
}

function doJumpDetail()
{
  return  "HrmEmpApslTrngReqGetDetailPageAction.do"; 
}
function ShowStartOrder()
{
        document.forms[0].queryParam.value ="EmpStOrder="+ document.forms[0].empId.value +" " ; 
        document.forms[0].lovKey.value = "EmpAprslStartOrder" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.document.forms[0].stOrderNo";
        document.forms[0].txtDisplayFields.value = "startOrderId,stOrderNo,fromDate,toDate";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/HRMS/JSP/CommonSearchScreen.jsp" />','HrmAprslForm');
        return true;
}

function ShowCourse(i)
{  
        document.forms[0].lovKey.value = "AprslTrngReqCourse" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpTrngReq.courseCode,hrm.HrmEmpTrngReq.courseName";
        document.forms[0].txtDisplayFields.value = "txtCrsId,txtCourseCode,txtCourseName";
        document.forms[0].txtIndex.value = i;
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAprslForm');
}
function ShowTrngCal(i)
{
        document.forms[0].lovKey.value = "AprslTrngReqCal" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpTrngReq.trainingCalendar,hrm.HrmEmpTrngReq.courseName";
        document.forms[0].txtDisplayFields.value = "txtCalId,txtTrngCal,txtCourseName,txtInstName,txtStartDate,txtEndDate";
        document.forms[0].txtIndex.value = i;
        document.forms[0].queryParam.value="courseId="+ document.getElementsByName("txtCrsId")[i].value+" ";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAprslForm');
        return true;
}
function ShowRecName(i)
{
        document.forms[0].lovKey.value = "AprslTrngReqRecommender" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpTrngReq.employeeNumber,hrm.HrmEmpTrngReq.recoName";
        document.forms[0].txtDisplayFields.value = "txtRecId,txtRecNo,txtRecommender";
        document.forms[0].txtIndex.value = i;
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAprslForm');
        return true;
        
}

function doGetDetailTableName()
{
  return "Appraisal";
}
</script>