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

<html:form name="HrmAttEmpSRForm" action="HrmAttEmpSRBaseAction" type="wenrgise.hrms.webtier.form.HrmAttEmployeeShiftRosterForm">
<bean:define id="ParentForm" name="HrmAttEmpSRForm" 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.HrmAttEmployeeShiftRoster.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 >
        <!--Shift Roster Header Starts -->
            <TR>
                  <TD class=subHeader colspan=6>Shift Roster Header</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.HrmAttEmployeeShiftRoster.workGroupCode" /></td>
                  <td><html:text  property="workGroupCode" altKey="hrm.HrmAttEmployeeShiftRoster.workGroupCode" styleClass="locked" readonly="true" maxlength="10" size="23" />
                  
                  <enrgise:img  src="../includes/images/lov.jpg" height="16" align="center" property="butWorkGrpCode" name="HrmAttEmpSRForm" onclick="ShowWorkCode();" /> 
                  </td>              
                  
                  <td class="labelText"><bean:message key="hrm.HrmAttEmployeeShiftRoster.empNo" /></td>
                  <td><html:text  property="employeeNo" altKey="hrm.HrmAttEmployeeShiftRoster.empNo" maxlength="10" size="23" styleClass="locked" readonly="true" />                  
                 <enrgise:img  src="../includes/images/lov.jpg" height="16" align="center" property="butEmpNo" name="HrmAttEmpSRForm" onclick="ShowEmpNo();" /> 
                  </td>              
                  
                  <td class="labelText"><bean:message key="hrm.HrmAttEmployeeShiftRoster.empName" /></td>
                  <td ><html:text  property="employeeName" altKey="hrm.HrmAttEmployeeShiftRoster.empName" maxlength="60" size="40" styleClass="locked" readonly="true" /></td>
           
                  
           </tr>
           <tr>
                  <td class="labelText"><bean:message key="hrm.HrmAttEmployeeShiftRoster.periodStartDate" /></td>
                  <td><html:text  property="periodStartDate"  maxlength="10" size="23" styleClass="locked" readonly="true" onchange="doChangeHeader();"  /><img src="../includes/images/cal.gif"  width=15 height=19 align="top"  property="butperiodStartDate"   onclick="showCalendar('periodStartDate',this)" /></td>
                 
                  
                  <td class="labelText"><bean:message key="hrm.HrmAttEmployeeShiftRoster.periodEndDate" /></td>
                  <td><html:text  property="periodEndDate"  maxlength="10" size="23" styleClass="locked" readonly="true" />
                  <img src="../includes/images/cal.gif"  width=15 height=19 align="top"  property="butperiodEndDate"   onclick="showCalendar('periodEndDate',this)" />
                  </td>

                  <td class="labelText"><bean:message key="hrm.HrmAttEmployeeShiftRoster.SiteId" /></td>
                  <td><html:text  property="txtSiteId"  maxlength="10" size="23" styleClass="locked" readonly="true" />
                  <enrgise:img  src="../includes/images/lov.jpg" height="16" align="center" property="butSiteId" name="HrmAttEmpSRForm" onclick="ShowSiteCode();" /> 
                  
                  </td>

           
           
           </tr>
           <tr>
                  <td height="10"></td>
           </tr>            
      </table>
      
      
         <table cellspacing=0 cellpadding=0 border=0>
         <!-- Detail Information Row starts -->
 	 <TR>
       <TD colspan=6>
        <!-- Employee Dasy Off 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 >Shift Roster Detail<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=6>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                   <TR>
                     <TD >
                       <DIV id=divDtlTable style="height:270px" >
  			<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><input type=checkbox></TD>
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmAttEmployeeShiftRoster.workDt" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmAttEmployeeShiftRoster.empNo" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmAttEmployeeShiftRoster.mandHoliday" /></td>
                              <TD class=tableHeader width="5%"><bean:message key="hrm.HrmAttEmployeeShiftRoster.workDayType" /></td>
                              <TD class=tableHeader width="5%"><bean:message  key="hrm.HrmAttEmployeeShiftRoster.shiftCode" /></td>
                          </tr>  
                                                  
           <!--Insert Logic Iterate Here-->                                                      
                     
                     <logic:iterate id="EmpShiftRosterInfo" name="HrmAttEmpSRForm" property="arylstEmpShiftRosterDtl" type="wenrgise.hrms.bean.HrmAttEmpShiftRosterDtlBean" indexId="idx" >
                             
                               <logic:notEqual name="EmpShiftRosterInfo" property="status" value="D" >  
                                   <tr>
                                       <td ><html:checkbox property="checked" onclick='<%="boxClicked("+idx.toString()+")"%>'  value="check" name="HrmAttEmpSRForm" /></td>
                                    
                                      <td ><html:text property="txtWorkDate" name="EmpShiftRosterInfo"  styleClass="required" readonly="true" size="20" style="width:85%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' />
                                          <img src="../includes/images/lov_dis.jpg" height="16" align="center" alt="<%=idx.toString()%>" property="buttxtPayCode"   >
                                      </td> 
                                        
                                       <td ><html:text property="txtEmpNo" name="EmpShiftRosterInfo"  styleClass="locked" readonly="true" size="20" style="width:100%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td> 
                                       
                                        <html:hidden property="txtMandatoryHoliady" name="EmpShiftRosterInfo" />
                                        <td ><html:select  disabled="true" property="txtMandatoryHoliady" name="EmpShiftRosterInfo"  styleClass="required" onchange='<%="Convert(this,"+idx.toString()+");doChangeDetail("+idx.toString()+")"%>'   >
                                        <html:option value=" ">-----------------Please select-----------------</html:option>
                                        <html:option value="W">Working</html:option>
                                        <html:option value="H">Holiday</html:option>
                                        
                                        </html:select></td>   
                                        
                                        <html:hidden property="txtAvailability" name="EmpShiftRosterInfo" />
                                        <td ><html:select  disabled="true" property="txtAvailability" name="EmpShiftRosterInfo"  styleClass="required" onchange='<%="Convert(this,"+idx.toString()+");doChangeDetail("+idx.toString()+")"%>'   >
                                        <html:option value=" ">-----------------Please select-----------------</html:option>
                                        <html:option value="0">Full Day</html:option>
                                        <html:option value="1">1st Half</html:option>
                                        <html:option value="2">2nd Half</html:option>
                                        
                                        </html:select></td>     
                                        
                                       <td ><html:text property="txtShiftCode" name="EmpShiftRosterInfo"  styleClass="required" readonly="true" size="20" style="width:85%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' />
                                           <img src="../includes/images/lov_dis.jpg" height="16" align="center" alt="<%=idx.toString()%>" property="buttxtAgencyCode"   >
                                       </td>
                                       
                                       <html:hidden property="itemChecked" name="EmpShiftRosterInfo" />
                                       <html:hidden property="status" name="EmpShiftRosterInfo" />
                                       <html:hidden property="detailId" name="EmpShiftRosterInfo" />
                                       <html:hidden property="txtShiftCodeId" name="EmpShiftRosterInfo" />
                                      </tr>
                                 </logic:notEqual>                               
                                 
                                <logic:equal name="EmpShiftRosterInfo" property="status" value="D" >
                                   <tr>
                                       <td ><html:checkbox property="checked" value="check" disabled="true" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);"/></td>
                                       <td ><html:text property="txtWorkDate" name="EmpShiftRosterInfo"  styleClass="deletedRow" readonly="true" size="20" style="width:85%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img src="../includes/images/lov.jpg" height="16" align="center" alt="<%=idx.toString()%>" property="buttxtPayCode"  onclick="ShowLovPayCode(this.alt);" >
                                        <td ><html:text property="txtEmpNo" name="EmpShiftRosterInfo"  styleClass="deletedRow" readonly="true" size="20" style="width:100%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td> 
                                       <td ><html:text property="txtMandatoryHoliady" name="EmpShiftRosterInfo"  styleClass="deletedRow" readonly="true" size="20" style="width:85%" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img src="../includes/images/lov.jpg" height="16" align="center" alt="<%=idx.toString()%>" property="buttxtAgencyCode"  onclick="ShowLovAgencyCode(this.alt);" ></td>
                                       
                                       <html:hidden property="txtAvailability" name="EmpShiftRosterInfo" />
                                       <td ><html:select property="txtAvailability" name="EmpShiftRosterInfo"  styleClass="deletedRow" disabled="true" onchange='<%="doChangeDetail("+idx.toString()+")"%>'   >
                                        <html:option value=" ">-----------------Please select-----------------</html:option>
                                        <html:option value="1">D</html:option>
                                        <html:option value="2">C</html:option>
                                        </html:select></td>
                                       
                                       <td ><html:text property="txtShiftCode" styleClass="deletedRow" readonly="true" name="EmpShiftRosterInfo" size="20" style="width:85%"  onchange='<%="doChangeDetail("+idx.toString()+")"%>' /><img src="../includes/images/lov.jpg" height="16" align="center" alt="<%=idx.toString()%>" property="buttxtAcctCode" onclick="ShowLovAcctCode(this.alt);"></td>  
                                      
                                       <html:hidden property="itemChecked" name="EmpShiftRosterInfo" />
                                       <html:hidden property="status" name="EmpShiftRosterInfo" />
                                       <html:hidden property="detailId" name="EmpShiftRosterInfo" />
                                       <html:hidden property="txtShiftCodeId" name="EmpShiftRosterInfo" />
                                       
                                    </tr>
                                  </logic:equal>                                    
                                                             
                           </logic:iterate>

                     
                     </TBODY>
                    </TABLE>
                  </DIV>
                </TD>
              </TR>                     
  
  <!-- Get details starts -->
                        <tr>
                          <td colspan=11>	
                              <jsp:include page="GenDetailMenu.jsp" />
                          </TD>
                      </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 colspan="5" 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 name="HrmAttEmpSRForm"  property="screenName" value="HrmAttEmpShiftRoster" />
<html:hidden name="HrmAttEmpSRForm"  property="forwardedPage" />
<html:hidden property="screenMode" name="HrmAttEmpSRForm" />
<html:hidden name="HrmAttEmpSRForm"  property="forwardedPage" />
<html:hidden property="txtIndex" name="HrmAttEmpSRForm" />
<html:hidden property="positionRequested" name="HrmAttEmpSRForm" />
<html:hidden property="userPositionRequested" name="HrmAttEmpSRForm" />
<html:hidden property="pageRequested" name="HrmAttEmpSRForm" />
<html:hidden property="userPageRequested" name="HrmAttEmpSRForm" />
<html:hidden property="lovKey" name="HrmAttEmpSRForm"  />
<html:hidden property="txtSearchFields" name="HrmAttEmpSRForm"  />
<html:hidden property="txtDisplayFields" name="HrmAttEmpSRForm"  />
<html:hidden property="headerDataChanged"  />
<html:hidden property="detailDataChanged" value="false" />
<html:hidden property="headerDataChanged" name="HrmAttEmpSRForm"  />
<html:hidden property="firstLoad" name="HrmAttEmpSRForm"  />
<html:hidden property="headerPrimaryKey" name="HrmAttEmpSRForm"  />

<html:hidden property="hdnEmpId" name="HrmAttEmpSRForm"  />
<html:hidden property="hdnSiteId" name="HrmAttEmpSRForm"  />
<html:hidden property="hdnWorkId" name="HrmAttEmpSRForm"  />
</html:form>
</body>
</html:html>

<script language="javascript">




function doRefresh()
{  
   return "EmpShiftRosterRefresh.do"
}



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

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

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

function doNextDetail()
{
  return "EmpShiftRosterNextDetailAction.do";
}
function doExit()
{
  return "EmpShiftRosterExitAction.do";
}

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

function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}
function ShowSiteCode()
{
  
   document.forms[0].lovKey.value = "HrmAttSiteCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
   document.forms[0].txtDisplayFields.value = "hdnSiteId,txtSiteId";
   document.forms[0].txtSearchFields.value = "hrm.HrmAttEmployeeShiftRoster.SiteId";
   document.forms[0].txtIndex.value ="";      
   showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />', 'HrmAttEmpSRForm');
   return true;
}
function ShowWorkCode()
{
  
   document.forms[0].lovKey.value = "HrmAttSftRoster" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
   document.forms[0].txtDisplayFields.value = "hdnWorkId,workGroupCode";
   document.forms[0].txtSearchFields.value = "hrm.HrmAttEmployeeShiftRoster.workGroupCode";
   document.forms[0].txtIndex.value ="";      
   showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />', 'HrmAttEmpSRForm');
   return true;
}
function ShowEmpNo()
{
  
   document.forms[0].lovKey.value = "HrmAttEmpSftRoster" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
   document.forms[0].txtDisplayFields.value = "hdnEmpId,employeeNo,employeeName";
   document.forms[0].txtSearchFields.value = "hrm.HrmAttEmployeeShiftRoster.empNo,hrm.HrmAttEmployeeShiftRoster.empName";
   document.forms[0].txtIndex.value ="";      
   showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />', 'HrmAttEmpSRForm');
   return true;
}

  

</script>