<%@ 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="HrmTBForm" action="HrmTBBaseAction" type="wenrgise.hrms.webtier.form.HrmTrngBudgetForm">
<bean:define id="ParentForm" name="HrmTBForm" 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="hrmTBMainHeader.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 >
        <!-- Header Starts -->
            <TR>
                  <TD class=subHeader colspan=6><bean:message key="hrmTBSubHeader.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.HrmTrainingBudget.calendarName" /></td>
                <td colspan="5"><html:text property="calendarName" name="HrmTBForm" titleKey="hrm.HrmTrainingBudget.course" size="23" styleClass="required" onchange="doChangeHeader();" readonly="true" /><enrgise:img height="16" align="center" styleClass="icon" src="../includes/images/lov.jpg" property="butCalendar" name="HrmTBForm" onclick="return ShowTrngCalendarCode();" /></td>
                <!--<html:text property="description" titleKey="hrm.HrmTrainingBudget.description" name="HrmTBForm" maxlength="255" size="59" styleClass="locked" readonly="true" /></td>-->
            </tr>
            <tr>
                <td class="labelText"><bean:message key="hrm.HrmTrainingBudget.approvedBudget" /></td>
                <td><enrgise:text property="approvedBudget" name="HrmTBForm" titleKey="hrm.HrmTrainingBudget.approvedBudget" size="26" maxlength="10" styleClass="required" disabledClass="locked" onchange="doChangeHeader();" onkeypress="isInteger(event)" style="text-align:right" /></td>
                <td class="labelText"><bean:message key="hrm.HrmTrainingBudget.spentTillDate" /></td>
                <td><html:text property="spentTillDate" name="HrmTBForm" titleKey="hrm.HrmTrainingBudget.spentTillDate" size="26" styleClass="locked" onchange="doChangeHeader();" readonly="true" style="text-align:right" /></td>
                <td class="labelText"><bean:message key="hrm.HrmTrainingBudget.availableBudget" /></td>
                <td><html:text property="availableBudget" name="HrmTBForm" titleKey="hrm.HrmTrainingBudget.availableBudget" size="26" styleClass="locked" onchange="doChangeHeader();" readonly="true" style="text-align:right" /></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>
        <!-- Detail Table Starts -->
         <TABLE cellSpacing=0 cellPadding=0 >
           <tr>
                <td bgcolor="#4682B4" ></td>
                <enrgise:tab name="HrmTBForm" property="butTrngBdgTab" styleClass="actTabText" disabledClass="lockedTab" src="../includes/images/formtab_r.gif" ><bean:message key="hrmTBTabHeader.title" /></enrgise:tab>
                <td width="82%"> </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:250px;width:1010px" >
  		                	<!-- Detail table starts -->
                        <TABLE cellSpacing=0 cellPadding=0>
                         <TBODY>
                          <tr>
                              <TD class=tableHeader width="1%"><input type="checkbox" name="selectAll"  onclick="toggleCheckBox('checked')" disabled="true"  /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.courseName" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.fromDate" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.toDate" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.travel" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.accomodation" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.dailyAllowances" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.food" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.fees" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.misc" /></td>
                              <TD class=tableHeader><bean:message key="hrm.HrmTrainingBudget.total" /></td>
                         </tr>
                          
                    
                            <logic:iterate id="HrmTrngBud" name="HrmTBForm" property="arrHrmTrngBud" type="wenrgise.hrms.bean.HrmTrngCrsBudDtlBean" indexId="idx" >
                                         <logic:notEqual name="HrmTrngBud" property="status" value="D" >
                                             <tr class='<bean:write name="HrmTBForm" property="listRowClass"/>'  >
                                                <td><html:checkbox property="checked" name="HrmTBForm" alt="<%=idx.toString()%>" onclick="boxClicked(this.alt);" disabled="true" />    
                                                <html:hidden property="itemChecked" name="HrmTrngBud" /><html:hidden property="status" name="HrmTrngBud" /><html:hidden property="detailId"  name="HrmTrngBud" /><html:hidden property="txtCourseId"  name="HrmTrngBud" /></td>            
                                                <TD class=tableText ><html:text property="txtCourseName" name="HrmTrngBud" styleClass="required" titleKey="hrm.HrmTrainingBudget.courseName" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" property="butTxtCourseName" styleClass="icon" name="HrmTBForm" alt="<%=idx.toString()%>" onclick="ShowCourseName(this.alt);" />
                                                <TD class=tableText ><html:text property="txtFromDate" name="HrmTrngBud" styleClass="required" titleKey="hrm.HrmTrainingBudget.fromDate" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><enrgise:img width="16" height="19" align="top" styleClass="icon" src="../includes/images/cal.gif" property="butTxtStartDate" name="HrmTBForm" alt="<%=idx.toString()%>"  onclick="showCalendar('txtFromDate',this)" /></td>        
                                                <TD class=tableText ><html:text property="txtToDate" name="HrmTrngBud" styleClass="locked" titleKey="hrm.HrmTrainingBudget.toDate" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><enrgise:img width="16" height="19" align="top" styleClass="icon" src="../includes/images/cal.gif" property="butTxtEndDate" name="HrmTBForm" alt="<%=idx.toString()%>"  onclick="showCalendar('txtToDate',this)" /></td>   
                                                <TD class=tableText ><enrgise:text property="txtTravel" maxlength="10" titleKey="hrm.HrmTrainingBudget.travel" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><enrgise:text property="txtAccomodation" maxlength="10" titleKey="hrm.HrmTrainingBudget.accomodation" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><enrgise:text property="txtDailyAllowances" maxlength="10" titleKey="hrm.HrmTrainingBudget.dailyAllowances" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><enrgise:text property="txtFood" maxlength="10" titleKey="hrm.HrmTrainingBudget.food" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><enrgise:text property="txtFees" maxlength="10" titleKey="hrm.HrmTrainingBudget.fees" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><enrgise:text property="txtMisc" maxlength="10" titleKey="hrm.HrmTrainingBudget.misc" name="HrmTrngBud" formName="HrmTBForm" onkeypress="isInteger(event)"  styleClass="optional" disabledClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" /></td>
                                                <TD class=tableText ><html:text property="txtTotal" maxlength="15" titleKey="hrm.HrmTrainingBudget.total" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="locked" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" style="text-align:right" /></td>
                                             </tr>
                     
                                        </logic:notEqual>
                                        <logic:equal name="HrmTrngBud" property="status" value="D"  >
                                              <tr class='<bean:write name="HrmTBForm" property="listRowClass"/>'  >
                                                  <td><html:checkbox property="checked" name="HrmTBForm" alt="<%=idx.toString()%>" disabled="true" /><html:hidden property="checked" name="HrmTBForm" />   
                                                  <html:hidden property="itemChecked" name="HrmTrngBud" /><html:hidden property="status" name="HrmTrngBud" /><html:hidden property="detailId"  name="HrmTrngBud" /><html:hidden property="txtCourseId"  name="HrmTrngBud" /></td>            
                                                  <TD class=tableText ><html:text property="txtCourseName" titleKey="hrm.HrmTrainingBudget.courseName" name="HrmTrngBud" onkeypress="isInteger(event)" styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><img name="HrmTBForm" height="16" align="center" disabled="true" src="../includes/images/lov_dis.jpg" property="butTxtCourseName" alt="<%=idx.toString()%>" /></td>                                
                                                  <TD class=tableText ><html:text property="txtFromDate" titleKey="hrm.HrmTrainingBudget.fromDate" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><img width="16" height="19" align="top" class="icon" src="../includes/images/cal_dis.gif" property="butTxtStartDate" name="HrmTBForm" alt="<%=idx.toString()%>" /></td>        
                                                  <TD class=tableText ><html:text property="txtToDate" titleKey="hrm.HrmTrainingBudget.toDate" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' readonly="true" /><img width="16" height="19" align="top" class="icon" src="../includes/images/cal_dis.gif" property="butTxtEndDate" name="HrmTBForm" alt="<%=idx.toString()%>" /></td>        
                                                  <TD class=tableText ><html:text property="txtTravel" titleKey="hrm.HrmTrainingBudget.travel" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtAccomodation" titleKey="hrm.HrmTrainingBudget.accomodation" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtDailyAllowances" titleKey="hrm.HrmTrainingBudget.dailyAllowances" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right"  readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtFood" titleKey="hrm.HrmTrainingBudget.food" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtFees" titleKey="hrm.HrmTrainingBudget.fees" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtMisc" titleKey="hrm.HrmTrainingBudget.misc" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                                  <TD class=tableText ><html:text property="txtTotal" titleKey="hrm.HrmTrainingBudget.total" name="HrmTrngBud" onkeypress="isInteger(event)"  styleClass="deletedRow" alt="P" onchange='<%="doChangeDetail("+idx.toString()+")"%>' style="text-align:right" readonly="true" /></td>
                                              </tr>
                                        </logic:equal>
                          </logic:iterate>
                       </TBODY>
                    </TABLE>
                  </TD>
               </TR>                     
  
                <!-- Get details starts -->
                        <tr>
                          <td colspan=11>	
                              
                              <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> <enrgise:button altKey="wenrgise.common.addRow" name="ParentForm"  onclick="doBaseAddRow()" property="butAddRow"  styleClass="bottomBarText">&nbsp;&nbsp;Add&nbsp;<u>R</u>ow&nbsp;&nbsp;</enrgise:button>
                                  <button altKey="wenrgise.common.delRow" name="ParentForm" property="butDelRow" styleClass="bottomBarText" disabled="true" ><u>D</u>elete&nbsp;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  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" alt="N" titleKey="wenrgise.common.jumpDetail" /></td>
                                  <td ><enrgise:img name="ParentForm" property="butJumpDetail" altKey="wenrgise.common.go" src="../includes/images/go_dtl.jpg" onmouseover='this.src="../includes/images/go_act.jpg"' onmouseout='this.src="../includes/images/go.jpg"' onclick="doBaseJumpDetail()" /></td>		     
                                </TR>
                              
                                </tbody>
                              </TABLE>
                              
                              

                          </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 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>
                </div>
            </td>
          </tr>
 
<!-- Container Table Ending Columns Starts-->
  </TD>
    
</TR>
</TBODY>
</TABLE>

<!-- Container Table Ends -->


<html:hidden name="HrmTBForm"  property="screenMode" />
<html:hidden name="HrmTBForm"  property="screenName" value="HrmTrngBudget" />
<html:hidden property="forwardedPage" name="HrmTBForm"  />
<html:hidden  property="positionRequested" name="HrmTBForm"  />
<html:hidden property="pageRequested" name="HrmTBForm" />
<html:hidden property="userPageRequested" name="HrmTBForm" />
<html:hidden property="userPositionRequested" name="HrmTBForm" />

<html:hidden property="headerPrimaryKey" name="HrmTBForm" />
<html:hidden property="headerDataChanged" name="HrmTBForm" />
<html:hidden property="detailDataChanged" name="HrmTBForm" />
<html:hidden property="txtIndex" name="HrmTBForm"  />

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

<html:hidden property="calendarId" name="HrmTBForm" />

<html:hidden property="firstLoad" name="HrmTBForm"  />

<html:hidden property="lovKey" name="HrmTBForm"  />
<html:hidden property="txtSearchFields" name="HrmTBForm"  />
<html:hidden property="txtDisplayFields" name="HrmTBForm"  />


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



function doOnLoad()
{  
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmTrngBudgetOnLoadAction.do"; 
  }
}
function doQueryMode()
{
  return "HrmTrngBudgetQueryModeAction.do";
}
function doInsertMode()
{
  return "HrmTrngBudgetNewModeAction.do";
}

function doExecute()
{
  return "HrmTrngBudgetGetHeaderAction.do";
}
function doDelete()
{
  return "HrmTrngBudgetDeleteAction.do";
}
function doRefresh()
{
  return "HrmTrngBudgetRefreshAction.do";
}
function doSave()
{
  return "HrmTrngBudgetSaveAction.do";
}
function doPrevHeader()
{
  return "HrmTrngBudgetGetNextHeaderAction.do"; 
}

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

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

function doGetDetail()
{
  return "HrmTrngBudgetGetDetailAction.do";
}
function doAddRow()
{
  return "HrmTrngBudgetAddRowAction.do"; 
}
function doDelRow()
{
  return "HrmTrngBudgetDeleteRowAction.do";  
}
function doGetDetailTableName()
{
  return "HrmTrngBud";
}
function doPrevDetail()
{
  return "HrmTrngBudgetGetDetailPageAction.do";  
}
function doNextDetail()
{
  return "HrmTrngBudgetGetDetailPageAction.do";
}
function doJumpDetail()
{
  return  "HrmTrngBudgetGetDetailPageAction.do"; 
}
function doExit()
{

  return "HrmTrngBudgetExitAction.do"; 
}

function boxClicked(val)
{    
    if(document.getElementsByName("checked")[val].checked)
    {      
      document.getElementsByName("itemChecked")[val].value = "Y";      
    }
    else
    {     
      document.getElementsByName("itemChecked")[val].value = "N";     
    }      
}


function doGetInsertData()
{
}

function ShowTrngCalendarCode()
{
    document.forms[0].lovKey.value = "TrngBudgetCalCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
    document.forms[0].txtSearchFields.value = "hrm.HrmTrainingBudget.calendarName";
    document.forms[0].txtDisplayFields.value = "calendarId,calendarName";
    document.forms[0].multipleFlag.value="false";
    showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTBForm');
    return true;
}
function ShowCourseName(i)
{ 
    document.forms[0].lovKey.value = "TrngBudgetCourseCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
    document.forms[0].txtSearchFields.value = "hrm.HrmTrainingBudget.courseName";
    document.forms[0].txtIndex.value = i;
    document.forms[0].txtDisplayFields.value = "txtCourseId,txtCourseName";
    document.forms[0].multipleFlag.value="false";
    document.forms[0].queryParam.value="calendarId="+document.forms[0].calendarId.value;
    showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmTBForm');
    return true;
}

</script>