<%@ 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="HrmLvApplnQueryForm" action="/HrmLvApplnQueryBaseAction" type="wenrgise.hrms.webtier.form.HrmLvApplnQueryForm">
<bean:define id="ParentForm" name="HrmLvApplnQueryForm" toScope="request" />

<jsp:include page="GenMenu.jsp" flush="true" />
<bean:define id="left" name="ParentForm" property="positionRequested"/>
<bean:define id="right" name="ParentForm" property="totalCount"/>
<table cellSpacing=0 bgColor=#bdd0ef>
<tr height=27>
  <td colSpan=11></td>
</tr>
  <TR > 
     <TD ><enrgise:img name="ParentForm" property="butQuery" onmouseover='this.src="../includes/images/query_act.jpg"' onmouseout='this.src="../includes/images/query.jpg"' alt="Query (Ctrl+Q)" src="../includes/images/query.jpg" onclick="doBaseQueryMode()" /><img  property="butInsert" src="../includes/images/insert_dis.jpg" /></TD>
    <TD width="2%"></TD>
    <TD ><img property="butExecute"  alt="Execute (Ctrl+U)" src="../includes/images/execute_dis.jpg"  /><enrgise:img name="ParentForm" property="butSave" onmouseover='this.src="../includes/images/save_act.jpg"' onmouseout='this.src="../includes/images/save.jpg"' alt="Save (Ctrl+S)" src="../includes/images/save.jpg" onclick="doBaseSave()" />
    <enrgise:img name="ParentForm" property="butDelete" onmouseover='this.src="../includes/images/delete_act.jpg"' onmouseout='this.src="../includes/images/delete.jpg"' alt="Delete (Ctrl+D)" src="../includes/images/delete.jpg" onclick="doBaseDelete()" /><img  property="butRefresh" onmouseover='this.src="../includes/images/refresh_act.jpg"' onmouseout='this.src="../includes/images/refresh.jpg"' alt="Refresh (Ctrl+R)"  src="../includes/images/refresh.jpg" onclick="doBaseRefresh()" />
    <enrgise:img name="ParentForm" property="butPrint" onmouseover='this.src="../includes/images/print_act.jpg"' onmouseout='this.src="../includes/images/print.jpg"' alt="Print (Ctrl+P)"  src="../includes/images/print.jpg" /></TD>
    <TD width="2%" bgColor=#bdd0ef></TD>
    <TD><enrgise:img name="ParentForm" property="butExit"  onclick="doBaseExit()" onmouseover='this.src="../includes/images/exit_act.jpg"' onmouseout='this.src="../includes/images/exit.jpg"' alt="Exit (Alt+X)"  src="../includes/images/exit.jpg" /><enrgise:img name="ParentForm" property="butHelp" onmouseover='this.src="../includes/images/help_act.jpg"' onmouseout='this.src="../includes/images/help.jpg"' alt="Help (Ctrl+?)" src="../includes/images/help.jpg" /></TD>
    <TD width="50%"></TD>
    <TD ><enrgise:img name="ParentForm" property="butPrevHeader" src='../includes/images/butn_prev.jpg' onmouseover='this.src="../includes/images/butn_prev_act.jpg"' onmouseout='this.src="../includes/images/butn_prev.jpg"' alt="Butn_prev (Ctrl+<)" onclick="doBasePrevHeader()" /></td>
    <td class=dtlNavText><bean:write  name="left" /> of 
    <bean:write name="right" /></td>
    <td align=right><enrgise:img name="ParentForm" property="butNextHeader" src="../includes/images/butn_next.jpg" onmouseover='this.src="../includes/images/butn_next_act.jpg"' onmouseout='this.src="../includes/images/butn_next.jpg"' alt="Butn_next (Ctrl+>)" onclick="doBaseNextHeader()" /></td>
    <td align=right><html:text property="newPositionRequested" size="1" onkeydown="isInteger(event)" title=" " alt="N" /></td>
    <td ><enrgise:img name="ParentForm" property="butJumpHeader" alt="Go (Ctrl+G)" src="../includes/images/go.jpg" onmouseover='this.src="../includes/images/go_act.jpg"' onmouseout='this.src="../includes/images/go.jpg"' onclick="doBaseJumpHeader()" /></td>
    <td > </td>
</TR>
</TABLE>

<table>
<tr>
  <td colspan="11" class="userText"></td>
</tr>
<enrgise:checkSession/>
</TABLE>

<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmLeaveApplicationQuery.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.HrmLeaveApplicationQuery.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.HrmLeaveApplicationQuery.employeeNo" /></td>
                <td><html:text  property="employeeNo" titleKey="hrm.HrmLeaveApplicationQuery.employeeNo"  size="23"  styleClass="optional" onkeypress="isInteger(event)"  readonly="true" /><enrgise:img height="16" align="center"  name="HrmLvApplnQueryForm" src="../includes/images/lov.jpg" property="butEmployeeNo" onclick=" return ShowEmployeeNumber();doOnChangeLOV(lovKey)"  /></td>
                <td class="labelText"><bean:message key="hrm.HrmLeaveApplicationQuery.leaveCode" /></td>
                <td><html:text  property="leaveCode" titleKey="hrm.HrmLeaveApplicationQuery.leaveCode" size="23" styleClass="optional"  readonly="true"  /><enrgise:img height="16" align="center" name="HrmLvApplnQueryForm"  src="../includes/images/lov.jpg" property="butLeaveCode" onclick=" return ShowLeaveCode();doOnChangeLOV(lovKey)"  /></td>
                <td class="labelText"><bean:message key="hrm.HrmLeaveApplicationQuery.leaveDescription" /></td>
                <td><html:text  property="leaveDescription" titleKey="hrm.HrmLeaveApplicationQuery.leaveDescription" maxlength="40" alt="P" size="26" name="HrmLvApplnQueryForm" styleClass="locked" readonly="true" /></td>
            </tr>
            <tr>
                <td class="labelText"><bean:message key="hrm.HrmLeaveApplicationQuery.fromDate" /></td>
                <td><html:text  property="fromDate" titleKey="hrm.HrmLeaveApplicationQuery.fromDate"  size="23" styleClass="optional" readonly="true"  name="HrmLvApplnQueryForm" alt="D" onchange="doBaseValidate();" /><enrgise:img width="16" height="19" align="top" styleClass="icon" name="HrmLvApplnQueryForm" src="../includes/images/cal.gif" property="butFromDate"   onclick="showCalendar('fromDate',this)" /></td>              
                <td class="labelText"><bean:message key="hrm.HrmLeaveApplicationQuery.toDate" /></td>
                <td><html:text  property="toDate" titleKey="hrm.HrmLeaveApplicationQuery.toDate"  size="23" styleClass="optional" readonly="true" name="HrmLvApplnQueryForm" alt="D" onchange="doBaseValidate();" /><enrgise:img width="16" height="19" align="top" styleClass="icon" name="HrmLvApplnQueryForm" src="../includes/images/cal.gif" property="butToDate"   onclick="showCalendar('toDate',this)" /></td>              
                <td class="labelText"><bean:message key="hrm.HrmLeaveApplicationQuery.statusOfLeave" /></td>
                <td><enrgise:select property="statusOfLeave" alt="statusOfLeave" styleClass="optional" disabledClass="locked" name="HrmLvApplnQueryForm" onchange="doBaseValidate();" >
                      <enrgise:option value="" ><bean:message   key="hrm.pleaseSelect" /></enrgise:option>      
                      <enrgise:option value="N" ><bean:message key="hrm.HrmLeaveApplicationQuery.new" /></enrgise:option>
                      <enrgise:option value="P" ><bean:message key="hrm.HrmLeaveApplicationQuery.pending" /></enrgise:option>
                      <enrgise:option value="A" ><bean:message key="hrm.HrmLeaveApplicationQuery.approved" /></enrgise:option>
                      <enrgise:option value="R" ><bean:message key="hrm.HrmLeaveApplicationQuery.rejected" /></enrgise:option>
                      </enrgise: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>
        <!--  Details 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 Information<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:280px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><input type=checkbox disabled=true styleClass=locked ></TD>
                              <TD class=tableHeader width="6%"><bean:message key="hrm.HrmLeaveApplicationQuery.transId" /></td>
                              <TD class=tableHeader width="10%"><bean:message  key="hrm.HrmLeaveApplicationQuery.leaveCodes" /></td>
                              <TD class=tableHeader width="10%"><bean:message key="hrm.HrmLeaveApplicationQuery.appliedLeaveDate" /></td>
                              <TD class=tableHeader width="10%"><bean:message key="hrm.HrmLeaveApplicationQuery.leaveStatus" /></td>
                         </tr>
                         
                        <logic:iterate id="HrmQuery" name="HrmLvApplnQueryForm" property="arylstLvApplnQuery" type="wenrgise.hrms.bean.HrmLvApplnQueryDtlBean" indexId="idx" >
                                  <tr class='<bean:write name="HrmLvApplnQueryForm" property="listRowClass" />'  >
                                    <td ><html:hidden property="status" name="HrmQuery" /><html:hidden property="detailId" name="HrmQuery" /><html:hidden  property="selectAll"   /></td>
                                    <TD align="center" ><html:link action="LinkHrmEmpLeaveApp" paramId="transId" paramProperty="txtTransId" paramName="HrmQuery" styleClass="labelText" >VIEW</html:link></td>   
                                    <TD class=tableText ><html:text property="txtLeaveCodes" name="HrmQuery"  style="width:100%" alt="P" maxlength="20"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' styleClass="locked"  readonly="true" /></td>                                
                                    <TD class=tableText ><html:text property="txtAppliedLeaveDate" name="HrmQuery"  style="width:100%" alt="D"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' styleClass="locked"  readonly="true" /></td>
                                    <td><html:select property="txtLeaveStatus" name="HrmQuery"  style="width:100%" alt="A" onchange="doChangeDetail(this.name)" styleClass="locked" disabled="true"  >
                                        <html:option value="" ><bean:message   key="hrm.pleaseSelect" /></html:option>      
                                        <html:option value="N" > <bean:message key="hrm.HrmLeaveApplicationQuery.new" /></html:option>
                                        <html:option value="P" > <bean:message key="hrm.HrmLeaveApplicationQuery.pending" /></html:option>
                                        <html:option value="A" > <bean:message key="hrm.HrmLeaveApplicationQuery.approved" /></html:option>
                                        <html:option value="R" > <bean:message key="hrm.HrmLeaveApplicationQuery.rejected" /></html:option>
                                        </html:select></td> 
                                  </tr>
                           </logic:iterate>
                       </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                      <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 altKey="wenrgise.common.getDetail"  onclick="doBaseGetDetail()" property="butGetDetail" name="ParentForm" styleClass="bottomBarText">&nbsp;Get&nbsp;De<u>t</u>ail&nbsp;</enrgise:button><button onclick="doBaseAddRow()" name="butAddRow" disabled="true" styleClass="bottomBarText">&nbsp;&nbsp;Add&nbsp;<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=45% 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="HrmLvApplnQueryForm" value="HrmLeaveAppQuery" />
<html:hidden name="HrmLvApplnQueryForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmLvApplnQueryForm" />
<html:hidden property="screenMode" name="HrmLvApplnQueryForm" />

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

<html:hidden property="headerPrimaryKey" name="HrmLvApplnQueryForm" />

<html:hidden property="hdnDetailId" name="HrmLvApplnQueryForm" />
<html:hidden property="transId" />

<!------ addded for LOV ----->

<html:hidden property="lovKey" name="HrmLvApplnQueryForm"  />
<html:hidden property="txtSearchFields" name="HrmLvApplnQueryForm"  />
<html:hidden property="txtDisplayFields" name="HrmLvApplnQueryForm"  />
<html:hidden property="txtIndex" name="HrmLvApplnQueryForm"  />
<html:hidden property="employeeNoId" name="HrmLvApplnQueryForm"  />
<html:hidden property="leaveTypeId" name="HrmLvApplnQueryForm"  />
<html:hidden property="firstLoad" name="HrmLvApplnQueryForm"  />

<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!="Q")
 {

 document.forms[0].headerDataChanged.value="false";
 }
}


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


function doInsertMode()
{

  return "HrmApplnQueryNewModeAction.do";
}


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

function doSave()
{

  return "HrmApplnQuerySaveAction.do";
  
}

function doDelete()
{

  return "HrmApplnQueryDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmApplnQueryRefreshAction.do";
  
}

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

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

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

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

function doAddRow()
{

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

  return "HrmApplnQueryExitAction.do"; 
}

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

function doGetDetailTableName()
{
  return "HrmApplnQueryBatch";
}

function doPrevDetail()
{

  return "HrmApplnQueryGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmApplnQueryGetDetailPageAction.do";
}

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


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

document.forms[0].txtIndex.value=val;
document.forms[0].transId.value=document.getElementsByName("txtTransId")[val].value;
}

function setTransId(val)
{     
        //window.open("<html:rewrite page="/hrms/jsp/HrmEmployeeLeaveApplication.jsp" />","_self");
        //return true;             
     
        document.forms[0].transId.value=val;
        
}

<!---- Added For LOV ---->
function ShowEmployeeNumber()
{
        document.forms[0].lovKey.value = "LvAppQryEmployeeNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmLeaveApplicationQuery.employeeNo,hrm.HrmLeaveApplicationQuery.employeeName";
        document.forms[0].txtDisplayFields.value = "employeeNoId,employeeNo";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmLvApplnQueryForm');
        return true;
        
}

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

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

function doOnChangeLov(lovName)
{
  if((lovName == 'LvAppQryEmployeeNoHrmLeaveAppQueryQ')||(lovName == 'LvAppQryLeaveCodeHrmLeaveAppQueryQ'))
  {
    doBaseValidate();
  } 
}



function doGetInsertData()
{}


</script>    