<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="jp.co.argo21.nautica.workflow.sample.model.OvertimeApp"%>
<%@ page
	import="jp.co.argo21.nautica.workflow.sample.model.AppTransaction"%>
<%@ page
	import="jp.co.argo21.nautica.workflow.soap.message.Organization"%>
<%@ page import="jp.co.argo21.nautica.workflow.sample.util.StringUtil"%>
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.util.Formatter"%>
<%
OvertimeApp overtime = (OvertimeApp)request.getAttribute("overtime");
Organization org = (Organization)request.getAttribute("org");
AppTransaction[] appTransArray = (AppTransaction[])request.getAttribute("appTran");
String name = StringUtil.toFullName(overtime.getUser());
DateFormat df = DateFormat.getDateInstance(DateFormat.FULL);
Formatter formatter = new Formatter();
String workTime = formatter.format("%02d : %02d 〜 %02d : %02d", overtime.getStartHour(), overtime.getStartMin(), overtime.getEndHour(), overtime.getEndMin()).toString();
String compdayPlan = null;
if(overtime.isComp()){
	compdayPlan = "代休取得予定あり";
} else {
	compdayPlan = "代休取得取得予定なし";
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/base.css" type="text/css">
<title>承認状況</title>
</head>
<body>
<%@ include file="include/header.jsp"%>
<div align="center">
<table width="819" border="0">
	<tr>
		<td width="200" height="17"><img src="left-bar.jpg" width="200"
			height="20"></td>
		<td width="405">
		<div align="center"><span class="style5">承認状況</span></div>
		</td>
		<td width="200"><img src="right-bar.jpg" width="200" height="20"></td>
	</tr>
</table>
</div>
<div align="center">
<p><span class="style28"><%= overtime.getKind().getAppkindName()%></span></p>
<table width="800" border="1" cellpadding="5" bordercolor="#00CC33">
	<tr class="style24">
		<th height="20" colspan="2" bgcolor="#00FFCC" class="style24"
			scope="row">申請書番号</th>
		<td width="574" height="20" bgcolor="#EEFFEE">
		<div align="left"><%= overtime.getId()%></div>
		</td>
	</tr>
	<tr class="style24">
		<th height="20" colspan="2" bgcolor="#00FFCC" scope="row">申請日付</th>
		<td height="20" bgcolor="#EEFFEE">
		<div align="left"><span class="style24"><%= df.format(overtime.getDate())%></span></div>
		</td>
	</tr>
	<tr class="style24">
		<th height="20" colspan="2" bgcolor="#00FFCC" scope="row">
		<div align="center" class="style24">申請者</div>
		</th>
		<td height="20" align="left" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style38">
		<table width="417" border="0">
			<tr>
				<td width="150" class="style24"><%= org.getName()%></td>
				<td width="153" class="style24"><%= name%></td>
				<td width="100" class="style24"><%= overtime.getUser().getId()%></td>
			</tr>
		</table>
		</div>
		</td>
	</tr>
	<tr class="style24">
		<th width="60" height="25" rowspan="3" bgcolor="#00FFCC" scope="row">
		<div align="center">対象日</div>
		</th>
		<th width="120" height="20" align="center" bgcolor="#00FFCC"
			scope="row">
		<div align="center" class="style24">勤務日</div>
		</th>
		<td height="20" bgcolor="#EEFFEE">
		<div align="left" class="style24"><span class="style39">
		<%= df.format(overtime.getWorkday())%></span></div>
		</td>
	</tr>
	<tr>
		<th height="20" align="center" bgcolor="#00FFCC" scope="row"><span
			class="style24">予定時刻</span></th>
		<td height="20" bgcolor="#EEFFEE">
		<div align="left" class="style24"><span class="style39">
		<%= workTime %>
		</span></div>
		</td>
	</tr>
	<tr>
		<th height="20" align="center" bgcolor="#00FFCC" scope="row"><span
			class="style24">予定時間</span></th>
		<td height="20" bgcolor="#EEFFEE">
		<div align="left" class="style24"><span class="style39">
		<%= overtime.getOvertimeHours()%> 時間</span></div>
		</td>
	</tr>
	<tr class="style24">
		<th height="40" colspan="2" bgcolor="#00FFCC" class="style24"
			scope="row">事由</th>
		<td height="40" align="left" valign="top" bgcolor="#EEFFEE"><%= overtime.getReason()%>
		</td>
	</tr>
	<tr class="style24">
		<th height="20" colspan="2" bgcolor="#00FFCC" scope="row">代休取得予定</th>
		<td height="20" align="left" bgcolor="#EEFFEE">
		<div align="left" class="style38">
		<table width="495" border="0" cellpadding="2">
			<tr>
				<td width="150" height="18" class="style24"><%= compdayPlan%></td>
<%
				if(overtime.isComp()){ 
%>
				<td width="331" height="18">
				<div align="left" class="style24"><%= df.format(overtime.getCompDay())%></div>
				</td>
<%
				}
%>
			</tr>
		</table>
		</div>
		</td>
	</tr>
	<tr class="style24">
		<th height="40" colspan="2" bgcolor="#00FFCC" scope="row">備考</th>
		<td height="40" align="left" valign="top" bgcolor="#EEFFEE"
			class="style24"><%= overtime.getRemark()%></td>
	</tr>
</table>
<br>
<table width="400" border="１" bordercolor="#FFCCCC" bgcolor="#FFCC99">
	<tr bgcolor="#FF9999" class="style24">
		<th width="70" height="20" scope="col">
		<div align="center" class="style40">No</div>
		</th>
		<th width="225" height="20" scope="col"><span class="style40">申請者・承認者</span></th>
		<th width="83" height="20" scope="col"><span class="style40">状況</span></th>
	</tr>
<% 
    int count = 1;
    for (AppTransaction appTran : appTransArray){ %>
	<tr bgcolor="#EEFFEE" class="style24">
		<td height="20">
		<div align="center"><span class="style24"><%= count%></span></div>
		</td>
		<td height="20" align="left"><%= appTran.getAppUserID()%></td>
		<td height="20"><%= appTran.getAppStatus() %></td>
	</tr>
<%
		count++;
    }
%>
</table>
<br>
<table width="400" border="0">
	<tr>
		<td width="153">
		<div align="center"><a
			href="ShowApplication?screen=AppState&aim=WAIT"
			class="style24">承認状況一覧に戻る</a></div>
		</td>
	</tr>
</table>
<br>
</div>
<%@ include file="include/footer.jsp"%>
</body>
</html>