<%@ 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" />
  <meta http-equiv=pragma content=no-cache>
</head>


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

<html:form name="HrmLvLedgerForm" action="HrmLeaveLdgrBaseAction" type="wenrgise.hrms.webtier.form.HrmLvLedgerForm">
<bean:define id="ParentForm" name="HrmLvLedgerForm" toScope="request" />

<jsp:include page="GenIconMenu.jsp" flush="true" />

<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmLeaveLedger.mainHeader" /></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.HrmLeaveLedger.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.HrmLeaveLedger.employeeNo" /></td>
                <td><html:text  property="employeeNo" titleKey="hrm.HrmLeaveLedger.employeeNo" size="23"  styleClass="locked"  readonly="true" onkeypress="isInteger(event)" /><enrgise:img height="16" align="center"  src="../includes/images/lov.jpg" property="butEmpCode" name="HrmLvLedgerForm" onclick="return ShowEmpCode()" /></td>            
                <td class="labelText"><bean:message key="hrm.HrmLeaveLedger.employeeName" /></td>
                <td><html:text  property="employeeName" titleKey="hrm.HrmLeaveLedger.employeeName" size="40" styleClass="locked" readonly="true"  /></td>              
                <td colspan="2" width="30%"></td>
            </TR>
            <tr>    
                <td class="labelText"><bean:message key="hrm.HrmLeaveLedger.leaveCode" /></td>
                <td colspan="4" ><html:text  property="leaveCode" titleKey="hrm.HrmLeaveLedger.leaveCode" size="23"  styleClass="optional" readonly="true" /><enrgise:img height="16" align="center"  src="../includes/images/lov.jpg" property="butLeaveCode" name="HrmLvLedgerForm" onclick="return ShowLeaveCode()" />
                <html:text  property="leaveDescription" titleKey="hrm.HrmLeaveLedger.leaveDescription" size="70" styleClass="locked"  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>
        <!-- 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 >Leave Status<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=11>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:170px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                           <tr>
                              <TD class=tableHeader width="1%"><input type=radio readonly=true ></TD>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.leaveTypes" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.creditDate" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.openingBalance" /></td>
                              <TD class=tableHeader width="6%"><bean:message key="hrm.HrmLeaveLedger.leavesCredited" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.leavesTaken" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.leavesEncashed" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.leavePending" /></td>
                              <TD class=tableHeader width="6%"><bean:message  key="hrm.HrmLeaveLedger.leaveBalance" /></td>
                           </tr>  
                           <logic:iterate id="HrmLedger" name="HrmLvLedgerForm" property="arylstLvLedger" type="wenrgise.hrms.bean.HrmLvLedgerDtlBean" indexId="idx" >
                                <tr>
                                  <td ><html:hidden property="status"  name="HrmLedger" /><html:hidden property="detailId"  name="HrmLedger"  /><html:radio property="selectAll" value="<%=idx.toString()%>" onclick="setCheckedValues(this.value)"  /></td>
                                  <TD class=tableText><html:text property="txtleaveTypes" name="HrmLedger" style="width:100%" alt="A"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>   
                                  <TD class=tableText><html:text property="txtCreditDate" name="HrmLedger" style="width:100%" alt="D"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>                                
                                  <TD class=tableText><html:text property="txtOpeningBalance" name="HrmLedger" style="width:100%" alt="C"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>   
                                  <TD class=tableText><html:text property="txtLeavesCredited" name="HrmLedger" style="width:100%" alt="N"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>                                
                                  <TD class=tableText><html:text property="txtLeavesTaken" name="HrmLedger" style="width:100%" alt="N"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>   
                                  <TD class=tableText><html:text property="txtLeavesEncashed" name="HrmLedger" style="width:100%" alt="N"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                  <TD class=tableText><html:text property="txtLeavesPending" name="HrmLedger" style="width:100%" alt="N"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                  <TD class=tableText><html:text property="txtLeaveBalance" name="HrmLedger" style="width:100%" alt="A"  styleClass="locked" readonly="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>   
                               </tr>
                          </logic:iterate>
   
                                                    
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                    <!--     <TABLE border=0>
                        
                        <TR>
                          <TD width=32%></TD>
                          <td width=50%> </td>	
                          <TD class="icon"><IMG 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+<)" src="../INCLUDES/butn_dtl_prev.jpg" onclick="doBasePrevDetail()" ></td>
                          <td class=dtlNavText>1 of 1</td>
                          <td class="icon" align=right><IMG src="../includes/images/butn_dtl_next.jpg" onmouseover='this.src="../includes/images/butn_dtl_next_act.jpg"' ame="butNextGetDtl1" onmouseout='this.src="../includes/images/butn_dtl_next.jpg"' alt="Butn_next (Alt+>)" src="../INCLUDES/butn_dtl_next.jpg" onclick="doBaseNextDetail()"></td>
                          <td class="icon" align=right><html:text property="newPageRequested" size="1" onkeydown="isInteger(event)" /></td>
                          <td class="icon"><input type="image" Alt="Go (Alt+G)" src="../includes/images/go_dtl.jpg" onclick="doBaseJumpDetail()"></td>		     
                        </TR>
                      
                       
                   </TABLE>-->
                 </TBODY>
                </TABLE>
              </td>
            </tr>

       <table cellspacing=0 cellpadding=0 border=0>
         <!-- Detail Information Row starts -->
 	              <!-- 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-->
  </TD>
    
</TR>
</TBODY>
</TABLE>

<!-- Container Table Ends -->

<html:hidden property="screenName" name="HrmLvLedgerForm" value="HrmEmployeeLeaveLedger" />
<html:hidden name="HrmLvLedgerForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmLvLedgerForm" />
<html:hidden property="screenMode" name="HrmLvLedgerForm" />

<html:hidden property="userPageRequested" name="HrmLvLedgerForm" />
<html:hidden property="userPositionRequested" name="HrmLvLedgerForm" />
<html:hidden property="pageRequested" name="HrmLvLedgerForm" />
<html:hidden property="hdnDetailId" name="HrmLvLedgerForm" />
<!------ addded for LOV ----->

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

<html:hidden property="employeeNumberId" name="HrmLvLedgerForm"  />
<html:hidden property="leaveTypeId" name="HrmLvLedgerForm"  />

<html:hidden property="leavesType" />
<html:hidden property="leavesTaken" />
<html:hidden property="leavesEncashed" />
<html:hidden property="firstLoad" name="HrmLvLedgerForm" />
<html:hidden property="headerDataChanged" name="HrmLvLedgerForm" />
<html:hidden property="detailDataChanged" name="HrmLvLedgerForm" />
<html:hidden property="groupId" name="HrmLvLedgerForm" />
<html:hidden property="employeeNoId" name="HrmLvLedgerForm" />




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


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

<script language="javascript">

function doChangeHeader()
{
 if(document.forms[0].screenMode.value=="N")
 document.forms[0].headerDataChanged.value="true";
}


function doQueryMode()
{

  return "HrmLeaveLdgrQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmLeaveLdgrNewModeAction.do";
}


function doExecute()
{
 if (document.forms[0].employeeNo.value=="")
 {
 return "HrmLeaveLdgrQueryModeAction.do";
 }
 else
 {
  return "HrmLeaveLdgrGetDetailAction.do";
  }
 
}


function doDelete()
{

  return "HrmLeaveLdgrDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmLeaveLdgrRefreshAction.do";
  
}


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

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

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

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


function doAddRow()
{

  return "HrmLeaveLdgrAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "HrmLeaveLdgr";
}

function doPrevDetail()
{

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

  return "HrmEmpLeaveLdgrExitAction.do";  
}


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


function doGetInsertData()
{}

function doGetDetail()
{
  if(event.srcElement.name=="butGetDtl2")
  {
    for(i=0; i< document.getElementsByName('selectAll').length; i++)
    {
      if(document.getElementsByName('selectAll')[i].checked)
      {
          document.forms[0].screenName.value=document.forms[0].screenName.value+"Dtl2";
          return "HrmLeaveLdgrTrnscGetDetailAction.do";
      }
    }
  }
  
}


function doNextDetail()

{

  if(event.srcElement.name=="butNextGetDtl2")
  {
    document.forms[0].screenName.value+="Dtl2";
    return "HrmLeaveLdgrTrnscGetDetailPageAction.do";
  }
  else
  return "HrmLeaveLdgrGetDetailPageAction.do";
}



function doGetDetailTableName()
{
  return "HrmLeaveLdgrTrnsc";
}

function setCheckedValues(val)
{
document.forms[0].hdnDetailId.value=document.getElementsByName("DetailId")[val].value;
document.forms[0].leavesType.value=document.getElementsByName("txtleaveTypes")[val].value;
document.forms[0].leavesTaken.value=document.getElementsByName("txtLeavesTaken")[val].value;
document.forms[0].leavesEncashed.value=document.getElementsByName("txtLeavesEncashed")[val].value;
}
function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmLeaveLdgrOnLoadAction.do"; 
  }
}
<!---- Added For LOV ---->
function ShowEmployeeNumber()
{
        document.forms[0].lovKey.value = "LvLdgrEmployeeNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmLeaveLedger.employeeNo,hrm.HrmLeaveLedger.employeeName";
        document.forms[0].txtDisplayFields.value = "employeeNumberId,employeeNo,employeeName";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmLvLedgerForm');
        return true;
        
}

function ShowLeaveCode()
{
        document.forms[0].lovKey.value = "LvLdgrLeaveCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmLeaveLedger.leaveCode,hrm.HrmLeaveLedger.leaveDescription";
        document.forms[0].txtDisplayFields.value = "leaveTypeId,leaveCode,leaveDescription";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmLvLedgerForm');
        return true;
        
}

function ShowEmpCode()
{
        document.forms[0].lovKey.value = "LvLdgrEmpCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmLeaveLedger.employeeNo,hrm.HrmLeaveLedger.employeeName";
        document.forms[0].txtDisplayFields.value = "employeeNumberId,employeeNo,employeeName";
        document.forms[0].queryParam.value = "empId="+document.forms[0].employeeNoId.value;
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmLvLedgerForm');
        return true;
        
}

function doOnChangeLov(lovKey)
{
      if(document.forms[0].lovKey.value = "LvLdgrEmployeeNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value)
      {
        document.forms[0].headerDataChanged.value = 'false' ;
      }
}
</script>

