<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="jp.co.argo21.nautica.workflow.sample.model.OvertimeApp"%>
<%@ page import="jp.co.argo21.nautica.workflow.soap.message.User"%>
<%@ page
	import="jp.co.argo21.nautica.workflow.soap.message.Organization"%>
<%@ page import="jp.co.argo21.nautica.workflow.sample.util.StringUtil"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
	List<String> errMsg = (List<String>) request.getAttribute("errMsg");
	User user = (User) session.getAttribute("user");
	Organization org = (Organization) session.getAttribute("org");
	OvertimeApp overtimeApp = (OvertimeApp) request.getAttribute("overtimeApp");
	String appID = overtimeApp.getId();
	String name = StringUtil.toFullName(user);
	Date date = new Date();
	SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy/MM/dd");
	int now = Calendar.getInstance().get(Calendar.YEAR);
	int[] years = new int[10];
	for (int i = 0; i < years.length; i++) {
		years[i] = now + i;
	}
%>
<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>
<%
	if (errMsg != null) {
		out.print("<p>");
		for (String err : errMsg) {
%>
<span class="style11">　　　　　　 ・<%=err%></span><br>
<%
	}
		out.print("</p>");
	}
%>
<form method="post"
	action="Apply?screen=ApplyInput">
<input type="hidden" name="appID" value="<%=appID %>" /> 
<input type="hidden" name="appKindID"
	value="<%= overtimeApp.getKind().getAppkindID()%>" />
<div align="center">
<p><span class="style28"><%=overtimeApp.getKind().getAppkindName()%></span>
</p>
<table width="800" border="0">
	<tr>
		<td>
		<div align="right"><span class="style33"> <%=dateFormatter.format(date)%>
		</span></div>
		</td>
	</tr>
</table>
<table width="800" border="1" cellpadding="5" bordercolor="#00CC33">
	<tr>
		<th height="25" colspan="2" bgcolor="#00FFCC" scope="row">
		<div align="center" class="style38"><span class="style24">申請者</span></div>
		</th>
		<td width="584" height="25" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45"><span class="style39"><span
			class="style25"><%=org.getName()%></span> <%= name%>
		（<%=user.getId()%>）</span></div>
		</td>
	</tr>
	<tr>
		<th width="60" height="25" rowspan="3" align="center"
			bgcolor="#00FFCC" class="style24" scope="row">対象日</th>
		<th width="110" height="25" bgcolor="#00FFCC" scope="row">
		<div align="center" class="style24">勤務日</div>
		</th>
		<td height="25" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45"><span class="style39">
		<select name="workdayYear">
			<option selected><%=years[0]%></option>
			<%
				for (int i = 1; i < years.length; i++) {
			%>
			<option><%=years[i]%></option>
			<%
				}
			%>
		</select> 年 <select name="workdayMonth">
			<option selected>1</option>
			<option>2</option>
			<option>3</option>
			<option>4</option>
			<option>5</option>
			<option>6</option>
			<option>7</option>
			<option>8</option>
			<option>9</option>
			<option>10</option>
			<option>11</option>
			<option>12</option>
		</select> 月 <select name="workdayDay">
			<option selected>1</option>
			<option>2</option>
			<option>3</option>
			<option>4</option>
			<option>5</option>
			<option>6</option>
			<option>7</option>
			<option>8</option>
			<option>9</option>
			<option>10</option>
			<option>11</option>
			<option>12</option>
			<option>13</option>
			<option>14</option>
			<option>15</option>
			<option>16</option>
			<option>17</option>
			<option>18</option>
			<option>19</option>
			<option>20</option>
			<option>21</option>
			<option>22</option>
			<option>23</option>
			<option>24</option>
			<option>25</option>
			<option>26</option>
			<option>27</option>
			<option>28</option>
			<option>29</option>
			<option>30</option>
			<option>31</option>
		</select> 日</span></div>
		</td>
	</tr>
	<tr>
		<th height="25" bgcolor="#00FFCC" scope="row"><span
			class="style24">予定時刻</span></th>
		<td height="25" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45"><span class="style39">
		<select name="startHour">
			<option>00</option>
			<option>01</option>
			<option>02</option>
			<option>03</option>
			<option>04</option>
			<option>05</option>
			<option>06</option>
			<option>07</option>
			<option>08</option>
			<option>09</option>
			<option>10</option>
			<option>11</option>
			<option>12</option>
			<option>13</option>
			<option>14</option>
			<option>15</option>
			<option>16</option>
			<option>17</option>
			<option>18</option>
			<option>19</option>
			<option>20</option>
			<option>21</option>
			<option>22</option>
			<option>23</option>
			<option>24</option>
		</select> ： <select name="startMin">
			<option>00</option>
			<option>15</option>
			<option>30</option>
			<option>45</option>
		</select> 〜 <select name="endHour">
			<option>00</option>
			<option>01</option>
			<option>02</option>
			<option>03</option>
			<option>04</option>
			<option>05</option>
			<option>06</option>
			<option>07</option>
			<option>08</option>
			<option>09</option>
			<option>10</option>
			<option>11</option>
			<option>12</option>
			<option>13</option>
			<option>14</option>
			<option>15</option>
			<option>16</option>
			<option>17</option>
			<option>18</option>
			<option>19</option>
			<option>20</option>
			<option>21</option>
			<option>22</option>
			<option>23</option>
			<option>24</option>
		</select> ： <select name="endMin">
			<option>00</option>
			<option>15</option>
			<option>30</option>
			<option>45</option>
		</select> </span></div>
		</td>
	</tr>
	<tr>
		<th height="25" bgcolor="#00FFCC" scope="row"><span
			class="style24">予定時間</span></th>
		<td height="25" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45"><span class="style39">
		<select name="overtimeHours">
			<option>0.5</option>
			<option>1.0</option>
			<option>1.5</option>
			<option>2.0</option>
			<option>2.5</option>
			<option>3.0</option>
			<option>3.5</option>
			<option>4.0</option>
			<option>4.5</option>
			<option>5.0</option>
			<option>5.5</option>
			<option>6.0</option>
			<option>6.5</option>
			<option>7.0</option>
			<option>7.5</option>
			<option>8.0</option>
			<option>8.5</option>
			<option>9.0</option>
			<option>9.5</option>
			<option>10.0</option>
			<option>10.5</option>
			<option>11.0</option>
			<option>11.5</option>
			<option>12.0</option>
		</select> 時間 </span><span class="style46">（予定時間には休憩時間をひいた時間外労働時間を入力してください）</span></div>
		</td>
	</tr>
	<tr>
		<th height="50" colspan="2" bgcolor="#00FFCC" class="style24"
			scope="row">事由</th>
		<td height="50" bgcolor="#EEFFEE" class="style24"><span
			class="style45"> <textarea name="reason" cols="80" rows="2"
			wrap="VIRTUAL" maxlength="256"><%
			if (overtimeApp.getReason() != null) {
				out.println(overtimeApp.getReason());
			}
		%></textarea> </span></td>
	</tr>
	<tr>
		<th height="50" colspan="2" bgcolor="#00FFCC" scope="row"><span
			class="style24">代休取得予定</span></th>
		<td height="50" align="left" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45">
		<table width="495" border="0" cellpadding="0">
			<tr>
				<td width="150" height="18" class="style39">
				<div align="left"><input name="compDay" type="radio"
					value="false"> <span class="style39">取得予定なし</span></div>
				</td>
				<td width="331" height="18">&nbsp;</td>
			</tr>
			<tr>
				<td height="18" class="style39">
				<div align="left"><input name="compDay" type="radio"
					value="true" checked> 取得予定あり</div>
				</td>
				<td height="18">
				<div align="left"><span class="style39"> <select
					name="compDayYear">
					<%
						for (int i = 0; i < years.length; i++) {
					%>
					<option><%=years[i]%></option>
					<%
						}
					%>
				</select> 年 <select name="compDayMonth">
					<option>1</option>
					<option>2</option>
					<option>3</option>
					<option>4</option>
					<option>5</option>
					<option>6</option>
					<option>7</option>
					<option>8</option>
					<option>9</option>
					<option>10</option>
					<option>11</option>
					<option>12</option>
				</select> 月 <select name="compDayDay">
					<option>1</option>
					<option>2</option>
					<option>3</option>
					<option>4</option>
					<option>5</option>
					<option>6</option>
					<option>7</option>
					<option>8</option>
					<option>9</option>
					<option>10</option>
					<option>11</option>
					<option>12</option>
					<option>13</option>
					<option>14</option>
					<option>15</option>
					<option>16</option>
					<option>17</option>
					<option>18</option>
					<option>19</option>
					<option>20</option>
					<option>21</option>
					<option>22</option>
					<option>23</option>
					<option>24</option>
					<option>25</option>
					<option>26</option>
					<option>27</option>
					<option>28</option>
					<option>29</option>
					<option>30</option>
					<option>31</option>
				</select> 日</span></div>
				</td>
			</tr>
		</table>
		</div>
		</td>
	</tr>
	<tr>
		<th height="50" colspan="2" bgcolor="#00FFCC" scope="row"><span
			class="style24">備考</span></th>
		<td height="50" bgcolor="#EEFFEE" class="style24">
		<div align="left" class="style45"><textarea name="remarks"
			cols="80" rows="2" wrap="VIRTUAL" maxlength="256"><%
			if (overtimeApp.getRemark() != null) {
				out.println(overtimeApp.getRemark());
			}
			%></textarea></div>
		</td>
	</tr>
</table>
<p>&nbsp;</p>
</div>
<table width="254" border="0" align="center">
	<tr>
		<td width="80" align="center"><input type="reset" name="clear"
			value="クリア"></td>
		<td width="80">
		<div align="center"><input type="submit" name="pressedButton"
			value="キャンセル"></div>
		</td>
		<td width="80" align="center"><input type="submit" name="pressedButton"
			value="確認"></td>
	</tr>
</table>
</form>
<%@ include file="include/footer.jsp"%>
</body>
</html>