<%@ 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.Application"%>
<%@ page import="jp.co.argo21.nautica.workflow.soap.message.User"%>
<%@ page import="java.util.List"%>
<%@ page import="java.text.DateFormat"%>
<%
	String aim = (String) session.getAttribute("aim");

	String title = null;
	if (aim == null) {
		title = "";
	} else if (aim.equals("APPROVE")) {
		title = "承認待ち申請一覧";
	} else if (aim.equals("CONFIRM")) {
		title = "同報申請一覧";
	} else if (aim.equals("WAIT")) {
		title = "承認状況一覧";
	}
	String errMsg = (String) request.getAttribute("errMsg");
	List<Application> apps = (List<Application>) request.getAttribute("app");
	DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
%>
<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%></title>
</head>
<body>
<%@ include file="include/header.jsp"%>
<div align="center">
<table width="923" border="0">
	<tr>
		<td width="200" height="17"><img src="left-bar.jpg" width="200"
			height="20"></td>
		<td width="509">
		<div align="center"><span class="style5"><%=title%></span></div>
		</td>
		<td width="200"><img src="right-bar.jpg" width="200" height="20"></td>
	</tr>
</table>
</div>
<p align="center">&nbsp;</p>
<%
	if (errMsg != null) {
%>
<p align="center"><%=errMsg%></p>
<%
	} else {
%>
<table width="913" border="1" align="center" bordercolor="#00CC33">
	<tr bgcolor="#00FFCC">
		<td width="75">
		<div align="center" class="style32">No</div>
		</td>
		<td width="175">
		<div align="center" class="style32">
		<div align="center">申請書番号</div>
		</div>
		</td>
		<td width="200">
		<div align="center" class="style32">申請者氏名</div>
		</td>
		<td width="300">
		<div align="center" class="style32">申請種別</div>
		</td>
		<td width="129" height="25">
		<div align="center" class="style32">
		<div align="center">申請日</div>
		</div>
		</td>
	</tr>
<%
		int count = 1;
		for (Application app : apps) {
%>
	<tr bgcolor="#EEFFEE">
		<td>
		<div align="right" class="style30"><%=count%></div>
		</td>
		<td>
		<div align="center" class="style30"><a
			href="ShowApplication?appID=<%= app.getId()%>&screen=AppList"> <%=app.getId()%></a></div>
		</td>
		<td><a
			href="ShowApplication?appID=<%= app.getId()%>&screen=AppList"
			class="style30"> <%= StringUtil.toFullName(app.getUser()) %></a></td>
		<td><a
			href="ShowApplication?appID=<%= app.getId()%>&screen=AppList"
			class="style30"><%=app.getKind().getAppkindName()%></a></td>
		<td height="25">
		<div align="center" class="style30">
<%
			if (app.getDate() != null) {
						out.println(df.format(app.getDate()));
			}
%>
		</div>
		</td>
	</tr>
<%			count++;
		}
	}
%>
</table>
<%@ include file="include/footer.jsp"%>
</body>
</html>