<%@ 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" onkeydown="hotKeys(event);";>

<html:form  name="HrmLoanAppForm" action="HrmLoanAppRepayBaseAction" type="wenrgise.hrms.webtier.form.HrmLnAppForm">
<bean:define id="ParentForm" name="HrmLoanAppForm" toScope="request" />
<jsp:include page="GenIconMenu.jsp" flush="true" />
<html:errors/>
<!--Top Most Blue Bar-->
<html:hidden property="detailDataChanged" name="HrmLoanAppForm" />
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmEmpLoanAppln.mainHeader" /></TD>
    </TR>
</TABLE>


<TABLE cellSpacing=0 cellPadding=0 border=0 >
    <TR>
        <TD>
        
        <TABLE cellSpacing=0 cellPadding=0 >
        <!--Application Header Starts -->
              <TR>
                    <TD class=subHeader colspan=6><bean:message key="hrm.HrmEmpLoanAppln.subHeader1" /></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.HrmEmpLoanAppln.employeeNumber" /></td>
                  <td><enrgise:text  property="employeeNumber" titleKey="hrm.HrmEmpLoanAppln.employeeNumber" maxlength="10" size="26" styleClass="optional" disabledClass="locked" alt="P"   onchange="doChangeHeader();" /></td>
                  <td colspan=3></td>
                  <td rowspan="4" align="center"><img src="a.gif" width="90px" height="80px" ></td>
              </tr>
              <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.employeeName" /></td>
                  <td colspan="3"><enrgise:text  property="firstName" titleKey="hrm.HrmEmpLoanAppln.FirstName" maxlength="20" size="36" styleClass="optional" disabledClass="locked"  readonly="true" alt="A" onchange="doChangeHeader();" />              
                                  <enrgise:text  property="middleName" titleKey="hrm.HrmEmpLoanAppln.MiddleName" maxlength="20" size="36" styleClass="optional" disabledClass="locked"  readonly="true" alt="A" onchange="doChangeHeader();" />
                                  <enrgise:text  property="lastName" titleKey="hrm.HrmEmpLoanAppln.LastName" maxlength="20" size="35" styleClass="optional" disabledClass="locked"  readonly="true" alt="A" onchange="doChangeHeader();" /></td> 
                  <td > </td>                
              </tr>
             <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.designation" /></td>
                  <td><enrgise:text  property="designation" titleKey="hrm.HrmEmpLoanAppln.designation" maxlength="20" size="26" styleClass="optional" disabledClass="locked" alt="P" readonly="true" onchange="doChangeHeader();"  /></td>
                  <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.scaleOfPay" /></td>
                  <td><enrgise:text  property="scaleOfPay" titleKey="hrm.HrmEmpLoanAppln.scaleOfPay" maxlength="10" size="26" styleClass="optional" disabledClass="locked" alt="C" readonly="true" onchange="doChangeHeader();" /></td>
                  <td > </td>
              </tr>
             
             <tr> 
                  <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.loanCode" /></td>
                  <td colspan="5"><enrgise:text  property="loanCode" titleKey="hrm.HrmEmpLoanAppln.loanCode" maxlength="10" size="26" styleClass="optional" disabledClass="locked" alt="P" onchange="doChangeHeader();"   /><enrgise:img name="HrmLoanAppForm" height="16" align="center" src="../includes/images/lov.jpg" property="butLoanCode" onclick="return ShowEmpLoanCode()" /><enrgise:text  property="loanDesc" altKey="hrm.HrmEmpLoanAppln.loanDesc" maxlength="255" size="85" styleClass="optional" disabledClass="locked" disabled="true" onchange="doChangeHeader()"  /></td>
             </tr>
              <tr>
                    <td colspan="5"></td>
                    <td align="center"><button class="bottomBarText"  name="butSlPhoto" disabled="true"  > Pho<u>t</u>ograph </button></td>
             </tr>
         </table>
      
      
         <table cellspacing=0 cellpadding=0 border=0>
         <!-- Detail Information Row starts -->
 	 <TR>
       <TD colspan=6>
        <!-- Personal Details Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
           <tr>
                <enrgise:tab name="HrmLoanAppForm" property="tabLoanDetails" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmLnApp','HrmLoanAppGetTabAction.do')" ><bean:message key="hrm.HrmEmpLoanAppDisbur.loan" /></enrgise:tab>
                <enrgise:tab name="HrmLoanAppForm" property="tabDisbursement" styleClass="disTabText" disabledClass="lockedTab" src="../includes/images/formtab_lb.gif" rows="2" onclick= "doGetTab('HrmLnDisDtl','HrmLoanAppGetTabAction.do')" ><bean:message key="hrm.HrmEmpLoanAppDisbur.disbursement" /></enrgise:tab>
                <enrgise:tab name="HrmLoanAppForm" property="tabRepaymentSchedule" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_r.gif" rows="2" ><bean:message key="hrm.HrmEmpLoanAppDisbur.repayment" /></enrgise:tab>
               
                
                <td width="50%"> </td>
             
          </tr>                  
          <TR >
 <!-- Detail table Container starts -->
              <TD colspan=37>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:280px;width:1020px" >
  			<!-- Detail table starts -->
                        <TABLE 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.HrmEmpLoanAppRepay.yearMonth" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.openBalancePri" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.openBalanceInt" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.principalPaid" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.interestPaid" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.interestAccrued" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmEmpLoanAppRepay.interestRate" /></td>
                        
                         
                         </tr>  
                         
                         <logic:iterate id="HrmEmpLoanAppRepay" name="HrmLoanAppForm" property="arrLoanRepayment" type="wenrgise.hrms.bean.HrmLnAppRepayDtlBean" indexId="idx" >
                            <logic:notEqual name="HrmEmpLoanAppRepay" property="status" value="D" >
                             <tr class='<bean:write name="HrmLoanAppForm" property="listRowClass"/>'  >
                                <td >
                                <html:hidden property="status"  name="HrmEmpLoanAppRepay" />
                                <html:hidden property="detailId"  name="HrmEmpLoanAppRepay"  />
                                <html:checkbox property="checked"  name="HrmLoanAppForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmEmpLoanAppRepay" />
                                </td>
                                <TD class=tableText><enrgise:text property="yearMonth" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                                <TD class=tableText><enrgise:text property="openBalancePri" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                                <TD class=tableText><enrgise:text property="openBalanceInt" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                                <TD class=tableText><enrgise:text property="principalPaid" name="HrmEmpLoanAppRepay" size="15"  formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>
                                <TD class=tableText><enrgise:text property="interestPaid" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                                <TD class=tableText><enrgise:text property="interestAccrued" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                                <TD class=tableText><enrgise:text property="interestRate" name="HrmEmpLoanAppRepay" size="12" formName="HrmLoanAppForm" styleClass="locked" disabledClass="locked"  alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>  
                              
                             </tr>
                             </logic:notEqual>
                             <logic:equal name="HrmEmpLoanAppRepay" property="status" value="D"  >
                               <tr class='<bean:write name="HrmLoanAppForm" property="listRowClass"/>'  >
                                <td >
                                <html:hidden property="status"  name="HrmEmpLoanAppRepay" />
                                <html:hidden property="detailId"  name="HrmEmpLoanAppRepay"  />
                                <html:checkbox property="checked"  name="HrmLoanAppForm" value="check" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />
                                <html:hidden property="itemChecked" name="HrmEmpLoanAppRepay" />
                                </td>
                                
                                <TD class=tableText ><enrgise:text property="yearMonth" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                                <TD class=tableText ><enrgise:text property="openBalancePri" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                                <TD class=tableText ><enrgise:text property="openBalanceInt" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                                <TD class=tableText><enrgise:text property="principalPaid" name="HrmEmpLoanAppRepay"  style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);"  /></td>   
                                <TD class=tableText ><enrgise:text property="interestPaid" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                                <TD class=tableText ><enrgise:text property="interestAccrued" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                                <TD class=tableText ><enrgise:text property="interestRate" name="HrmEmpLoanAppRepay" style="width:80%" formName="HrmLoanAppForm" styleClass="deletedRow" disabledClass="locked"   alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt);" /></td>
                             </tr>
                             </logic:equal>
                        </logic:iterate>
                          
           <!--Insert Logic Iterate Here-->                                                      
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                     <!-- <tr>
                          <td colspan=11>	
                             <jsp:include page="GenDetailMenu.jsp" /> 
                          </TD>
                           <td width="19%"></td>
                      </tr> -->
                  
                   <tr>
                       <bean:define id="pageNo" name="ParentForm" property="pageRequested" toScope="request" />
                       <bean:define id="maxPage" name="ParentForm" property="totalPageCount" toScope="request" />
                        <TABLE border=0>
                          <tbody>
                          <TR>
                            <TD ><enrgise:button  onclick="doBaseGetDetail()" name="HrmEmpTrngHistForm"  property="butGetDetail"  styleClass="bottomBarText">&nbsp;Get De<u>t</u>ail&nbsp;</enrgise:button> <button onclick="doBaseAddRow()" name="butAddRow" disabled="true" styleClass="bottomBarText">&nbsp;&nbsp;Add <u>R</u>ow&nbsp;&nbsp;</button><button  onclick="doBaseDelRow()"
                            name="butDelRow" disabled="true" styleClass="bottomBarText" ><u>D</u>elete Row</button></TD>
                            <td width=50%></td>	
                            <TD ><enrgise:img name="ParentForm" property="butPrevDetail" src="../includes/images/butn_dtl_prev.jpg" onmouseover='this.src="../includes/images/butn_dtl_prev_act.jpg"' onmouseout='this.src="../includes/images/butn_dtl_prev.jpg"' alt="Butn_prev (Alt+<)"  onclick="doBasePrevDetail()"/></td>
                            <td class=dtlNavText><bean:write  name="pageNo" /> of 
                            <bean:write name="maxPage" /></td></td>
                            <td  align=right><enrgise:img name="ParentForm" property="butNextDetail" src="../includes/images/butn_dtl_next.jpg" onmouseover='this.src="../includes/images/butn_dtl_next_act.jpg"' onmouseout='this.src="../includes/images/butn_dtl_next.jpg"' alt="Butn_next (Alt+>)" onclick="doBaseNextDetail()"/></td>
                            <td  align=right><enrgise:text property="newPageRequested" size="1" onkeydown="isInteger(event)" styleClass="optional" disabledClass="locked" /></td>
                            <td ><enrgise:img name="ParentForm" property="butJumpDetail" altKey="wenrgise.common.go" src="../includes/images/go_dtl.jpg" onclick="doBaseJumpDetail()" /></td>		     
                          </TR>
                        
                          </tbody>
                        </TABLE>
                    </tr>     
                      
                      
                   </TBODY>
                </TABLE>
              </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><button class=bottomBarText  >Generat<u>e</u></button><button class=bottomBarText  >Settle Loa<u>n</u></button><button class=bottomBarText  >Bac<u>k</u></button></td>                 
                        <td bgColor=#4682b4></td>
                        <td align=right class="icon" bgColor=#4682b4><img src="../includes/images/man.jpg"></td>
                     </TR>
              </table>
            </td>
          </tr>
 
<!-- Container Table Ending Columns Starts-->
  </TD>
    
</TR>
</TBODY>
</TABLE>

<!-- Container Table Ends -->

<html:hidden name="HrmLoanAppForm" property="screenName" value="HrmLnAppRepay" />
<html:hidden name="HrmLoanAppForm" property="forwardedPage" />
<html:hidden name="HrmLoanAppForm" property="positionRequested"  />
<html:hidden name="HrmLoanAppForm" property="screenMode" />

<html:hidden property="headerPrimaryKey" name="HrmLoanAppForm" />
<html:hidden property="headerDataChanged" name="HrmLoanAppForm" />


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

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

<html:hidden property="loanCodeId" name="HrmLoanAppForm" />

<html:hidden property="txtIndex" name="HrmLoanAppForm"  />
<html:hidden property="userPageRequested" name="HrmLoanAppForm" />
<html:hidden property="userPositionRequested"  name="HrmLoanAppForm" />
<html:hidden property="pageRequested"  name="HrmLoanAppForm" />

<!-- Hidden fields end -->

</html:form>
</body>
</html:html>

<script language="javascript">


/*function doCheckInitialise(elem, i)
{
  i=i*2;
  alert(document.getElementsByName(elem.name).length +" " + elem.name+ " " + i);
  
  if(elem.checked){
    document.getElementsByName(elem.name)[i+1].value="on";
  }
  else{
    document.getElementsByName(elem.name)[i+1].value="off";
  }

  
}
*/
function doChangeHeader()
{
 document.forms[0].headerDataChanged.value="true";
}

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


function doInsertMode()
{

  return "HrmLoanAppRepayNewModeAction.do";
}


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

function doSave()
{
  document.forms[0].headerDataChanged.value="Y";
  return "HrmLoanAppRepaySaveAction.do";
  
}

function doDelete()
{

  return "HrmLoanAppRepayDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmLoanAppRepayRefreshAction.do";
  
}

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

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

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

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

function doAddRow()
{

  return "HrmLoanAppRepayAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "HrmLoanAppRepayBatch";
}

function doPrevDetail()
{

  return "HrmLoanAppRepayGetDetailPageAction.do";  
}
function doExit()
{

  return "HrmLoanAppRepayExitAction.do";  
}

function doNextDetail()
{

  return "HrmLoanAppRepayGetDetailPageAction.do";
}

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


function doGetInsertData()
{

}
function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmLoanAppRepayOnLoadAction.do"; 
  }
}
function ShowEmpLoanCode()
{
        document.forms[0].lovKey.value = "LoanCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpLoanAppln.loanCode,hrm.HrmEmpLoanAppln.loanDesc";
        document.forms[0].txtDisplayFields.value = "loanCodeId,loanCode,loanDesc";
        document.forms[0].multipleFlag.value="false";
      
        showLov('/enrgise/hrms/jsp/CommonSearchScreen.jsp','HrmLoanAppForm');
        return true;
        
       
}


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