<%--
MosP - Mind Open Source Project    http://www.mosp.jp/
Copyright (C) MIND Co., Ltd.       http://www.e-mind.co.jp/

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
--%>
<%@ page
language     = "java"
pageEncoding = "Windows-31J"
buffer       = "256kb"
autoFlush    = "false"
errorPage    = "/jsp/common/error.jsp"
%><%@ page
import = "jp.mosp.common.common.MospConst"
import = "jp.mosp.common.common.HtmlUtility"
import = "jp.mosp.common.CommonConst"
import = "jp.mosp.common.common.BaseVo"
import = "jp.mosp.kintai.kintai.vo.AttendanceListVo"
%><%
AttendanceListVo vo = (AttendanceListVo)request.getAttribute(MospConst.ATT_VO);
String[][] aryAttendance = vo.getAryAttendance();
String[] aryLabel = vo.getAryLabel();
%>
<%= HtmlUtility.getHeader(vo) %>
<%= HtmlUtility.getSubTitle(vo) %>
<div class="Body" id="attendanceList">
	<%=HtmlUtility.getMessages(vo)%>
	<div class="Select">
		<table>
			<tr>
				<td id="tdKCode">
					<%= CommonConst.NAM_K_CODE %><%= CommonConst.STR_TITLE_SEPARATOR %><%= vo.getEscLblKCode() %>
				</td>
				<td id="tdKName">
					<%= CommonConst.NAM_K_NAME %><%= CommonConst.STR_TITLE_SEPARATOR %><%= vo.getEscLblKName() %>
				</td>
				<td id="tdStation">
					<%= CommonConst.NAM_STATION %><%= CommonConst.STR_TITLE_SEPARATOR %><%= vo.getEscLblSectionName() %>
				</td>
				<td class="ButtonTd">
					<button type="button" onclick="doSubmit(document.form, '<%= vo.getCmdListButton() %>')"><%= vo.getNamListButton() %></button>
				</td>
			</tr>
		</table>
	</div>
	<div class="YearMonth">
		<table>
			<tr>
				<td class="ButtonTd">
					<button type="button" onclick="doSubmitFile(document.form, 'R1051')"><%= CommonConst.NAM_OUTPUT_ATTENDANCE_BOOK %></button>
					<input type="hidden" id="<%= AttendanceListVo.PRM_HID_KCODE %>" name="<%= AttendanceListVo.PRM_HID_KCODE %>" value="<%= BaseVo.escapeHTML(vo.getSelectKCode()) %>" />
				</td>				
				<td class="YearMonthTd">
					<button type="button" id="btnFormer" onclick="submitMonth(document.form, 'K1012', 'former')">
						<%= CommonConst.NAM_PREVIOUS_MONTH %>
					</button>
					<select id="<%= AttendanceListVo.PRM_PLT_YEAR %>" name="<%= AttendanceListVo.PRM_PLT_YEAR %>" onchange="submitMonth(document.form, 'K1012', '')">
						<%= HtmlUtility.getSelectOption(vo.aryPltYear, vo.getPltYear()) %>
					</select><%= CommonConst.NAM_YEAR %>
					<select id="<%= AttendanceListVo.PRM_PLT_MONTH %>" name="<%= AttendanceListVo.PRM_PLT_MONTH %>" onchange="submitMonth(document.form, 'K1012', '')">
						<%= HtmlUtility.getSelectOption(vo.aryPltMonth, vo.getPltMonth()) %>
					</select><%= CommonConst.NAM_MONTH %>
					<button type="button" id="btnNext" onclick="submitMonth(document.form, 'K1012', 'next')">
						<%= CommonConst.NAM_NEXT_MONTH %>
					</button>
				</td>
				<td class="ButtonTd">
					<button type="button" onclick="doSubmit(document.form, 'K1012')"><%= CommonConst.NAM_RE_SEARCH %></button>
				</td>
			</tr>
		</table>
	</div>
	<div class="List">
		<table id="list">
			<thead>
				<tr>
					<th id="thButton"			>									</th>
					<th id="thDay"				><%= CommonConst.NAM_DAY %>			</th>
					<th id="thDayOfWeek"		><%= CommonConst.NAM_DAY_OF_WEEK %>	</th>
					<th id="thAttendanceType"	><%= CommonConst.NAM_WORKING_TYPE %></th>
					
					<th class="TimeTh" ><%= CommonConst.NAM_START_TIME %>		</th>
					<th class="TimeTh" ><%= CommonConst.NAM_QUIT_TIME %>		</th>
					<th class="TimeTh" ><%= CommonConst.NAM_PAYMENT_HOURS_ABB %></th>
					<th class="TimeTh" ><%= CommonConst.NAM_INTERVAL_TIME %>	</th>
					<th class="TimeTh" ><%= CommonConst.NAM_ARRIVE_LATE %>		</th>
					<th class="TimeTh" ><%= CommonConst.NAM_LEAVE_EARLY %>		</th>
					<th class="TimeTh" ><%= CommonConst.NAM_OVERTIME %>			</th>
					<th class="TimeTh" ><%= CommonConst.NAM_WORK_ON_HOLIDAY %>	</th>
					<th class="TimeTh" ><%= CommonConst.NAM_LATE_NIGHT %>		</th>
					
					<th class="AppTh" ><%= CommonConst.NAM_1ST_APPROVED %>		</th>
					<th class="AppTh" ><%= CommonConst.NAM_2ND_APPROVED %>		</th>
					<th class="AllTh" ><%= CommonConst.NAM_ALLOWANCE %>			</th>
					
					<th class="RemarksTh" ><%= CommonConst.NAM_REMARKS %></th>
				</tr>
			</thead>
			<tbody>
<%
for (int i = 0; i < aryAttendance.length; i++) {
%>
				<tr>
					<td class="ButtonTd">
						<button type="button" onclick="doSubmitKey(document.form, 'K1014', '<%= vo.getSelectKCode() %>', '<%= aryAttendance[i][0] %>')"><%= CommonConst.NAM_SELECT %></button>
					</td>
					<td id="tdDay"				><%= BaseVo.escapeHTML(aryAttendance[i][1 ]) %></td>
					<td id="tdDayOfWeek"		><span class="<%= aryAttendance[i][17] %>"><%= BaseVo.escapeHTML(aryAttendance[i][2 ]) %></span></td>
					<td id="tdAttendanceType"	><%= BaseVo.escapeHTML(aryAttendance[i][3 ]) %></td>
					
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][4 ]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][5 ]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][6 ]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][7 ]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][8 ]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][9 ]) %></td>
					<td class="<%= BaseVo.escapeHTML(aryAttendance[i][18]) %>"  ><%= BaseVo.escapeHTML(aryAttendance[i][10]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][11]) %></td>
					<td class="TimeTd"  ><%= BaseVo.escapeHTML(aryAttendance[i][12]) %></td>
					
					<td class="AppTd"	><%= BaseVo.escapeHTML(aryAttendance[i][13]) %></td>
					<td class="AppTd"   ><%= BaseVo.escapeHTML(aryAttendance[i][14]) %></td>
					<td class="AllTd"	><%= BaseVo.escapeHTML(aryAttendance[i][15]) %></td>
					
					<td class="RemarksTd"><%= BaseVo.escapeHTML(aryAttendance[i][16]) %></td>
				</tr>
<%
}
%>
			</tbody>
		</table>
		<table id="sum">
			<tr>
				<td class="sumLbl">
					<%= aryLabel[0] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[1] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[2] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[3] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[4] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[5] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[6] %>
				</td>
				<td  class="sumLbl">&nbsp;</td>				
				<td  class="sumLbl">&nbsp;</td>
				<td  class="sumLbl">
					<%= aryLabel[16] %>			
				</td>
				<td  class="sumLbl">&nbsp;</td>				
			</tr>
			<tr>
				<td>
					<%= BaseVo.escapeHTML(vo.getWorkTimes()) %>
				</td>
				<td>
					<%= BaseVo.escapeHTML(vo.getBreakTimes()) %>
				</td>
				<td>
					<%= BaseVo.escapeHTML(vo.getLateTimes()) %>
				</td>
				<td>
					<%= BaseVo.escapeHTML(vo.getLeaveEarlyTimes()) %>
				</td>
				<td class="<%= BaseVo.escapeHTML(vo.getOverTimeCssClass()) %>">
					<%= BaseVo.escapeHTML(vo.getOverTimes()) %>
				</td>
				<td>
					<%= BaseVo.escapeHTML(vo.getWorkOnHoliday()) %>
				</td>
				<td>
					<%= BaseVo.escapeHTML(vo.getLateNightTimes()) %>
				</td>
				<td >&nbsp;</td>				
				<td >&nbsp;</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getAllowance()) %>				
				</td>
				<td >&nbsp;</td>				
			</tr>
			<tr>	
				<td class="sumLbl">
					<%= aryLabel[7] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[8] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[9] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[10] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[11] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[12] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[13] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[14] %>
				</td>
				<td class="sumLbl">
					<%= aryLabel[15] %>
				</td>
				<td class="sumLbl">&nbsp;</td>
				<td class="sumLbl">
					<%= aryLabel[17] %>
				</td>
			</tr>
			<tr>	
				<td>
					<%= BaseVo.escapeHTML(vo.getPresence()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getPaidHoliday()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getParticularHoliday()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getAbsence()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getSick()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getCompensationLeave()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getTransfer()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getOther()) %>
				</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getLeaveAndLate()) %>
				</td>
				<td >&nbsp;</td>
				<td >
					<%= BaseVo.escapeHTML(vo.getPerfectAttendance()) %>
				</td>
			</tr>
		</table>
	</div>
</div>
<%= HtmlUtility.getFooter(vo) %>
