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

<html:form name="HrmLvCancForm" action="HrmLeaveCancelBaseAction" type="wenrgise.hrms.webtier.form.HrmLvCancForm">
<bean:define id="ParentForm" name="HrmLvCancForm" 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.HrmLeaveCancellation.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.HrmLeaveCancellation.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.HrmLeaveCancellation.employeeNo" /></td>
          <td><html:text  property="employeeNo" titleKey="hrm.HrmLeaveCancellation.employeeNo" name="HrmLvCancForm" maxlength="10" size="26" alt="P" styleClass="locked" readonly="true" /></td>
          <td colspan="4"></td>
          </tr>
          <tr>
            <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.employeeName" /></td>
            <td colspan="4"><html:text  property="firstName" titleKey="hrm.HrmLeaveCancellation.FirstName" name="HrmLvCancForm" maxlength="20" size="36" styleClass="locked" readonly="true"   alt="A" /><html:text  property="middleName" titleKey="hrm.HrmLeaveCancellation.MiddleName" name="HrmLvCancForm" maxlength="20" size="36" styleClass="locked" readonly="true"   alt="A" /><html:text  property="lastName" titleKey="hrm.HrmLeaveCancellation.LastName" name="HrmLvCancForm" maxlength="20" size="35" styleClass="locked" readonly="true"   alt="A" /></td> 
            <td > </td>   
           
          </tr>
  <!--09/02/06>
  <-->
   <tr> 
                                <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.grade" /></td>
                                <td><html:text  property="grade" titleKey="hrm.HrmLeaveCancellation.grade" name="HrmLvCancForm" size="26" styleClass="locked" readonly="true"  onchange="doChangeHeader();" /></td>
                                <td  width="7%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.desig" /></td>
                                <td><html:text  property="desig" titleKey="hrm.HrmLeaveCancellation.desig" name="HrmLvCancForm" size="26" styleClass="locked" readonly="true"  onchange="doChangeHeader();" /></td>             

                                <td  class="labelText"><bean:message key="hrm.HrmLeaveCancellation.location" /></td>
                                <td><html:text  property="location" titleKey="hrm.HrmLeaveCancellation.location" name="HrmLvCancForm"  maxlength="4" size="26" styleClass="locked" readonly="true" alt="D" onchange="doChangeHeader();" /></td>
                                   <html:hidden  property="designation" titleKey="hrm.HrmLeaveCancellation.designation" name="HrmLvCancForm"   />         
                         </tr> 
     <!-- end 09/02/06>
  <-->
         
              
       
           </table> 
    <table cellspacing=0 cellpadding=0 border=0>
         
 	 <TR>
       <TD>
        <!-- Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
          <TR>
            <TD class=subHeader colspan=6><bean:message key="hrm.HrmLeaveCancellation.subHeader4" /></TD>
          </TR>
          <TR>
            <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
          </TR>
      
          <tr>
                  <td width="13%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.leaveCode" /></td>
                  <td><enrgise:text  property="leaveCode" titleKey="hrm.HrmLeaveCancellation.leaveCode" name="HrmLvCancForm" maxlength="20" size="23" styleClass="required" disabledClass="locked" alt="P" /><enrgise:img height="16" align="center"  src="../includes/images/lov.jpg" property="butLeaveCode" name="HrmLvCancForm" onclick=" return ShowLeaveCode()" /></td>
                          
                  <td   class="labelText"><bean:message key="hrm.HrmLeaveCancellation.leaveDescription" /></td>
                  <td><html:text  property="leaveDescription" titleKey="hrm.HrmLeaveCancellation.leaveDescription" name="HrmLvCancForm" maxlength="40" size="26" styleClass="locked" readonly="true" alt="P" /></td>              
                              
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.dateApplied" /></td>
                  <td><enrgise:text  property="dateApplied" titleKey="hrm.HrmLeaveCancellation.dateApplied" name="HrmLvCancForm"  size="26" styleClass="required" disabledClass="locked" alt="D" /></td>
                              
          </tr>
                    
          <tr> 
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.fromDate" /></td>
                  <td><enrgise:text  property="fromDate" titleKey="hrm.HrmLeaveCancellation.fromDate" name="HrmLvCancForm" size="26" styleClass="required" disabledClass="locked" alt="D" /></td>
                              
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.toDate" /></td>
                  <td><enrgise:text  property="toDate" titleKey="hrm.HrmLeaveCancellation.toDate" name="HrmLvCancForm"  size="26" styleClass="required" disabledClass="locked" alt="D" /></td>
                              
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.days" /></td>
                  <td><html:text  property="days" titleKey="hrm.HrmLeaveCancellation.days" name="HrmLvCancForm" maxlength="4" size="26" styleClass="locked" readonly="true" alt="D" /></td>
         </tr> 
                       
          <tr> 
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.purpose" /></td>
                  <td colspan="3"><enrgise:textarea  property="purpose" titleKey="hrm.HrmLeaveCancellation.purpose" name="HrmLvCancForm" cols="96" rows="2" styleClass="required" disabledClass="locked" alt="A" />
                  <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.statusOfLeave" /></td>
              
                   <td><enrgise:select property="statusOfLeave" alt="statusOfLeave" name="HrmLvCancForm" styleClass="optional" disabledClass="locked"  >
                  <enrgise:option value="" ><bean:message   key="hrm.pleaseSelect" /></enrgise:option>      
                  <enrgise:option value="NC" > <bean:message key="hrm.HrmLeaveCancellation.noCancel" /></enrgise:option>
                  <enrgise:option value="Y" > <bean:message key="hrm.HrmLeaveCancellation.full" /></enrgise:option>
                  <enrgise:option value="N" > <bean:message key="hrm.HrmLeaveCancellation.partial" /></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>
        <!-- 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.HrmLeaveCancellation.subHeader3" /><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:150px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                           
                              <td class=tableHeader height="20" colspan="6"></td>
                          </tr>  
                         
                          <tr> 
                                <td width="13%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.fromCancelDate" /></td>
                                <td><html:text  property="fromCancelDate" titleKey="hrm.HrmLeaveCancellation.fromCancelDate" name="HrmLvCancForm" size="26" styleClass="required" readonly="true"  onchange="doChangeHeader();" /><!--//<enrgise:img  src="../includes/images/cal.gif"  width="15" height="19" align="top" styleClass="icon" property="butFromCancelDate" name="HrmLvCancForm"   onclick="showCalendar('fromCancelDate',this)"   />--></td>             
                                            
                                <td width="18%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.toCancelDate" /></td>
                                <td><html:text  property="toCancelDate" titleKey="hrm.HrmLeaveCancellation.toCancelDate" name="HrmLvCancForm" size="26" styleClass="required" readonly="true"  onchange="doChangeHeader();" /><!--//<enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" styleClass="icon" property="butToCancelDate" name="HrmLvCancForm"  onclick="showCalendar('toCancelDate',this)"  />--></td>             

                                <td width="19%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.cancelDays" /></td>
                                <td><html:text  property="cancelDays" titleKey="hrm.HrmLeaveCancellation.cancelDays" name="HrmLvCancForm"  maxlength="4" size="26" styleClass="locked" readonly="true" alt="D" onchange="doChangeHeader();" /></td>
                                            
                         </tr> 

                          <tr> 

                                <td width="13%" class="labelText"><bean:message key="hrm.HrmLeaveCancellation.cancelDateApplied" /></td>
                                <td><enrgise:text  property="cancelDateApplied" titleKey="hrm.HrmLeaveCancellation.cancelDateApplied" name="HrmLvCancForm" size="23" styleClass="required" disabledClass="required" alt="D" onchange="doChangeHeader();" /><enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" styleClass="icon" property="butCancelDateApplied" name="HrmLvCancForm"  onclick="showCalendar('cancelDateApplied',this)"  /></td>             

                                <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.cancelRemarks" /></td>
                                <td><enrgise:textarea  property="cancelRemarks" titleKey="hrm.HrmLeaveCancellation.cancelRemarks" name="HrmLvCancForm" cols="28" rows="2" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();"  alt="A" />

                                <td class="labelText"><bean:message key="hrm.HrmLeaveCancellation.cancelStatus" /></td>
                                <td><html:select disabled="true" property="cancelStatus" name="HrmLvCancForm" alt="cancelStatus" styleClass="locked"  onchange=" doChangeHeader();"  >
                                <html:option value="" ><bean:message   key="hrm.pleaseSelect" /></html:option>      
                                <html:option value="P" > <bean:message key="hrm.HrmLeaveCancellation.pending" /></html:option>
                                <html:option value="N" > <bean:message key="hrm.HrmLeaveCancellation.new" /></html:option>
                                <html:option value="A" > <bean:message key="hrm.HrmLeaveCancellation.approved" /></html:option>
                                <html:option value="R" > <bean:message key="hrm.HrmLeaveCancellation.rejected" /></html:option>
                                </html:select></td> 
                               
                         </tr> 



                                 
                                <!--Insert Logic Iterate Here-->                                                      
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                   </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><enrgise:button  alt="Approve (Alt+P)" onclick="doBaseApprove()" name="HrmLvCancForm" property="butApprove" styleClass="bottomBarText">A<u>p</u>prove</enrgise:button><enrgise:button  alt="Reject (Alt+J)"  onclick="doBaseReject()"  name="HrmLvCancForm" property="butReject" styleClass="bottomBarText">&nbsp;&nbsp;Re<u>j</u>ect&nbsp;</enrgise:button></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="HrmLvCancForm" value="HrmEmployeeLeaveCancellationBatchScreen" />
<html:hidden name="HrmLvCancForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmLvCancForm" />
<html:hidden property="screenMode" name="HrmLvCancForm" />
<html:hidden name="HrmLvCancForm" property="headerPrimaryKey"  />
<html:hidden property="userPageRequested" name="HrmLvCancForm" />
<html:hidden property="userPositionRequested" name="HrmLvCancForm" />
<html:hidden property="pageRequested" name="HrmLvCancForm" />

<html:hidden property="hdnDetailId" name="HrmLvCancForm" />
  <%! String sTransId; %>
  <%sTransId=request.getParameter("transId");%>
<html:hidden property="transId" value="<%=sTransId%>" />

<html:hidden property="lovKey" name="HrmLvCancForm"  />
<html:hidden property="txtSearchFields" name="HrmLvCancForm"  />
<html:hidden property="txtDisplayFields" name="HrmLvCancForm"  />
<html:hidden property="txtIndex" name="HrmLvCancForm"  />
<html:hidden property="leaveCodeId" name="HrmLvCancForm"  />
<html:hidden property="headerDataChanged" name="HrmLvCancForm"  />
<html:hidden property="headerPrimaryKey" name="HrmLvCancForm"  />
<html:hidden property="employeeId" name="HrmLvCancForm"  />
<html:hidden property="buttonName" name="HrmLvCancForm"  />
<html:hidden property="firstLoad" name="HrmLvCancForm"  />

<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >
</html:form>
</body>
</html:html>

<script language="javascript">


function doQueryMode()
{
  return "HrmEmpLeaveCancelBatchScreenQueryModeAction.do";
}
function doChangeHeader()
{
 if(document.forms[0].screenMode.value=="U" || document.forms[0].screenMode.value=="N")
 document.forms[0].headerDataChanged.value="true";
}


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

function doValidate()
{
  return "HrmLvCancValidateAction.do";
}
function doExit()
{
  return "HrmEmpLeaveCancelBatchScreenExitAction.do";
}
function doExecute()
{
  return "HrmEmpLeaveCancelBatchScreenGetHeaderAction.do";
}

function doSave()
{
  //document.forms[0].screenMode.value="U";
  //document.forms[0].headerDataChanged.value="true";
  return "HrmEmpLeaveCancelBatchScreenSaveAction.do";
}

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

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

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

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

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

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

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

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

function doGetDetailTableName()
{
  return "HrmEmpLeaveCancelBatchScreen";
}

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

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

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

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

function ShowLeaveCode()
{
        document.forms[0].lovKey.value = "EmpLvCancCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmLeaveCancellation.leaveCode,hrm.HrmLeaveCancellation.leaveDescription";
        document.forms[0].txtDisplayFields.value = "leaveCodeId,leaveCode,leaveDescription,dateApplied,fromDate,toDate,days,purpose,statusOfLeave";
        document.forms[0].multipleFlag.value = "false";
        document.forms[0].queryParam.value = "employeeNo="+ document.forms[0].employeeId.value;
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmLvCancForm');
        return true;
}


function doApprove()
{
  document.forms[0].buttonName.value="butApprove";
 return "HrmLvCancGetButtonAction.do";
}
function doReject()
{
  document.forms[0].buttonName.value="butReject";
  return "HrmLvCancGetButtonAction.do";
}
function doGetInsertData()
{
 
}

function doOnChangeLov(lovKey)
{
  document.forms[0].fromCancelDate.value=document.forms[0].fromDate.value;
  document.forms[0].toCancelDate.value=document.forms[0].toDate.value;
  document.forms[0].cancelDays.value=document.forms[0].days.value;
}



function setDates()
{
    if(document.forms[0].cancSide.value== "L")
    {
      document.forms[0].fromCancelDate.value=document.forms[0].fromDate.value;
      document.forms[0].toCancelDate.value=" ";
    }
    if(document.forms[0].cancSide.value=="R")
    {
      document.forms[0].fromCancelDate.value=" ";
      document.forms[0].toCancelDate.value=document.forms[0].toDate.value;
    }
    if(document.forms[0].cancSide.value=="F")
    {
      document.forms[0].fromCancelDate.value=document.forms[0].fromDate.value;
      document.forms[0].toCancelDate.value=document.forms[0].toDate.value;
    }
}
</script>


