<%@ 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>
<html:form name="HrmTRCMstForm" action="HrmTRCMstBaseAction" type="wenrgise.hrms.webtier.form.HrmTrngCrsMstForm">
<bean:define id="ParentForm" name="HrmTRCMstForm" 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="hrmTCM.title" /></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 >
        <!--Inspection Header Starts -->
            <TR>
                  <TD class=subHeader colspan=6><bean:message  key="hrmTCMSubHeader.title" /></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.HrmTrainingCourseMst.trainingStream" /></td>
                                    <td colspan="5"><enrgise:text  property="trainingBranch" name="HrmTRCMstForm" titleKey="hrm.HrmTrainingCourseMst.trainingBranch" maxlength="20" size="23"  styleClass="required" disabledClass="required" onchange="doChangeHeader();" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" styleClass="icon"  property="butTrainingStreams" name="HrmTRCMstForm"  onclick="return ShowTrgMstCourseCode()" />
                                    <enrgise:text property="branchName" name="HrmTRCMstForm" altKey="hrm.HrmTrainingCourseMst.streamName" maxlength="40" size="70" styleClass="optional" disabledClass="locked" 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>
            <!-- Tab Table Starts -->
            <TABLE cellSpacing=0 cellPadding=0 >
           <!-- <tr>                                             
                          <td bgcolor="#4682B4"><img src="../includes/images/pixel.gif" width="10" height="1" border="0"></td>
                          <td bgcolor="#4682B4" nowrap class=actTabText ><bean:message  key="hrmTCMTabHeader.title" /><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>
                <td bgcolor="#4682B4" ></td>
                <enrgise:tab name="HrmTRCMstForm" property="butTrngMstTab" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_r.gif" ><bean:message key="hrmTCMTabHeader.title" /></enrgise:tab>
                <td width="82%"> </td>
            </tr>  
            
            
              <TR height=10>
              
            <!-- Detail table Container starts -->
              <TD colSpan=5>
              <TABLE cellSpacing=0 cellPadding=0 border=0>
                <TBODY>
                 <TR>
                  <TD >
                  <DIV id=divDtlTable style="height:250px">
                    <TABLE  border="0" cellSpacing=0 cellPadding=0>
                     <TBODY>
                          <tr>
                            <TD class=tableHeader width="1%"><input type=checkbox name="selectAll" onclick="toggleCheckBox('checked')"  /></TD>
                            <TD class=tableHeader><bean:message key="hrm.HrmTrainingCourseMst.courseCode" /></td>
                            <TD class=tableHeader><bean:message  key="hrm.HrmTrainingCourseMst.courseName" /></td>
                            <TD class=tableHeader><bean:message key="hrm.HrmTrainingCourseMst.maxAttend" /></td>
                            <TD class=tableHeader><bean:message  key="hrm.HrmTrainingCourseMst.minAttend" /></td>
                            
                         </tr>
                         <logic:notEmpty name="HrmTRCMstForm" property="arrHrmTrngCourse" >
                            
                            <logic:iterate id="HrmTrngCMst" name="HrmTRCMstForm" property="arrHrmTrngCourse" type="wenrgise.hrms.bean.HrmTrngCrsMstDtlBean" indexId="idx" >
                                         <logic:notEqual name="HrmTrngCMst" property="status" value="D" >
                                             <tr class='<bean:write name="HrmTRCMstForm" property="listRowClass"/>'  >
                                                <td><html:checkbox property="checked" value="check" name="HrmTRCMstForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />    
                                                <html:hidden property="itemChecked" name="HrmTrngCMst" /><html:hidden property="status" name="HrmTrngCMst" /><html:hidden property="detailId"  name="HrmTrngCMst" /></td>            
                                                          <logic:notEqual name="HrmTrngCMst" property="status" value="N" >
                                                          <TD class=tableText ><enrgise:text property="txtCourse" maxlength="20" size="15" titleKey="hrm.HrmTrainingCourseMst.courseCode"  name="HrmTrngCMst" formName="HrmTRCMstForm" style="width:100%" styleClass="required" disabledClass="required" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                                          </logic:notEqual>
                                                          <logic:equal name="HrmTrngCMst" property="status" value="N"  >
                                                            <TD class=tableText ><html:text property="txtCourse" maxlength="20" size="15" titleKey="hrm.HrmTrainingCourseMst.courseCode"  name="HrmTrngCMst"  style="width:100%" styleClass="required"  alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                                          </logic:equal>
                                                  <TD class=tableText ><enrgise:text property="txtName" maxlength="100" size="15" titleKey="hrm.HrmTrainingCourseMst.courseName" name="HrmTrngCMst" formName="HrmTRCMstForm" style="width:100%" styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                                  <TD class=tableText ><enrgise:text property="txtMaxAttend" maxlength="100" size="15" titleKey="hrm.HrmTrainingCourseMst.maxAttend" name="HrmTrngCMst" formName="HrmTRCMstForm" style="width:100%" styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                                  <TD class=tableText ><enrgise:text property="txtMinAttend" maxlength="100" size="15" titleKey="hrm.HrmTrainingCourseMst.minAttend" name="HrmTrngCMst" formName="HrmTRCMstForm" style="width:100%" styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' /></td>
                                             </tr>
                     
                                        </logic:notEqual>
                                        <logic:equal name="HrmTrngCMst" property="status" value="D"  >
                                              <tr class='<bean:write name="HrmTRCMstForm" property="listRowClass"/>'  >
                                                  <td><html:checkbox property="checked" value="check" disabled="true" name="HrmTRCMstForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" />    
                                                  <html:hidden property="itemChecked" name="HrmTrngCMst" /><html:hidden property="status" name="HrmTrngCMst" /><html:hidden property="detailId"  name="HrmTrngCMst" /></td>            
                                                   <TD class=tableText ><html:text property="txtCourse" size="15" titleKey="hrm.HrmTrainingCourseMst.courseCode" name="HrmTrngCMst" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                                   <TD class=tableText ><html:text property="txtName" size="15" titleKey="hrm.HrmTrainingCourseMst.courseName" name="HrmTrngCMst" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                                   <TD class=tableText ><html:text property="txtMaxAttend" size="15" titleKey="hrm.HrmTrainingCourseMst.maxAttend" name="HrmTrngCMst" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                                   <TD class=tableText ><html:text property="txtMinAttend" size="15" titleKey="hrm.HrmTrainingCourseMst.minAttend" name="HrmTrngCMst" style="width:100%" styleClass="deletedRow" alt="<%=idx.toString()%>" readonly="true" /></td>
                                              </tr>
                                        </logic:equal>
                          </logic:iterate>
                        </logic:notEmpty>
                      </TBODY>
                      </TABLE>
                      </DIV>
                      </TD>
                    </TR>
               <tr>
                <td>	
                <!--Buttons for Add Row and Save row-->
                  <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>
</div>
<!-- Container Table Ends -->
<html:hidden name="HrmTRCMstForm"  property="screenMode" />
<html:hidden name="HrmTRCMstForm"  property="screenName" value="HrmTrngCrsMst" />
<html:hidden name="HrmTRCMstForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmTRCMstForm" />

<html:hidden property="userPageRequested"  />
<html:hidden property="userPositionRequested" />
<html:hidden property="pageRequested" />

<html:hidden property="lovKey" name="HrmTRCMstForm"  />
<html:hidden property="txtSearchFields" name="HrmTRCMstForm"  />
<html:hidden property="txtDisplayFields" name="HrmTRCMstForm"  />
<html:hidden property="headerDataChanged" name="HrmTRCMstForm" />
<html:hidden property="detailDataChanged" name="HrmTRCMstForm" />

<html:hidden property="txtIndex" name="HrmTRCMstForm"  />
<html:hidden property="trgMstBranchId" name="HrmTRCMstForm" />

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

</html:form>
</body>
</html:html>
<SCRIPT>
function doChangeHeader()
{
 document.forms[0].headerDataChanged.value="true";
}
function doQueryMode()
{

  return "HrmTrngCrsMstQueryModeAction.do";
}


function doInsertMode()
{

  return "HrmTrngCrsMstNewModeAction.do";
}


function doExecute()
{

  return "HrmTrngCrsMstGetHeaderAction.do";
}

function doSave()
{

  return "HrmTrngCrsMstSaveAction.do";
  
}

function doDelete()
{

  return "HrmTrngCrsMstDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmTrngCrsMstRefreshAction.do";
  
}

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

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

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

function doGetDetail()
{

  return "HrmTrngCrsMstGetDetailAction.do";
}

function doAddRow()
{

  return "HrmTrngCrsMstAddRowAction.do"; 
}

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

function doGetDetailTableName()
{
  return "HrmTrngCMst";
}

function doPrevDetail()
{

  return "HrmTrngCrsMstGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmTrngCrsMstGetDetailPageAction.do";
}

function doJumpDetail()
{
  return  "HrmTrngCrsMstGetDetailPageAction.do"; 
}
function doExit()
{
  return  "HrmTrngCrsMstExitAction.do"; 
}


function ShowTrgMstCourseCode()
{
        document.forms[0].lovKey.value = "TrgMstBranchCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmTrainingCourseMst.trainingBranch,hrm.HrmTrainingCourseMst.branchName";
        document.forms[0].txtDisplayFields.value = "trgMstBranchId,trainingBranch,branchName";
        document.forms[0].multipleFlag.value="false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTRCMstForm');
        return true;
        
       
}
function doGetInsertData()
{}
function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}


</script>
              
 