<%@ 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>
<HEAD>
    <html:base />
    <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="HrmRoasterEntryForm" action="HrmRoasterEntryBaseAction" type="wenrgise.hrms.webtier.form.HrmRoasterEntryForm">
<bean:define id="ParentForm" name="HrmRoasterEntryForm" 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.HrmRoasterEntry.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 >
        <!--Master Information Starts -->
         <TR>
            <TD class=subHeader colspan=6><bean:message key="hrm.HrmRoasterEntry.RoasterMaster" /></TD>
         </TR>
         <TR>
            <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
         </TR>
               <td class="labelText"><bean:message key="hrm.HrmRoasterEntry.txtRoasterCode" /></td>
               <td><enrgise:text  property="txtRoasterCode" name="HrmRoasterEntryForm" titleKey="hrm.HrmRoasterEntry.txtRoasterCode" maxlength="20" size="23" styleClass="required" disabledClass="required"  onchange="doChangeHeader();" /><enrgise:img name="HrmRoasterEntryForm" height="16" align="center" src="../includes/images/lov.jpg"   property="butRoasterCode" onclick="return ShowRoasterCode();" /></td>
               <td class="labelText"><bean:message key="hrm.HrmRoasterEntry.txtRoasterDescription" /> </td>
               <td><enrgise:text  property="txtRoasterDescription" name="HrmRoasterEntryForm"  titleKey="hrm.HrmRoasterEntry.txtRoasterDescription" maxlength="40" size="26" styleClass="locked" disabledClass="required" onchange="doChangeHeader();" /></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 cellSpacing=0 cellPadding=0 >
             <tr>
                <td bgcolor="#4682B4" ></td>
                <enrgise:tab name="HrmRoasterEntryForm" property="butRoasterDtlTab" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_r.gif" ><bean:message key="hrm.HrmRoasterEntry.RoasterEntryDetail" /></enrgise:tab>
                <td width="80%"> </td>
            </tr>   
              <!-- Detail table Container starts -->
              <TD colSpan=6>
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                 <TR>
                  <TD >
                  <DIV id=divDtlTable style="height:300px">
                    <TABLE  border="0" cellSpacing=0 cellPadding=0 id="roasterEntry">
                     <TBODY>
                        <tr>
                          <TD class=tableHeader width="1%"><input type="checkbox" name="selectAll"  onclick="toggleCheckBox('checked')"  /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtRoasterPoint" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtCategoryAsPerRoaster" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.entryMode" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtEmployeeNo" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtEmployeeName" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtAppointmentDate" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtDob" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtCategory" /></td>
                          <!--<td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtSalaryRollNo" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtConsumedByCategory" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtReserved" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtShortfall" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtReplacedBy" /></td>
                          <td class=tableHeader ><bean:message key="hrm.HrmRoasterEntry.txtRemarks" /></td>-->
                       </tr>
                       
                            <logic:iterate id="HrmRoaster" name="HrmRoasterEntryForm" property="arrHrmRoasterEntryDtl" type="wenrgise.hrms.bean.HrmRoasterEntryDtlBean"  indexId="idx"  >
                               <logic:notEqual name="HrmRoaster" property="status" value="D">
                                 <tr>
                                     <td><html:checkbox property="checked" value="check" name="HrmRoasterEntryForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt); " />
                                     <html:hidden property="socialStatus"  name="HrmRoaster" /> 
                                     <html:hidden property="itemChecked" name="HrmRoaster" />
                                     <html:hidden property="status" name="HrmRoaster" />
                                     <html:hidden property="detailId"  name="HrmRoaster" />
                                     <html:hidden property="empNoId"  name="HrmRoaster" />
                                     <html:hidden property="txtCategoryId"  name="HrmRoaster" />
                                     </td>            
                                     <td class=tableText ><html:text property="txtRoasterPoint" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtRoasterPoint" name="HrmRoaster" style="width:100%" styleClass="required" readonly="false" alt="A"  onkeypress="isInteger(event);" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                     <td class=tableText ><html:text property="txtCategoryAsPerRoaster" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtCategoryAsPerRoaster" name="HrmRoaster" style="width:90%" styleClass="required" readonly="true" alt="A" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img height="16" align="center" src="../includes/images/lov.jpg" property="butCategoryAsPerRoaster" class="icon" alt="<%=idx.toString()%>" onclick=" return ShowSocialStatus(this.alt);" /></td>
                                    <td><enrgise:select property="entryMode" name="HrmRoaster" formName="HrmRoasterEntryForm" styleClass="required" disabledClass="required" alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt)"  >
                                    <enrgise:option value="X" >Not Applicable</enrgise:option>      
                                    <enrgise:option value="M" >Merit</enrgise:option>
                                    <enrgise:option value="D" >Direct</enrgise:option>
                                    <enrgise:option value="Q" >Quota</enrgise:option>
                                    </enrgise:select></td>
                                     <td class=tableText ><html:text property="txtEmployeeNo" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtEmployeeNo" name="HrmRoaster"  style="width:79%" styleClass="optional" readonly="true" alt="A" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img height="16" align="center" src="../includes/images/lov.jpg" property="butEmployeeNo" class="icon" alt="<%=idx.toString()%>" name="HrmRoasterEntryForm" onclick=" return ShowEmpDetails(this.alt);" /></td>
                                     <td class=tableText ><html:text property="txtEmployeeName" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtEmployeeName" name="HrmRoaster" style="width:100%" styleClass="optional" readonly="true" alt="A" /></td> 
                                     <td class=tableText ><html:text property="txtAppointmentDate" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtAppointmentDate" name="HrmRoaster"  style="width:100%" styleClass="optional" readonly="true" alt="N" /></td>
                                     <td class=tableText ><html:text property="txtDob" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtDob" name="HrmRoaster" style="width:100%" styleClass="optional" readonly="true" alt="N" /></td>
                                     <td class=tableText ><html:text property="txtCategory" maxlength="100" size="15" titleKey="hrm.HrmRoasterEntry.txtCategory" name="HrmRoaster" style="width:100%" styleClass="optional" readonly="true" alt="A" /></td> 
                                 </tr>
                              </logic:notEqual>
                              <logic:equal name="HrmRoaster" property="status" value="D"  >
                                   <tr>
                                     <td width="1%"><html:checkbox property="checked" value="check" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);"  />
                                     <html:hidden property="socialStatus"  name="HrmRoaster" />
                                     <html:hidden property="itemChecked" name="HrmRoaster" />
                                     <html:hidden property="status" name="HrmRoaster" />
                                     <html:hidden property="detailId"  name="HrmRoaster" />
                                     <html:hidden property="empNoId"  name="HrmRoaster" />
                                     <html:hidden property="txtCategoryId"  name="HrmRoaster" />
                                     </td>            
                                     <td class=tableText ><html:text property="txtRoasterPoint"  size="15" titleKey="hrm.HrmRoasterEntry.txtRoasterPoint" name="HrmRoaster"  style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>"  onkeypress="isInteger(event);"  onchange="doChangeDetail(this.alt);" /></td>
                                     <td class=tableText ><html:text property="txtCategoryAsPerRoaster" size="15" titleKey="hrm.HrmRoasterEntry.txtCategoryAsPerRoaster" name="HrmRoaster" style="width:90%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /><img height="16" align="center" src="../includes/images/lov.jpg" property="butCategoryAsPerRoaster" class="icon" alt="<%=idx.toString()%>"  onclick=" return ShowSocialStatus(this.alt);" /></td>
                                     <td><enrgise:select property="entryMode" name="HrmRoaster" formName="HrmRoasterEntryForm" styleClass="required" disabledClass="required" alt="<%=idx.toString()%>" onchange="doChangeDetail(this.alt)"  >
                                    <enrgise:option value="X" >Not Applicable</enrgise:option>      
                                    <enrgise:option value="M" >Merit</enrgise:option>
                                    <enrgise:option value="D" >Direct</enrgise:option>
                                    <enrgise:option value="Q" >Quota</enrgise:option>
                                    </enrgise:select></td>
                                     <td class=tableText ><html:text property="txtEmployeeNo" size="15" titleKey="hrm.HrmRoasterEntry.txtEmployeeNo" name="HrmRoaster" style="width:79%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /><img height="16" align="center" src="../includes/images/lov.jpg" property="butEmployeeNo" class="icon" alt="<%=idx.toString()%>"  onclick=" return ShowEmpDetails(this.alt);" /></td>
                                     <td class=tableText ><html:text property="txtEmployeeName" size="15" titleKey="hrm.HrmRoasterEntry.txtEmployeeName" name="HrmRoaster" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                     <td class=tableText ><html:text property="txtAppointmentDate" size="15" titleKey="hrm.HrmRoasterEntry.txtAppointmentDate" name="HrmRoaster" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td> 
                                     <td class=tableText ><html:text property="txtDob" size="15" titleKey="hrm.HrmRoasterEntry.txtDob" name="HrmRoaster" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td> 
                                     <td class=tableText ><html:text property="txtCategory" size="15" titleKey="hrm.HrmRoasterEntry.txtCategory" name="HrmRoaster" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                 </tr>
                              </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>
<html:hidden name="HrmRoasterEntryForm"  property="screenMode" />
<html:hidden name="HrmRoasterEntryForm"  property="screenName" value="HrmRoasterEntry" />
<html:hidden name="HrmRoasterEntryForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmRoasterEntryForm" />
<html:hidden property="userPageRequested" name="HrmRoasterEntryForm" />
<html:hidden property="userPositionRequested" name="HrmRoasterEntryForm" />
<html:hidden property="pageRequested" name="HrmRoasterEntryForm" />
<html:hidden property="headerPrimaryKey" name="HrmRoasterEntryForm" />
<html:hidden property="headerDataChanged" name="HrmRoasterEntryForm" />
<html:hidden property="detailDataChanged" name="HrmRoasterEntryForm" />
<!-- Container Table Ends -->
<!------ addded for LOV ----->
<html:hidden property="lovKey" name="HrmRoasterEntryForm"  />
<html:hidden property="txtSearchFields" name="HrmRoasterEntryForm"  />
<html:hidden property="txtDisplayFields" name="HrmRoasterEntryForm"  />
<html:hidden property="txtIndex" name="HrmRoasterEntryForm"  />
<html:hidden property="firstLoad" name="HrmRoasterEntryForm"  />
<html:hidden property="roasterCodeId" name="HrmRoasterEntryForm" />
<input type="hidden" name="queryParam" >
<!-- Hidden fields added by Indranil -->


</html:form>
</body>
</html:html>
  
<script language="javascript">

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

  return "HrmRoasterEntryQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmRoasterEntryNewModeAction.do";
}


function doExecute()
{

  return "HrmRoasterEntryGetHeaderAction.do";
}

function doSave()
{

  return "HrmRoasterEntrySaveAction.do";
  
}

function doDelete()
{

  return "HrmRoasterEntryDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmRoasterEntryRefreshAction.do";
  
}

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

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

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

function doGetDetail()
{

  return "HrmRoasterEntryGetDetailAction.do";
}

function doAddRow()
{

  return "HrmRoasterEntryAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "roasterEntry";
}

function doPrevDetail()
{

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

  return "HrmRoasterEntryExitAction.do";  
}

function doNextDetail()
{

  return "HrmRoasterEntryGetDetailPageAction.do";
}

function doJumpDetail()
{
  return  "HrmRoasterEntryGetDetailPageAction.do"; 
}
function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmRoasterEntryOnLoadAction.do"; 
  }
}
function ShowRoasterCode()
{
        document.forms[0].txtIndex.value ="";
        document.forms[0].lovKey.value = "RoasterCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmRoasterEntry.txtRoasterCode,hrm.HrmRoasterEntry.txtRoasterDescription";
        document.forms[0].txtDisplayFields.value = "roasterCodeId,txtRoasterCode,txtRoasterDescription";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRoasterEntryForm');
        return true;
}
function ShowSocialStatus(i)
{
        
        document.forms[0].lovKey.value = "RstrEtySocialStatus" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmRoasterEntry.code,hrm.HrmRoasterEntry.desc";
        document.forms[0].txtIndex.value = i;
        document.forms[0].txtDisplayFields.value = "socialStatus,txtCategoryAsPerRoaster";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRoasterEntryForm');
}
function ShowEmpDetails(i)
{
        
        document.forms[0].lovKey.value = "RoasterEmpdetailsCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmRoasterEntry.txtEmployeeNo,hrm.HrmRoasterEntry.txtEmployeeName";
        document.forms[0].txtIndex.value = i;
        document.forms[0].txtDisplayFields.value = "empNoId,txtCategoryId,txtEmployeeNo,txtEmployeeName,txtAppointmentDate,txtDob,txtCategory";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmRoasterEntryForm');
}
function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
</script>