<%@ 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>
<html:base />
<head>
  <TITLE><bean:message  key="hrm.title" /></TITLE>
  <jsp:include page="GenIncludes.jsp" flush="true" />
</head>
<BODY  scroll=auto>

<html:form  action="HrmPrmCriteriaBaseAction" name="HrmPrmCriteriaForm" type="wenrgise.hrms.webtier.form.HrmPrmCriteriaForm">
<bean:define id="ParentForm" name="HrmPrmCriteriaForm" 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.HrmPrmCriteria.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 >
        <!--Header Starts -->
            <TR>
                  <TD class=subHeader colspan=6><bean:message  key="hrm.HrmPrmCriteria.toPostHeader" /></TD>
            </TR>
            <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.HrmPrmKPARating.gradeCode" /></td>
                  <td colspan=2 ><html:text  property="toGradeCode"  maxlength="15" size="23" styleClass="required" onchange="doChangeHeader();" readonly="true" /><enrgise:img src="../includes/images/lov.jpg" height="16" align="center" property="butToGrade" name="HrmPrmCriteriaForm" onclick="ShowToGrade();" /><html:text  property="toGradeDesc" altKey="hrm.HrmPrmKPARating.gradeDesc" maxlength="255" size="40" styleClass="locked" onchange="doChangeHeader();" readonly="true" /></td> 
                  
            </TR>
            <TR> 
                  <td class=labelText><bean:message key="hrm.HrmPrmKPARating.desigCode" /></td>
                  <td  ><html:text  property="toDesigCode"  maxlength="15" size="23" styleClass="required" onchange="doChangeHeader();" readonly="true" /><enrgise:img src="../includes/images/lov.jpg" height="16" align="center" property="butToDesig" name="HrmPrmCriteriaForm" onclick="ShowToDesignation();" /><html:text  property="toDesigDesc" altKey="hrm.HrmPrmKPARating.desigDesc" maxlength="255" size="40" styleClass="locked" onchange="doChangeHeader();" readonly="true" /></td> 
            </TR>
             <TR>
                  <TD class=subHeader colspan=6><bean:message  key="hrm.HrmPrmCriteria.fromPostHeader" /></TD>
            </TR>
            <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.HrmPrmKPARating.gradeCode" /></td>
                  <td colspan=2 ><html:text  property="fromGradeCode"  maxlength="15" size="23" styleClass="required" onchange="doChangeHeader();" readonly="true" /><enrgise:img src="../includes/images/lov.jpg" height="16" align="center" property="butFromGrade" name="HrmPrmCriteriaForm" onclick="ShowFromGrade();" /><html:text  property="fromGradeDesc" altKey="hrm.HrmPrmKPARating.gradeDesc" maxlength="255" size="40" styleClass="locked" onchange="doChangeHeader();" readonly="true" /></td> 
            </TR>
            <TR> 
                  <td class=labelText><bean:message key="hrm.HrmPrmKPARating.desigCode" /></td>
                  <td  ><html:text  property="fromDesigCode"  maxlength="15" size="23" styleClass="optional" onchange="doChangeHeader();" readonly="true" /><enrgise:img src="../includes/images/lov.jpg" height="16" align="center" property="butFromDesig" name="HrmPrmCriteriaForm" onclick="ShowFromDesignation();" /><html:text  property="fromDesigDesc" altKey="hrm.HrmPrmKPARating.desigDesc" maxlength="255" size="40" styleClass="locked" onchange="doChangeHeader();" readonly="true" /></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>
            <!-- Tab Table Starts -->
            <TABLE cellSpacing=0 cellPadding=0 >
            <tr>                                             
                          <td bgcolor="#4682B4" width="10"><img src="..\INCLUDES\IMAGES/pixel.gif" width="10" height="1" border="0"></td>
                          <td bgcolor="#4682B4" nowrap class=actTabText><bean:message key="hrm.HrmPrmCriteria.detail" /><img src="../includes/images/pixel.gif" width="10" height="1" border="0"></td>
                          <TD><IMG height=19  src="../includes/images/formtab_r.gif" width=10  border=0></TD>                              
                          <TD width="100%" background="../includes/images/line_t.gif">&nbsp;</TD>
                          <TD background="../includes/images/line_t.gif"><IMG height=1 src="../includes/images/pixel.gif" width=10 border=0></TD>
            </tr>
              <TR >
              
            <!-- Detail table Container starts -->
              <TD colSpan=6>
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                 <TR>
                  <TD >
                  <DIV id=divDtlTable style="height:200px">
                    <TABLE  border="0" cellSpacing=0 cellPadding=0>
                     <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><html:checkbox property="selectAll"  /></TD>
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtDescription" /></td>   
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtCriteriaStartDate" /></td>                                
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtCriteriaEndDate" /></td>                                
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtMinServicePeriod" /></td>                                
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtReqYears" /></td>                                
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmPrmCriteria.txtYearAPAR" /></td>                                
                          </tr>   
                          
                          <logic:iterate id="oHrmPrmCriteria" name="HrmPrmCriteriaForm" property="arrPrmCriteria" type="wenrgise.hrms.bean.HrmPrmCriteriaDtlBean" indexId="idx" >
                            <logic:notEqual name="oHrmPrmCriteria" property="status" value="D" >
                            <tr>
                              <TD class=tableText width="1%">
                                <html:hidden property="status"  name="oHrmPrmCriteria" />
                                <html:hidden property="detailId"  name="oHrmPrmCriteria"  />
                                <input type="checkbox" name="checked" onclick='<%="boxClicked("+idx.toString()+")"%>' >
                                <html:hidden property="itemChecked" name="oHrmPrmCriteria" />
                              </TD>
                              <TD class=tableText ><enrgise:text property="txtDescription" name="oHrmPrmCriteria" style="width:99%"  styleClass="required" disabledClass="required" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                              <TD class=tableText ><html:text property="txtCriteriaStartDate" name="oHrmPrmCriteria" style="width:90%" styleClass="required" readonly="true"  onchange='<%="doChangeDetail("+idx.toString()+")"%>'  /><enrgise:img width="16"  height="19" align="top"  src="../includes/images/cal.gif" name="oHrmPrmCriteria"  property="butCriteriaStartDate" alt="<%=idx.toString()%>" onclick="showCalendar('txtCriteriaStartDate',this)" /> </td>
                              <TD class=tableText ><html:text property="txtCriteriaEndDate" name="oHrmPrmCriteria" style="width:90%" styleClass="optional" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>'  /><enrgise:img width="16" height="19" align="top"  src="../includes/images/cal.gif" name="oHrmPrmCriteria"  property="butCriteriaEndDate" alt="<%=idx.toString()%>" onclick="showCalendar('txtCriteriaEndDate',this)" /> </td>
                              <TD class=tableText ><enrgise:text property="txtMinServicePeriod" name="oHrmPrmCriteria" style="width:99%" styleClass="optional"  maxlength="2" disabledClass="locked" onkeypress="isInteger(event)" onchange='<%="doChangeDetail("+idx.toString()+")"%>'  /></td>
                              <TD class=tableText ><enrgise:text property="txtReqYears" name="oHrmPrmCriteria" style="width:99%" styleClass="required" maxlength="2" disabledClass="locked" onkeypress="isInteger(event)" onchange='<%="doChangeDetail("+idx.toString()+")"%>'  /></td>
                              <TD class=tableText ><enrgise:text property="txtYearAPAR" name="oHrmPrmCriteria" style="width:99%" styleClass="required" maxlength="1" disabledClass="locked" onkeypress="isInteger(event)" onchange='<%="doChangeDetail("+idx.toString()+")"%>'  /></td>
                            </tr>
                            </logic:notEqual>
                            <logic:equal name="oHrmPrmCriteria" property="status" value="D" >
                            <tr>
                              <TD class=tableText width="1%">
                                <html:hidden property="status"  name="oHrmPrmCriteria" />
                                <html:hidden property="detailId"  name="oHrmPrmCriteria"  />
                                <input type="checkbox" name="checked" disabled  />
                                <html:hidden property="itemChecked" name="oHrmPrmCriteria" />
                              </TD>
                              <TD class=tableText ><html:text property="txtDescription" name="oHrmPrmCriteria" style="width:100%"  styleClass="locked" readonly="true" /></td>
                              <TD class=tableText ><html:text property="txtCriteriaStartDate" name="oHrmPrmCriteria" style="width:100%" styleClass="locked" readonly="true" /></td>
                              <TD class=tableText ><html:text property="txtCriteriaEndDate" name="oHrmPrmCriteria" style="width:100%" styleClass="locked" readonly="true" /></td>
                              <TD class=tableText ><html:text property="txtMinServicePeriod" name="oHrmPrmCriteria" style="width:100%" styleClass="locked" readonly="true"  /></td>
                              <TD class=tableText ><html:text property="txtReqYears" name="oHrmPrmCriteria" style="width:100%" styleClass="locked"  readonly="true" /></td>
                              <TD class=tableText ><html:text property="txtYearAPAR" name="oHrmPrmCriteria" style="width:100%" styleClass="locked" readonly="true" /></td>
                            </logic:equal>
                         </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="HrmPrmCriteriaForm" property="screenName" value="HrmPrmCriteria" />
<html:hidden name="HrmPrmCriteriaForm" property="forwardedPage" />
<html:hidden name="HrmPrmCriteriaForm" property="positionRequested"  />
<html:hidden name="HrmPrmCriteriaForm" property="screenMode" />

<html:hidden property="userPageRequested" name="HrmPrmCriteriaForm" />
<html:hidden property="userPositionRequested" name="HrmPrmCriteriaForm" />
<html:hidden property="pageRequested" name="HrmPrmCriteriaForm" />
<html:hidden property="headerDataChanged" name="HrmPrmCriteriaForm" />
<html:hidden property="detailDataChanged" name="HrmPrmCriteriaForm" />

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

<html:hidden property="toGradeId" name="HrmPrmCriteriaForm"  />
<html:hidden property="fromDesigId" name="HrmPrmCriteriaForm"  />
<html:hidden property="toDesigId" name="HrmPrmCriteriaForm"  />

<html:hidden property="gradeSeq" name="HrmPrmCriteriaForm"  />
<html:hidden property="desigSeq" name="HrmPrmCriteriaForm"  />

<html:hidden property="headerPrimaryKey" name="HrmPrmCriteriaForm"  />
<html:hidden property="firstLoad" name="HrmPrmCriteriaForm"  />
<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

</html:form>

</body>
</html:html>
<script>

function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmPrmCriteriaOnLoadAction.do"; 
  }
}

function doChangeHeader()
{
}

function doValidate()
{
  return "HrmPrmCriteriaValidateAction.do"; 
}

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

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

function doExecute()
{
  return "HrmPrmCriteriaGetHeaderAction.do";
}

function doSave()
{
  return "HrmPrmCriteriaSaveAction.do";
}

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

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

function doPrevHeader()
{
  return "HrmPrmCriteriaGetNextHeaderAction.do"; 
}
function doExit()
{
  return "HrmPrmCriteriaExitAction.do"; 
}
function doNextHeader()
{
  return "HrmPrmCriteriaGetNextHeaderAction.do"; 
}

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

function doGetDetail()
{
  return "HrmPrmCriteriaGetDetailAction.do";
}

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

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

function doPrevDetail()
{
  return "HrmPrmCriteriaGetDetailPageAction.do";  
}

function doNextDetail()
{
  return "HrmPrmCriteriaGetDetailPageAction.do";
}

function doJumpDetail()
{
  return "HrmPrmCriteriaGetDetailPageAction.do"; 
}




function ShowFromGrade()
{
        document.forms[0].lovKey.value = "PrmPromFromGrade" + "HrmPrmCriteriaForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmPrmKPARating.gradeCode,hrm.HrmPrmKPARating.gradeDesc";
        document.forms[0].txtDisplayFields.value = "headerPrimaryKey,fromGradeCode,fromGradeDesc,gradeSeq";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPrmCriteriaForm');
        return true;
}

function ShowFromDesignation()
{
        document.forms[0].lovKey.value = "PrmPromFromDesig" + "HrmPrmCriteriaForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmPrmKPARating.desigCode,hrm.HrmPrmKPARating.desigDesc";
        document.forms[0].txtDisplayFields.value = "fromDesigId,fromDesigCode,fromDesigDesc,desigSeq";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPrmCriteriaForm');
        return true;
}

function ShowToGrade()
{
        document.forms[0].queryParam.value ="gradeSeq="+ document.forms[0].gradeSeq.value +" " ;
        document.forms[0].lovKey.value = "PrmPromToGrade" + "HrmPrmCriteriaForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmPrmKPARating.gradeCode,hrm.HrmPrmKPARating.gradeDesc";
        document.forms[0].txtDisplayFields.value = "toGradeId,toGradeCode,toGradeDesc";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPrmCriteriaForm');
        return true;
}

function ShowToDesignation()
{
        document.forms[0].queryParam.value ="desigSeq="+ document.forms[0].desigSeq.value +" " ;
        document.forms[0].lovKey.value = "PrmPromToDesig" + "HrmPrmCriteriaForm" + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmPrmKPARating.desigCode,hrm.HrmPrmKPARating.desigDesc";
        document.forms[0].txtDisplayFields.value = "toDesigId,toDesigCode,toDesigDesc";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmPrmCriteriaForm');
        return true;
}

function doOnChangeLov(lovName)
{
   if((lovName=="PrmPromFromGradeHrmPrmCriteriaFormQ")||(lovName=="PrmPromFromDesigHrmPrmCriteriaFormQ") ||(lovName=="PrmPromToGradeHrmPrmCriteriaFormQ"))
    {
    doBaseValidate();
    }
}


function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
</script>